mirror of
https://github.com/nillerusr/source-engine.git
synced 2025-04-11 18:57:47 +00:00
Merge 354089fe21
into 29985681a1
This commit is contained in:
commit
cdfd053e87
4
build_waf.sh
Normal file
4
build_waf.sh
Normal file
@ -0,0 +1,4 @@
|
||||
./waf configure -T release --destdir=E:/source_engine --prefix=E:/source_engine --build-game=hl1 &&
|
||||
./waf install --strip
|
||||
|
||||
# use can set --destdir and --prefix and set path , where you located source code
|
@ -12,8 +12,8 @@
|
||||
#include "hl1_clientscoreboard.h"
|
||||
|
||||
// default FOV for HL1
|
||||
ConVar default_fov( "default_fov", "90", FCVAR_CHEAT );
|
||||
ConVar fov_desired( "fov_desired", "90", FCVAR_ARCHIVE | FCVAR_USERINFO, "Sets the base field-of-view.", true, 75.0, true, 110.0 );
|
||||
ConVar default_fov( "default_fov", "110", FCVAR_CHEAT );
|
||||
ConVar fov_desired( "fov_desired", "90", FCVAR_ARCHIVE | FCVAR_USERINFO, "Sets the base field-of-view.", true, 75.0, true, 130.0 );
|
||||
|
||||
// The current client mode. Always ClientModeNormal in HL.
|
||||
IClientMode *g_pClientMode = NULL;
|
||||
@ -32,13 +32,9 @@ public:
|
||||
virtual void LevelShutdown( void );
|
||||
};
|
||||
|
||||
CHLModeManager::CHLModeManager( void )
|
||||
{
|
||||
}
|
||||
CHLModeManager::CHLModeManager( void ) = default;
|
||||
|
||||
CHLModeManager::~CHLModeManager( void )
|
||||
{
|
||||
}
|
||||
CHLModeManager::~CHLModeManager( void ) = default;
|
||||
|
||||
void CHLModeManager::Init( void )
|
||||
{
|
||||
@ -99,16 +95,12 @@ protected:
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
ClientModeHL1Normal::ClientModeHL1Normal()
|
||||
{
|
||||
}
|
||||
ClientModeHL1Normal::ClientModeHL1Normal() = default;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: If you don't know what a destructor is by now, you are probably going to get fired
|
||||
//-----------------------------------------------------------------------------
|
||||
ClientModeHL1Normal::~ClientModeHL1Normal()
|
||||
{
|
||||
}
|
||||
ClientModeHL1Normal::~ClientModeHL1Normal() = default;
|
||||
|
||||
void ClientModeHL1Normal::InitViewport()
|
||||
{
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
extern bool g_bRollingCredits;
|
||||
|
||||
ConVar fov_desired( "fov_desired", "75", FCVAR_ARCHIVE | FCVAR_USERINFO, "Sets the base field-of-view.", true, 75.0, true, 110.0 );
|
||||
ConVar fov_desired( "fov_desired", "75", FCVAR_ARCHIVE | FCVAR_USERINFO, "Sets the base field-of-view.", true, 75.0, true, 150.0 );
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Globals
|
||||
@ -70,9 +70,7 @@ ClientModeHLNormal::ClientModeHLNormal()
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
ClientModeHLNormal::~ClientModeHLNormal()
|
||||
{
|
||||
}
|
||||
ClientModeHLNormal::~ClientModeHLNormal() = default;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -367,7 +367,19 @@ int CNPC_Barney::OnTakeDamage_Alive( const CTakeDamageInfo &inputInfo )
|
||||
{
|
||||
Speak( BA_SHOT );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (gpGlobals->curtime >= m_flPainTime)
|
||||
{
|
||||
m_flPainTime = gpGlobals->curtime + random->RandomFloat(0.5, 0.75);
|
||||
|
||||
CPASAttenuationFilter filter(this);
|
||||
EmitSound(filter, entindex(), "Barney.Pain");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -88,8 +88,8 @@ enum
|
||||
|
||||
// Attack distance constants
|
||||
#define BIG_ATTACKDIST 170
|
||||
#define BIG_MORTARDIST 800
|
||||
#define BIG_MAXCHILDREN 6 // Max # of live headcrab children
|
||||
#define BIG_MORTARDIST 100
|
||||
#define BIG_MAXCHILDREN 8 // Max # of live headcrab children
|
||||
|
||||
|
||||
#define bits_MEMORY_CHILDPAIR (bits_MEMORY_CUSTOM1)
|
||||
@ -1310,4 +1310,4 @@ AI_BEGIN_CUSTOM_NPC( monster_bigmomma, CNPC_BigMomma )
|
||||
|
||||
AI_END_CUSTOM_NPC()
|
||||
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#include "ai_condition.h"
|
||||
#include "cbase.h"
|
||||
#include "beam_shared.h"
|
||||
#include "ai_default.h"
|
||||
@ -236,7 +237,7 @@ void CNPC_HGrunt::Spawn()
|
||||
m_bloodColor = BLOOD_COLOR_RED;
|
||||
ClearEffects();
|
||||
m_iHealth = sk_hgrunt_health.GetFloat();
|
||||
m_flFieldOfView = 0.2;// indicates the width of this monster's forward view cone ( as a dotproduct result )
|
||||
m_flFieldOfView = 0.4;// indicates the width of this monster's forward view cone ( as a dotproduct result )
|
||||
m_NPCState = NPC_STATE_NONE;
|
||||
m_flNextGrenadeCheck = gpGlobals->curtime + 1;
|
||||
m_flNextPainTime = gpGlobals->curtime;
|
||||
@ -299,8 +300,25 @@ void CNPC_HGrunt::Spawn()
|
||||
BaseClass::Spawn();
|
||||
|
||||
NPCInit();
|
||||
CreateVPhysics();
|
||||
}
|
||||
|
||||
bool CNPC_HGrunt::CreateVPhysics(void)
|
||||
{
|
||||
VPhysicsDestroyObject();
|
||||
|
||||
CPhysCollide* pModel = PhysCreateBbox(NAI_Hull::Mins(HULL_HUMAN), NAI_Hull::Maxs(HULL_HUMAN));
|
||||
IPhysicsObject* pPhysics = PhysModelCreateCustom(this, pModel, GetAbsOrigin(), GetAbsAngles(), "barney_hull", false);
|
||||
|
||||
VPhysicsSetObject(pPhysics);
|
||||
if (pPhysics)
|
||||
{
|
||||
pPhysics->SetCallbackFlags(CALLBACK_GLOBAL_COLLISION | CALLBACK_SHADOW_COLLISION);
|
||||
}
|
||||
PhysAddShadow(this);
|
||||
|
||||
return true;
|
||||
}
|
||||
int CNPC_HGrunt::IRelationPriority( CBaseEntity *pTarget )
|
||||
{
|
||||
//I hate alien grunts more than anything.
|
||||
@ -425,10 +443,11 @@ void CNPC_HGrunt::PrescheduleThink ( void )
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( gpGlobals->curtime - pSquadLeader->m_flLastEnemySightTime > 5 )
|
||||
if ( gpGlobals->curtime - pSquadLeader->m_flLastEnemySightTime > 5.0f )
|
||||
{
|
||||
// been a while since we've seen the enemy
|
||||
pSquadLeader->GetEnemies()->MarkAsEluded( GetEnemy() );
|
||||
pSquadLeader->GetEnemies()->MarkAsEluded( GetEnemy() );
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -624,6 +643,10 @@ int CNPC_HGrunt::RangeAttack1Conditions ( float flDot, float flDist )
|
||||
// kick nonclients, but don't shoot at them.
|
||||
return COND_NONE;
|
||||
}
|
||||
if (GetEnemy())
|
||||
{
|
||||
return COND_CAN_RANGE_ATTACK1;
|
||||
}
|
||||
|
||||
Vector vecSrc;
|
||||
QAngle angAngles;
|
||||
@ -768,7 +791,7 @@ int CNPC_HGrunt::GetGrenadeConditions( float flDot, float flDist )
|
||||
m_vecTossVelocity = vecToss;
|
||||
|
||||
// don't check again for a while.
|
||||
m_flNextGrenadeCheck = gpGlobals->curtime + 0.3; // 1/3 second.
|
||||
m_flNextGrenadeCheck = gpGlobals->curtime + 0.1; // 1/3 second.
|
||||
|
||||
return COND_CAN_RANGE_ATTACK2;
|
||||
}
|
||||
@ -1640,6 +1663,7 @@ int CNPC_HGrunt::SelectSchedule( void )
|
||||
// little time and give the player a chance to turn.
|
||||
if ( pSquadLeader && pSquadLeader->EnemyHasEludedMe() && !HasCondition ( COND_ENEMY_FACING_ME ) )
|
||||
{
|
||||
pSquadLeader->EnemyHasEludedMe(); // try to fix bug in chapter we`re all hostiles
|
||||
return SCHED_GRUNT_FOUND_ENEMY;
|
||||
}
|
||||
}
|
||||
@ -2557,7 +2581,14 @@ AI_BEGIN_CUSTOM_NPC( monster_human_grunt, CNPC_HGrunt )
|
||||
|
||||
AI_END_CUSTOM_NPC()
|
||||
|
||||
// Nothing , just shit
|
||||
/* void MortarSpray(const Vector& position, const Vector& direction, int spriteModel, int count)
|
||||
{
|
||||
CPVSFilter filter(position);
|
||||
|
||||
te->SpriteSpray(filter, 0.0, &position, &direction, spriteModel, 200, 80, count);
|
||||
}
|
||||
*/
|
||||
//=========================================================
|
||||
// DEAD HGRUNT PROP
|
||||
//=========================================================
|
||||
@ -2641,4 +2672,4 @@ void CNPC_DeadHGrunt::Spawn( void )
|
||||
}
|
||||
|
||||
NPCInitDead();
|
||||
}
|
||||
}
|
@ -24,6 +24,7 @@ public:
|
||||
void PrescheduleThink ( void );
|
||||
|
||||
bool FOkToSpeak( void );
|
||||
bool CreateVPhysics( void );
|
||||
|
||||
Class_T Classify ( void );
|
||||
int RangeAttack1Conditions ( float flDot, float flDist );
|
||||
|
@ -936,13 +936,13 @@ void CNPC_Tentacle::HitTouch( CBaseEntity *pOther )
|
||||
//as the ragdoll only covers the top portion of the tentacle.
|
||||
if ( pOther->m_takedamage )
|
||||
{
|
||||
CTakeDamageInfo info( this, this, m_iHitDmg, DMG_CLUB );
|
||||
CTakeDamageInfo info( this, this, m_iHitDmg, DMG_CLUB | DMG_ALWAYSGIB );
|
||||
|
||||
Vector vDamageForce = pOther->GetAbsOrigin() - GetAbsOrigin();
|
||||
VectorNormalize( vDamageForce );
|
||||
|
||||
CalculateMeleeDamageForce( &info, vDamageForce, pOther->GetAbsOrigin() );
|
||||
pOther->TakeDamage( info );
|
||||
CalculateMeleeDamageForce( &info, vDamageForce, pOther->GetAbsOrigin());
|
||||
|
||||
|
||||
m_flHitTime = gpGlobals->curtime + 0.5;
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include "cbase.h"
|
||||
#include "hl1mp_basecombatweapon_shared.h"
|
||||
#include "weapon_parse.h"
|
||||
|
||||
#ifdef CLIENT_DLL
|
||||
#include "c_baseplayer.h"
|
||||
@ -22,6 +23,7 @@
|
||||
#include "mathlib/mathlib.h"
|
||||
#include "in_buttons.h"
|
||||
|
||||
|
||||
#include "vstdlib/random.h"
|
||||
|
||||
extern ConVar sk_plr_dmg_crowbar;
|
||||
@ -63,7 +65,7 @@ private:
|
||||
virtual void Swing( void );
|
||||
virtual void Hit( void );
|
||||
virtual void ImpactEffect( void );
|
||||
void ImpactSound( CBaseEntity *pHitEntity );
|
||||
void ImpactSound( bool isWorld , trace_t &hitTrace , CBaseEntity *pHitEntity);
|
||||
virtual Activity ChooseIntersectionPointAndActivity( trace_t &hitTrace, const Vector &mins, const Vector &maxs, CBasePlayer *pOwner );
|
||||
|
||||
public:
|
||||
@ -95,7 +97,7 @@ BEGIN_DATADESC( CWeaponCrowbar )
|
||||
|
||||
// Function Pointers
|
||||
DEFINE_FUNCTION( Hit ),
|
||||
|
||||
|
||||
END_DATADESC()
|
||||
#endif
|
||||
|
||||
@ -184,8 +186,9 @@ void CWeaponCrowbar::Hit( void )
|
||||
TraceAttackToTriggers( CTakeDamageInfo( GetOwner(), GetOwner(), sk_plr_dmg_crowbar.GetFloat(), DMG_CLUB ), m_traceHit.startpos, m_traceHit.endpos, hitDirection );
|
||||
|
||||
//Play an impact sound
|
||||
ImpactSound( pHitEntity );
|
||||
ImpactSound( pHitEntity->Classify() == CLASS_NONE || pHitEntity->Classify() == CLASS_MACHINE, m_traceHit , pHitEntity );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//Apply an impact effect
|
||||
@ -197,23 +200,31 @@ void CWeaponCrowbar::Hit( void )
|
||||
// Input : pHitEntity - entity that we hit
|
||||
// assumes pHitEntity is not null
|
||||
//-----------------------------------------------------------------------------
|
||||
void CWeaponCrowbar::ImpactSound( CBaseEntity *pHitEntity )
|
||||
void CWeaponCrowbar::ImpactSound( bool isWorld , trace_t &hitTrace , CBaseEntity *pHitEntity )
|
||||
{
|
||||
bool bIsWorld = ( pHitEntity->entindex() == 0 );
|
||||
bool IsWorld = ( pHitEntity->entindex() );
|
||||
#ifndef CLIENT_DLL
|
||||
if ( !bIsWorld )
|
||||
if ( !isWorld )
|
||||
{
|
||||
bIsWorld |= pHitEntity->Classify() == CLASS_NONE || pHitEntity->Classify() == CLASS_MACHINE;
|
||||
isWorld |= pHitEntity->Classify() == CLASS_NONE || pHitEntity->Classify() == CLASS_MACHINE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if( bIsWorld )
|
||||
if( isWorld )
|
||||
{
|
||||
WeaponSound( MELEE_HIT_WORLD );
|
||||
switch (random->RandomInt(0, 1))
|
||||
{
|
||||
case 0:
|
||||
WeaponSound( MELEE_HIT_WORLD );
|
||||
break;
|
||||
case 1:
|
||||
WeaponSound( MELEE_HIT );
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
WeaponSound( MELEE_HIT );
|
||||
WeaponSound( MELEE_MISS );
|
||||
}
|
||||
}
|
||||
|
||||
@ -376,4 +387,4 @@ void CWeaponCrowbar::Swing( void )
|
||||
//Send the anim
|
||||
SendWeaponAnim( m_nHitActivity );
|
||||
pOwner->SetAnimation( PLAYER_ATTACK1 );
|
||||
}
|
||||
}
|
@ -112,7 +112,7 @@ void CWeapon357::PrimaryAttack( void )
|
||||
else
|
||||
{
|
||||
WeaponSound( EMPTY );
|
||||
m_flNextPrimaryAttack = 0.15;
|
||||
m_flNextPrimaryAttack = 0.1;
|
||||
}
|
||||
|
||||
return;
|
||||
|
@ -18,10 +18,10 @@
|
||||
|
||||
|
||||
// Armor given by a battery
|
||||
#define MAX_NORMAL_BATTERY 100
|
||||
#define MAX_NORMAL_BATTERY 200
|
||||
|
||||
// Ammo counts given by ammo items
|
||||
#define SIZE_AMMO_PISTOL 20
|
||||
#define SIZE_AMMO_PISTOL 18
|
||||
#define SIZE_AMMO_PISTOL_LARGE 100
|
||||
#define SIZE_AMMO_SMG1 45
|
||||
#define SIZE_AMMO_SMG1_LARGE 225
|
||||
@ -31,7 +31,7 @@
|
||||
#define SIZE_AMMO_SMG1_GRENADE 1
|
||||
#define SIZE_AMMO_BUCKSHOT 20
|
||||
#define SIZE_AMMO_357 6
|
||||
#define SIZE_AMMO_357_LARGE 20
|
||||
#define SIZE_AMMO_357_LARGE 80
|
||||
#define SIZE_AMMO_CROSSBOW 6
|
||||
#define SIZE_AMMO_AR2_ALTFIRE 1
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
@ -13,74 +13,74 @@
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
#include "tier0/memdbgon.h"
|
||||
|
||||
#define LIGHTGLOW_MAXDIST_BITS 16
|
||||
#define LIGHTGLOW_MAXDIST_MAX_VALUE ((1 << LIGHTGLOW_MAXDIST_BITS)-1)
|
||||
#define LIGHTGLOW_MAXDIST_BITS 16
|
||||
#define LIGHTGLOW_MAXDIST_MAX_VALUE ((1 << LIGHTGLOW_MAXDIST_BITS) - 1)
|
||||
|
||||
#define LIGHTGLOW_OUTERMAXDIST_BITS 16
|
||||
#define LIGHTGLOW_OUTERMAXDIST_MAX_VALUE ((1 << LIGHTGLOW_OUTERMAXDIST_BITS)-1)
|
||||
#define LIGHTGLOW_OUTERMAXDIST_BITS 16
|
||||
#define LIGHTGLOW_OUTERMAXDIST_MAX_VALUE ((1 << LIGHTGLOW_OUTERMAXDIST_BITS) - 1)
|
||||
|
||||
class CLightGlow : public CBaseEntity
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS( CLightGlow, CBaseEntity );
|
||||
DECLARE_CLASS(CLightGlow, CBaseEntity);
|
||||
DECLARE_SERVERCLASS();
|
||||
DECLARE_DATADESC();
|
||||
|
||||
CLightGlow();
|
||||
|
||||
virtual void Spawn( void );
|
||||
virtual void Activate( void );
|
||||
virtual int UpdateTransmitState( void );
|
||||
CLightGlow();
|
||||
|
||||
virtual void Spawn(void);
|
||||
virtual void Activate(void);
|
||||
virtual int UpdateTransmitState(void);
|
||||
|
||||
void InputColor(inputdata_t &data);
|
||||
|
||||
public:
|
||||
CNetworkVar( int, m_nHorizontalSize );
|
||||
CNetworkVar( int, m_nVerticalSize );
|
||||
CNetworkVar( int, m_nMinDist );
|
||||
CNetworkVar( int, m_nMaxDist );
|
||||
CNetworkVar( int, m_nOuterMaxDist );
|
||||
CNetworkVar(int, m_nHorizontalSize);
|
||||
CNetworkVar(int, m_nVerticalSize);
|
||||
CNetworkVar(int, m_nMinDist);
|
||||
CNetworkVar(int, m_nMaxDist);
|
||||
CNetworkVar(int, m_nOuterMaxDist);
|
||||
|
||||
CNetworkVar( float, m_flGlowProxySize );
|
||||
CNetworkVar( float, m_flHDRColorScale );
|
||||
CNetworkVar(float, m_flGlowProxySize);
|
||||
CNetworkVar(float, m_flHDRColorScale);
|
||||
};
|
||||
|
||||
extern void SendProxy_Angles( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID );
|
||||
extern void SendProxy_Angles(const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID);
|
||||
|
||||
IMPLEMENT_SERVERCLASS_ST_NOBASE( CLightGlow, DT_LightGlow )
|
||||
SendPropInt( SENDINFO(m_clrRender), 32, SPROP_UNSIGNED, SendProxy_Color32ToInt ),
|
||||
SendPropInt( SENDINFO(m_nHorizontalSize), 16, SPROP_UNSIGNED ),
|
||||
SendPropInt( SENDINFO(m_nVerticalSize), 16, SPROP_UNSIGNED ),
|
||||
SendPropInt( SENDINFO(m_nMinDist), 16, SPROP_UNSIGNED ),
|
||||
SendPropInt( SENDINFO(m_nMaxDist), LIGHTGLOW_MAXDIST_BITS, SPROP_UNSIGNED ),
|
||||
SendPropInt( SENDINFO(m_nOuterMaxDist), LIGHTGLOW_OUTERMAXDIST_BITS, SPROP_UNSIGNED ),
|
||||
SendPropInt( SENDINFO(m_spawnflags), 8, SPROP_UNSIGNED ),
|
||||
SendPropVector(SENDINFO(m_vecOrigin), -1, SPROP_COORD ),
|
||||
SendPropQAngles (SENDINFO(m_angRotation), 13, 0, SendProxy_Angles ),
|
||||
SendPropEHandle (SENDINFO_NAME(m_hMoveParent, moveparent)),
|
||||
SendPropFloat( SENDINFO(m_flGlowProxySize ), 6, SPROP_ROUNDUP, 0.0f, 64.0f ),
|
||||
SendPropFloat( SENDINFO_NAME( m_flHDRColorScale, HDRColorScale ), 0, SPROP_NOSCALE, 0.0f, 100.0f ),
|
||||
END_SEND_TABLE()
|
||||
IMPLEMENT_SERVERCLASS_ST_NOBASE(CLightGlow, DT_LightGlow)
|
||||
SendPropInt(SENDINFO(m_clrRender), 32, SPROP_UNSIGNED, SendProxy_Color32ToInt),
|
||||
SendPropInt(SENDINFO(m_nHorizontalSize), 16, SPROP_UNSIGNED),
|
||||
SendPropInt(SENDINFO(m_nVerticalSize), 16, SPROP_UNSIGNED),
|
||||
SendPropInt(SENDINFO(m_nMinDist), 16, SPROP_UNSIGNED),
|
||||
SendPropInt(SENDINFO(m_nMaxDist), LIGHTGLOW_MAXDIST_BITS, SPROP_UNSIGNED),
|
||||
SendPropInt(SENDINFO(m_nOuterMaxDist), LIGHTGLOW_OUTERMAXDIST_BITS, SPROP_UNSIGNED),
|
||||
SendPropInt(SENDINFO(m_spawnflags), 8, SPROP_UNSIGNED),
|
||||
SendPropVector(SENDINFO(m_vecOrigin), -1, SPROP_COORD),
|
||||
SendPropQAngles(SENDINFO(m_angRotation), 13, 0, SendProxy_Angles),
|
||||
SendPropEHandle(SENDINFO_NAME(m_hMoveParent, moveparent)),
|
||||
SendPropFloat(SENDINFO(m_flGlowProxySize), 6, SPROP_ROUNDUP, 0.0f, 64.0f),
|
||||
SendPropFloat(SENDINFO_NAME(m_flHDRColorScale, HDRColorScale), 0, SPROP_NOSCALE, 0.0f, 100.0f),
|
||||
END_SEND_TABLE()
|
||||
|
||||
LINK_ENTITY_TO_CLASS( env_lightglow, CLightGlow );
|
||||
LINK_ENTITY_TO_CLASS(env_lightglow, CLightGlow);
|
||||
|
||||
BEGIN_DATADESC( CLightGlow )
|
||||
BEGIN_DATADESC(CLightGlow)
|
||||
|
||||
DEFINE_KEYFIELD( m_nVerticalSize, FIELD_INTEGER, "VerticalGlowSize" ),
|
||||
DEFINE_KEYFIELD( m_nHorizontalSize, FIELD_INTEGER, "HorizontalGlowSize" ),
|
||||
DEFINE_KEYFIELD( m_nMinDist, FIELD_INTEGER, "MinDist" ),
|
||||
DEFINE_KEYFIELD( m_nMaxDist, FIELD_INTEGER, "MaxDist" ),
|
||||
DEFINE_KEYFIELD( m_nOuterMaxDist, FIELD_INTEGER, "OuterMaxDist" ),
|
||||
DEFINE_KEYFIELD( m_flGlowProxySize, FIELD_FLOAT, "GlowProxySize" ),
|
||||
DEFINE_KEYFIELD( m_flHDRColorScale, FIELD_FLOAT, "HDRColorScale" ),
|
||||
DEFINE_INPUTFUNC( FIELD_COLOR32, "Color", InputColor ),
|
||||
DEFINE_KEYFIELD(m_nVerticalSize, FIELD_INTEGER, "VerticalGlowSize"),
|
||||
DEFINE_KEYFIELD(m_nHorizontalSize, FIELD_INTEGER, "HorizontalGlowSize"),
|
||||
DEFINE_KEYFIELD(m_nMinDist, FIELD_INTEGER, "MinDist"),
|
||||
DEFINE_KEYFIELD(m_nMaxDist, FIELD_INTEGER, "MaxDist"),
|
||||
DEFINE_KEYFIELD(m_nOuterMaxDist, FIELD_INTEGER, "OuterMaxDist"),
|
||||
DEFINE_KEYFIELD(m_flGlowProxySize, FIELD_FLOAT, "GlowProxySize"),
|
||||
DEFINE_KEYFIELD(m_flHDRColorScale, FIELD_FLOAT, "HDRColorScale"),
|
||||
DEFINE_INPUTFUNC(FIELD_COLOR32, "Color", InputColor),
|
||||
|
||||
END_DATADESC()
|
||||
END_DATADESC()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Constructor
|
||||
//-----------------------------------------------------------------------------
|
||||
CLightGlow::CLightGlow( void )
|
||||
//-----------------------------------------------------------------------------
|
||||
// Constructor
|
||||
//-----------------------------------------------------------------------------
|
||||
CLightGlow::CLightGlow(void)
|
||||
{
|
||||
m_nHorizontalSize = 0.0f;
|
||||
m_nVerticalSize = 0.0f;
|
||||
@ -91,41 +91,41 @@ CLightGlow::CLightGlow( void )
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
void CLightGlow::Spawn( void )
|
||||
void CLightGlow::Spawn(void)
|
||||
{
|
||||
BaseClass::Spawn();
|
||||
|
||||
// No model but we still need to force this!
|
||||
AddEFlags( EFL_FORCE_CHECK_TRANSMIT );
|
||||
AddEFlags(EFL_FORCE_CHECK_TRANSMIT);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Always transmit light glows to clients to avoid spikes as we enter
|
||||
// or leave PVS. Done because we often have many glows in an area.
|
||||
//-----------------------------------------------------------------------------
|
||||
int CLightGlow::UpdateTransmitState( void )
|
||||
int CLightGlow::UpdateTransmitState(void)
|
||||
{
|
||||
return SetTransmitState( FL_EDICT_ALWAYS );
|
||||
return SetTransmitState(FL_EDICT_ALWAYS);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
void CLightGlow::Activate()
|
||||
{
|
||||
BaseClass::Activate();
|
||||
|
||||
if ( m_nMaxDist > LIGHTGLOW_MAXDIST_MAX_VALUE )
|
||||
if (m_nMaxDist > LIGHTGLOW_MAXDIST_MAX_VALUE)
|
||||
{
|
||||
Warning( "env_lightglow maxdist too large (%d should be %d).\n", m_nMaxDist.Get(), LIGHTGLOW_MAXDIST_MAX_VALUE );
|
||||
Warning("env_lightglow maxdist too large (%d should be %d).\n", m_nMaxDist.Get(), LIGHTGLOW_MAXDIST_MAX_VALUE);
|
||||
m_nMaxDist = LIGHTGLOW_MAXDIST_MAX_VALUE;
|
||||
}
|
||||
|
||||
if ( m_nOuterMaxDist > LIGHTGLOW_OUTERMAXDIST_MAX_VALUE )
|
||||
if (m_nOuterMaxDist > LIGHTGLOW_OUTERMAXDIST_MAX_VALUE)
|
||||
{
|
||||
Warning( "env_lightglow outermaxdist too large (%d should be %d).\n", m_nOuterMaxDist.Get(), LIGHTGLOW_OUTERMAXDIST_MAX_VALUE );
|
||||
Warning("env_lightglow outermaxdist too large (%d should be %d).\n", m_nOuterMaxDist.Get(), LIGHTGLOW_OUTERMAXDIST_MAX_VALUE);
|
||||
m_nOuterMaxDist = LIGHTGLOW_OUTERMAXDIST_MAX_VALUE;
|
||||
}
|
||||
}
|
||||
|
@ -859,7 +859,7 @@ void CGameRules::ClientSettingsChanged( CBasePlayer *pPlayer )
|
||||
if ( pszFov )
|
||||
{
|
||||
int iFov = atoi(pszFov);
|
||||
iFov = clamp( iFov, 75, 110 );
|
||||
iFov = clamp( iFov, 75, 150 );
|
||||
pPlayer->SetDefaultFOV( iFov );
|
||||
}
|
||||
|
||||
|
@ -232,7 +232,7 @@ enum CastVote
|
||||
|
||||
#define MAX_PLACE_NAME_LENGTH 18
|
||||
|
||||
#define MAX_FOV 110
|
||||
#define MAX_FOV 150
|
||||
|
||||
//===================================================================================================================
|
||||
// Team Defines
|
||||
|
@ -233,6 +233,10 @@ $Project "GameUI"
|
||||
$File "OptionsSubVideo.h"
|
||||
$File "OptionsSubVoice.cpp"
|
||||
$File "OptionsSubVoice.h"
|
||||
$File "OptionsSubModificcation.cpp"
|
||||
$File "OptionsSubModificcation.h"
|
||||
|
||||
|
||||
}
|
||||
|
||||
$Folder "Link Libraries"
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "OptionsSubMultiplayer.h"
|
||||
#include "OptionsSubDifficulty.h"
|
||||
#include "OptionsSubPortal.h"
|
||||
#include "OptionsSubModification.h"
|
||||
#ifdef WIN32
|
||||
// NVNT haptic configuration dialog
|
||||
#include "OptionsSubHaptics.h"
|
||||
@ -94,8 +95,11 @@ COptionsDialog::COptionsDialog(vgui::Panel *parent) : PropertyDialog(parent, "Op
|
||||
m_pOptionsSubAudio = new COptionsSubAudio(this);
|
||||
AddPage(m_pOptionsSubAudio, "#GameUI_Audio");
|
||||
m_pOptionsSubVideo = new COptionsSubVideo(this);
|
||||
|
||||
AddPage(m_pOptionsSubVideo, "#GameUI_Video");
|
||||
|
||||
AddPage(new COptionsSubModification(this), "ModInfo");
|
||||
AddPage(new COptionsSubPortal(this), "#GameUI_Portal");
|
||||
|
||||
if ( !ModInfo().IsSinglePlayerOnly() )
|
||||
{
|
||||
AddPage(new COptionsSubVoice(this), "#GameUI_Voice");
|
||||
@ -119,9 +123,7 @@ COptionsDialog::COptionsDialog(vgui::Panel *parent) : PropertyDialog(parent, "Op
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Destructor
|
||||
//-----------------------------------------------------------------------------
|
||||
COptionsDialog::~COptionsDialog()
|
||||
{
|
||||
}
|
||||
COptionsDialog::~COptionsDialog() = default;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Brings the dialog to the fore
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#ifndef OPTIONSDIALOG_H
|
||||
#define OPTIONSDIALOG_H
|
||||
#include "OptionsSubModification.h"
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
@ -37,6 +38,7 @@ public:
|
||||
private:
|
||||
class COptionsSubAudio *m_pOptionsSubAudio;
|
||||
class COptionsSubVideo *m_pOptionsSubVideo;
|
||||
class COptionsSubModification *m_pOptionsSubModification;
|
||||
vgui::PropertyPage *m_pOptionsSubMultiplayer;
|
||||
};
|
||||
|
||||
|
@ -72,9 +72,7 @@ COptionsSubAudio::COptionsSubAudio(vgui::Panel *parent) : PropertyPage(parent, N
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Destructor
|
||||
//-----------------------------------------------------------------------------
|
||||
COptionsSubAudio::~COptionsSubAudio()
|
||||
{
|
||||
}
|
||||
COptionsSubAudio::~COptionsSubAudio() = default;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Reloads data
|
||||
|
@ -67,6 +67,7 @@ void COptionsSubDifficulty::OnApplyChanges()
|
||||
{
|
||||
var.SetValue( 2 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -22,9 +22,7 @@ COptionsSubGame::COptionsSubGame( vgui::Panel *parent, const char *name ) : Base
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Destructor
|
||||
//-----------------------------------------------------------------------------
|
||||
COptionsSubGame::~COptionsSubGame()
|
||||
{
|
||||
}
|
||||
COptionsSubGame::~COptionsSubGame() = default;
|
||||
|
||||
void COptionsSubGame::OnClose( void )
|
||||
{
|
||||
|
143
gameui/OptionsSubModification.cpp
Normal file
143
gameui/OptionsSubModification.cpp
Normal file
@ -0,0 +1,143 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
#include "OptionsSubModification.h"
|
||||
#include "CvarSlider.h"
|
||||
|
||||
#include "CvarToggleCheckButton.h"
|
||||
#include "EngineInterface.h"
|
||||
|
||||
#include <KeyValues.h>
|
||||
#include <vgui/IScheme.h>
|
||||
#include "vgui_controls/Controls.h"
|
||||
#include <vgui_controls/TextEntry.h>
|
||||
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
#include <tier0/memdbgon.h>
|
||||
|
||||
using namespace vgui;
|
||||
|
||||
COptionsSubModification::COptionsSubModification(vgui::Panel *parent) : PropertyPage(parent, nullptr)
|
||||
{
|
||||
// Create the slider for aspect ratio adjustments
|
||||
m_pAspectRatioSlider = new CCvarSlider(
|
||||
this,
|
||||
"AspectRatioSlider",
|
||||
"Aspect Ratio",
|
||||
0.1f, 3.0f, // Slider range: 0.1 to 3.0
|
||||
"r_aspectratio",
|
||||
true // Allow fractional values
|
||||
);
|
||||
|
||||
m_pAspectRatioLabel = new TextEntry(this, "AspectRatioLabel");
|
||||
m_pAspectRatioLabel->AddActionSignalTarget(this);
|
||||
|
||||
m_pChangeCheatFlag = new CCvarToggleCheckButton(
|
||||
this , "ChangeCheatFlag" , "Change Cheat Flag" , "sv_cheats"
|
||||
);
|
||||
m_pGiveWeaponButton = new Button(this, "GiveWeapon", "Give Weapon");
|
||||
// Load settings from the associated resource file
|
||||
LoadControlSettings("Resource\\OptionsSubModification.res");
|
||||
m_pGiveWeaponButton->SetCommand("GiveWeapon");
|
||||
m_pGiveWeaponButton->AddActionSignalTarget(this);
|
||||
|
||||
m_pGiveHealthKitButton = new Button(this, "GiveHealthKit", "Give Health Kit");
|
||||
m_pGiveHealthKitButton->SetCommand("GiveHealthKit");
|
||||
m_pGiveHealthKitButton->AddActionSignalTarget(this);
|
||||
|
||||
|
||||
UpdateLabel(m_pAspectRatioSlider, m_pAspectRatioLabel);
|
||||
|
||||
m_pGiveWeaponButton->SetEnabled(true);
|
||||
}
|
||||
COptionsSubModification::~COptionsSubModification() = default;
|
||||
|
||||
void COptionsSubModification::OnTextChanged(Panel *panel)
|
||||
{
|
||||
if (panel == m_pAspectRatioLabel)
|
||||
{
|
||||
char buf[64];
|
||||
m_pAspectRatioLabel->GetText(buf, 64);
|
||||
|
||||
float fValue;
|
||||
int numParsed = sscanf(buf, "%f", &fValue);
|
||||
if ((numParsed == 1) && (fValue >= 0.0f))
|
||||
{
|
||||
m_pAspectRatioSlider->SetSliderValue(fValue);
|
||||
PostActionSignal(new KeyValues("ApplyButtonEnable"));
|
||||
}
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Resets the data to the initial state
|
||||
//-----------------------------------------------------------------------------
|
||||
void COptionsSubModification::OnResetData()
|
||||
{
|
||||
m_pAspectRatioSlider->Reset();
|
||||
m_pChangeCheatFlag->Reset();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Applies changes made by the user
|
||||
//-----------------------------------------------------------------------------
|
||||
void COptionsSubModification::OnApplyChanges()
|
||||
{
|
||||
m_pAspectRatioSlider->ApplyChanges();
|
||||
m_pChangeCheatFlag->ApplyChanges();
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Handles slider modifications
|
||||
//-----------------------------------------------------------------------------
|
||||
void COptionsSubModification::OnControlModified(Panel *panel)
|
||||
{
|
||||
PostActionSignal(new KeyValues("ApplyButtonEnable"));
|
||||
|
||||
// Update the label based on slider changes
|
||||
if (panel == m_pAspectRatioSlider && m_pAspectRatioSlider->HasBeenModified())
|
||||
{
|
||||
UpdateLabel(m_pAspectRatioSlider, m_pAspectRatioLabel);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sets scheme-specific properties
|
||||
//-----------------------------------------------------------------------------
|
||||
void COptionsSubModification::ApplySchemeSettings(IScheme *pScheme)
|
||||
{
|
||||
BaseClass::ApplySchemeSettings(pScheme);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Updates the label text based on slider value
|
||||
//-----------------------------------------------------------------------------
|
||||
void COptionsSubModification::UpdateLabel(CCvarSlider *slider, vgui::TextEntry *label)
|
||||
{
|
||||
char buf[64];
|
||||
Q_snprintf(buf, sizeof(buf), "%.2f", slider->GetSliderValue());
|
||||
label->SetText(buf);
|
||||
}
|
||||
void COptionsSubModification::OnCommand(const char *command)
|
||||
{
|
||||
if (!stricmp(command, "GiveWeapon"))
|
||||
{
|
||||
engine->ExecuteClientCmd("impulse 101");
|
||||
Msg("GiveWeapon command triggered\n"); // Debug message
|
||||
}
|
||||
if(!stricmp(command, "GiveHealthKit"))
|
||||
{
|
||||
engine->ExecuteClientCmd("give item_healthkit");
|
||||
Msg("GiveHealthKit command triggered\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
BaseClass::OnCommand(command); // Make sure to call the base class for any other commands
|
||||
}
|
||||
}
|
67
gameui/OptionsSubModification.h
Normal file
67
gameui/OptionsSubModification.h
Normal file
@ -0,0 +1,67 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef OPTIONS_SUB_MODIFICATION_H
|
||||
#define OPTIONS_SUB_MODIFICATION_H
|
||||
#include "vgui_controls/Button.h"
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <vgui_controls/PropertyPage.h>
|
||||
|
||||
class CCvarNegateCheckButton;
|
||||
class CKeyToggleCheckButton;
|
||||
class CCvarToggleCheckButton;
|
||||
class CCvarSlider;
|
||||
|
||||
|
||||
namespace vgui
|
||||
{
|
||||
class Label;
|
||||
class Panel;
|
||||
}
|
||||
class VControlsListPanel;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Touch Details, Part of OptionsDialog
|
||||
//-----------------------------------------------------------------------------
|
||||
class COptionsSubModification : public vgui::PropertyPage
|
||||
{
|
||||
DECLARE_CLASS_SIMPLE(COptionsSubModification, vgui::PropertyPage);
|
||||
|
||||
public:
|
||||
COptionsSubModification(vgui::Panel *parent);
|
||||
~COptionsSubModification();
|
||||
|
||||
virtual void OnResetData();
|
||||
virtual void OnApplyChanges();
|
||||
virtual void OnCommand(const char *command);
|
||||
|
||||
protected:
|
||||
virtual void ApplySchemeSettings(vgui::IScheme *pScheme);
|
||||
|
||||
MESSAGE_FUNC_PTR(OnControlModified, "ControlModified", panel);
|
||||
MESSAGE_FUNC_PTR(OnTextChanged, "TextChanged", panel);
|
||||
MESSAGE_FUNC_PTR(OnCheckButtonChecked, "CheckButtonChecked", panel)
|
||||
{
|
||||
OnControlModified(panel);
|
||||
}
|
||||
|
||||
void UpdateLabel(CCvarSlider *slider, vgui::TextEntry *label);
|
||||
|
||||
private:
|
||||
vgui::TextEntry *m_pAspectRatioLabel;
|
||||
vgui::Button *m_pGiveWeaponButton;
|
||||
vgui::Button *m_pGiveHealthKitButton;
|
||||
|
||||
|
||||
CCvarToggleCheckButton *m_pChangeCheatFlag;
|
||||
CCvarSlider *m_pAspectRatioSlider;
|
||||
};
|
||||
|
||||
#endif // OPTIONS_SUB_MODIFICATION_H
|
@ -1,13 +1,13 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//
|
||||
//=============================================================================//
|
||||
#include "OptionsSubMouse.h"
|
||||
//#include "CommandCheckButton.h"
|
||||
#include "KeyToggleCheckButton.h"
|
||||
// #include "CommandCheckButton.h"
|
||||
//#include "KeyToggleCheckButton.h" (Not used direcly)
|
||||
#include "CvarNegateCheckButton.h"
|
||||
#include "CvarToggleCheckButton.h"
|
||||
#include "cvarslider.h"
|
||||
@ -26,73 +26,72 @@ using namespace vgui;
|
||||
|
||||
COptionsSubMouse::COptionsSubMouse(vgui::Panel *parent) : PropertyPage(parent, NULL)
|
||||
{
|
||||
m_pReverseMouseCheckBox = new CCvarNegateCheckButton(
|
||||
this,
|
||||
"ReverseMouse",
|
||||
"#GameUI_ReverseMouse",
|
||||
"m_pitch" );
|
||||
|
||||
m_pMouseFilterCheckBox = new CCvarToggleCheckButton(
|
||||
this,
|
||||
"MouseFilter",
|
||||
"#GameUI_MouseFilter",
|
||||
"m_filter" );
|
||||
m_pReverseMouseCheckBox = new CCvarNegateCheckButton(
|
||||
this,
|
||||
"ReverseMouse",
|
||||
"#GameUI_ReverseMouse",
|
||||
"m_pitch");
|
||||
|
||||
m_pMouseRawCheckBox = new CCvarToggleCheckButton(
|
||||
this,
|
||||
"MouseRaw",
|
||||
"#GameUI_MouseRaw",
|
||||
"m_rawinput" );
|
||||
m_pMouseFilterCheckBox = new CCvarToggleCheckButton(
|
||||
this,
|
||||
"MouseFilter",
|
||||
"#GameUI_MouseFilter",
|
||||
"m_filter");
|
||||
|
||||
m_pMouseAccelerationCheckBox = new CheckButton(
|
||||
this,
|
||||
"MouseAccelerationCheckbox",
|
||||
"#GameUI_MouseCustomAccel" );
|
||||
m_pMouseRawCheckBox = new CCvarToggleCheckButton(
|
||||
this,
|
||||
"MouseRaw",
|
||||
"#GameUI_MouseRaw",
|
||||
"m_rawinput");
|
||||
|
||||
m_pMouseAccelerationCheckBox = new CheckButton(
|
||||
this,
|
||||
"MouseAccelerationCheckbox",
|
||||
"#GameUI_MouseCustomAccel");
|
||||
|
||||
m_pJoystickCheckBox = new CCvarToggleCheckButton(
|
||||
this,
|
||||
"Joystick",
|
||||
"#GameUI_Joystick",
|
||||
"joystick" );
|
||||
m_pJoystickCheckBox = new CCvarToggleCheckButton(
|
||||
this,
|
||||
"Joystick",
|
||||
"#GameUI_Joystick",
|
||||
"joystick");
|
||||
|
||||
m_pJoystickSouthpawCheckBox = new CCvarToggleCheckButton(
|
||||
this,
|
||||
"JoystickSouthpaw",
|
||||
"#GameUI_JoystickSouthpaw",
|
||||
"joy_movement_stick" );
|
||||
m_pJoystickSouthpawCheckBox = new CCvarToggleCheckButton(
|
||||
this,
|
||||
"JoystickSouthpaw",
|
||||
"#GameUI_JoystickSouthpaw",
|
||||
"joy_movement_stick");
|
||||
|
||||
m_pReverseJoystickCheckBox = new CCvarToggleCheckButton(
|
||||
this,
|
||||
"ReverseJoystick",
|
||||
"#GameUI_ReverseJoystick",
|
||||
"joy_inverty" );
|
||||
m_pReverseJoystickCheckBox = new CCvarToggleCheckButton(
|
||||
this,
|
||||
"ReverseJoystick",
|
||||
"#GameUI_ReverseJoystick",
|
||||
"joy_inverty");
|
||||
|
||||
m_pQuickInfoCheckBox = new CCvarToggleCheckButton(
|
||||
this,
|
||||
"HudQuickInfo",
|
||||
"#GameUI_HudQuickInfo",
|
||||
"hud_quickinfo" );
|
||||
"hud_quickinfo");
|
||||
|
||||
m_pMouseSensitivitySlider = new CCvarSlider( this, "Slider", "#GameUI_MouseSensitivity",
|
||||
0.1f, 6.0f, "sensitivity", true );
|
||||
m_pMouseSensitivitySlider = new CCvarSlider(this, "Slider", "#GameUI_MouseSensitivity",
|
||||
0.1f, 6.0f, "sensitivity", true);
|
||||
|
||||
m_pMouseSensitivityLabel = new TextEntry(this, "SensitivityLabel");
|
||||
m_pMouseSensitivityLabel->AddActionSignalTarget(this);
|
||||
m_pMouseSensitivityLabel = new TextEntry(this, "SensitivityLabel");
|
||||
m_pMouseSensitivityLabel->AddActionSignalTarget(this);
|
||||
|
||||
m_pMouseAccelExponentSlider = new CCvarSlider( this, "MouseAccelerationSlider", "#GameUI_MouseAcceleration",
|
||||
1.0f, 1.4f, "m_customaccel_exponent", true );
|
||||
m_pMouseAccelExponentSlider = new CCvarSlider(this, "MouseAccelerationSlider", "#GameUI_MouseAcceleration",
|
||||
1.0f, 1.4f, "m_customaccel_exponent", true);
|
||||
|
||||
m_pMouseAccelExponentLabel = new TextEntry(this, "MouseAccelerationLabel");
|
||||
m_pMouseAccelExponentLabel->AddActionSignalTarget(this);
|
||||
|
||||
m_pJoyYawSensitivitySlider = new CCvarSlider( this, "JoystickYawSlider", "#GameUI_JoystickYawSensitivity",
|
||||
-0.5f, -7.0f, "joy_yawsensitivity", true );
|
||||
m_pJoyYawSensitivityPreLabel = new Label(this, "JoystickYawSensitivityPreLabel", "#GameUI_JoystickLookSpeedYaw" );
|
||||
m_pJoyYawSensitivitySlider = new CCvarSlider(this, "JoystickYawSlider", "#GameUI_JoystickYawSensitivity",
|
||||
-0.5f, -7.0f, "joy_yawsensitivity", true);
|
||||
m_pJoyYawSensitivityPreLabel = new Label(this, "JoystickYawSensitivityPreLabel", "#GameUI_JoystickLookSpeedYaw");
|
||||
|
||||
m_pJoyPitchSensitivitySlider = new CCvarSlider( this, "JoystickPitchSlider", "#GameUI_JoystickPitchSensitivity",
|
||||
0.5f, 7.0f, "joy_pitchsensitivity", true );
|
||||
m_pJoyPitchSensitivityPreLabel = new Label(this, "JoystickPitchSensitivityPreLabel", "#GameUI_JoystickLookSpeedPitch" );
|
||||
m_pJoyPitchSensitivitySlider = new CCvarSlider(this, "JoystickPitchSlider", "#GameUI_JoystickPitchSensitivity",
|
||||
0.5f, 7.0f, "joy_pitchsensitivity", true);
|
||||
m_pJoyPitchSensitivityPreLabel = new Label(this, "JoystickPitchSensitivityPreLabel", "#GameUI_JoystickLookSpeedPitch");
|
||||
|
||||
LoadControlSettings("Resource\\OptionsSubMouse.res");
|
||||
|
||||
@ -103,14 +102,12 @@ COptionsSubMouse::COptionsSubMouse(vgui::Panel *parent) : PropertyPage(parent, N
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
COptionsSubMouse::~COptionsSubMouse()
|
||||
{
|
||||
}
|
||||
COptionsSubMouse::~COptionsSubMouse() = default;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
void COptionsSubMouse::OnResetData()
|
||||
{
|
||||
@ -127,12 +124,12 @@ void COptionsSubMouse::OnResetData()
|
||||
m_pJoyPitchSensitivitySlider->Reset();
|
||||
|
||||
ConVarRef m_customacel("m_customaccel");
|
||||
if ( m_customacel.IsValid() )
|
||||
m_pMouseAccelerationCheckBox->SetSelected( m_customacel.GetBool() );
|
||||
if (m_customacel.IsValid())
|
||||
m_pMouseAccelerationCheckBox->SetSelected(m_customacel.GetBool());
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
void COptionsSubMouse::OnApplyChanges()
|
||||
{
|
||||
@ -148,10 +145,10 @@ void COptionsSubMouse::OnApplyChanges()
|
||||
m_pJoyYawSensitivitySlider->ApplyChanges();
|
||||
m_pJoyPitchSensitivitySlider->ApplyChanges();
|
||||
|
||||
engine->ClientCmd_Unrestricted( "joyadvancedupdate" );
|
||||
engine->ClientCmd_Unrestricted("joyadvancedupdate");
|
||||
|
||||
ConVarRef m_customacel("m_customaccel");
|
||||
if ( m_customacel.IsValid() )
|
||||
if (m_customacel.IsValid())
|
||||
m_customacel.SetValue(m_pMouseAccelerationCheckBox->IsSelected() ? 3 : 0);
|
||||
}
|
||||
|
||||
@ -164,19 +161,19 @@ void COptionsSubMouse::ApplySchemeSettings(IScheme *pScheme)
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
void COptionsSubMouse::OnControlModified(Panel *panel)
|
||||
{
|
||||
PostActionSignal(new KeyValues("ApplyButtonEnable"));
|
||||
|
||||
// the HasBeenModified() check is so that if the value is outside of the range of the
|
||||
// slider, it won't use the slider to determine the display value but leave the
|
||||
// real value that we determined in the constructor
|
||||
if (panel == m_pMouseSensitivitySlider && m_pMouseSensitivitySlider->HasBeenModified())
|
||||
{
|
||||
UpdateSensitivityLabel();
|
||||
}
|
||||
// the HasBeenModified() check is so that if the value is outside of the range of the
|
||||
// slider, it won't use the slider to determine the display value but leave the
|
||||
// real value that we determined in the constructor
|
||||
if (panel == m_pMouseSensitivitySlider && m_pMouseSensitivitySlider->HasBeenModified())
|
||||
{
|
||||
UpdateSensitivityLabel();
|
||||
}
|
||||
else if (panel == m_pMouseAccelExponentSlider && m_pMouseAccelExponentSlider->HasBeenModified())
|
||||
{
|
||||
UpdateAccelerationLabel();
|
||||
@ -193,31 +190,31 @@ void COptionsSubMouse::OnControlModified(Panel *panel)
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
void COptionsSubMouse::OnTextChanged(Panel *panel)
|
||||
{
|
||||
if ( panel == m_pMouseSensitivityLabel )
|
||||
{
|
||||
char buf[64];
|
||||
m_pMouseSensitivityLabel->GetText(buf, 64);
|
||||
if (panel == m_pMouseSensitivityLabel)
|
||||
{
|
||||
char buf[64];
|
||||
m_pMouseSensitivityLabel->GetText(buf, 64);
|
||||
|
||||
float fValue;
|
||||
float fValue;
|
||||
int numParsed = sscanf(buf, "%f", &fValue);
|
||||
if ( ( numParsed == 1 ) && ( fValue >= 0.0f ) )
|
||||
{
|
||||
m_pMouseSensitivitySlider->SetSliderValue(fValue);
|
||||
PostActionSignal(new KeyValues("ApplyButtonEnable"));
|
||||
}
|
||||
if ((numParsed == 1) && (fValue >= 0.0f))
|
||||
{
|
||||
m_pMouseSensitivitySlider->SetSliderValue(fValue);
|
||||
PostActionSignal(new KeyValues("ApplyButtonEnable"));
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ( panel == m_pMouseAccelExponentLabel )
|
||||
if (panel == m_pMouseAccelExponentLabel)
|
||||
{
|
||||
char buf[64];
|
||||
m_pMouseAccelExponentLabel->GetText(buf, 64);
|
||||
|
||||
float fValue = (float) atof(buf);
|
||||
float fValue = atof(buf);
|
||||
if (fValue >= 1.0)
|
||||
{
|
||||
m_pMouseAccelExponentSlider->SetSliderValue(fValue);
|
||||
@ -227,35 +224,33 @@ void COptionsSubMouse::OnTextChanged(Panel *panel)
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
void COptionsSubMouse::UpdateSensitivityLabel()
|
||||
{
|
||||
char buf[64];
|
||||
Q_snprintf(buf, sizeof( buf ), " %.2f", m_pMouseSensitivitySlider->GetSliderValue());
|
||||
m_pMouseSensitivityLabel->SetText(buf);
|
||||
char buf[64];
|
||||
Q_snprintf(buf, sizeof(buf), " %.2f", m_pMouseSensitivitySlider->GetSliderValue());
|
||||
m_pMouseSensitivityLabel->SetText(buf);
|
||||
}
|
||||
|
||||
|
||||
void COptionsSubMouse::UpdateAccelerationLabel()
|
||||
{
|
||||
char buf[64];
|
||||
Q_snprintf(buf, sizeof( buf ), " %.2f", m_pMouseAccelExponentSlider->GetSliderValue());
|
||||
Q_snprintf(buf, sizeof(buf), " %.2f", m_pMouseAccelExponentSlider->GetSliderValue());
|
||||
m_pMouseAccelExponentLabel->SetText(buf);
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
void COptionsSubMouse::UpdateJoystickPanels()
|
||||
{
|
||||
bool bEnabled = m_pJoystickCheckBox->IsSelected();
|
||||
|
||||
m_pReverseJoystickCheckBox->SetEnabled( bEnabled );
|
||||
m_pJoystickSouthpawCheckBox->SetEnabled( bEnabled );
|
||||
m_pJoyYawSensitivitySlider->SetEnabled( bEnabled );
|
||||
m_pJoyYawSensitivityPreLabel->SetEnabled( bEnabled );
|
||||
m_pJoyPitchSensitivitySlider->SetEnabled( bEnabled );
|
||||
m_pJoyPitchSensitivityPreLabel->SetEnabled( bEnabled );
|
||||
m_pReverseJoystickCheckBox->SetEnabled(bEnabled);
|
||||
m_pJoystickSouthpawCheckBox->SetEnabled(bEnabled);
|
||||
m_pJoyYawSensitivitySlider->SetEnabled(bEnabled);
|
||||
m_pJoyYawSensitivityPreLabel->SetEnabled(bEnabled);
|
||||
m_pJoyPitchSensitivitySlider->SetEnabled(bEnabled);
|
||||
m_pJoyPitchSensitivityPreLabel->SetEnabled(bEnabled);
|
||||
}
|
@ -1,12 +1,12 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//
|
||||
//=============================================================================//
|
||||
#include "OptionsSubTouch.h"
|
||||
//#include "CommandCheckButton.h"
|
||||
// #include "CommandCheckButton.h"
|
||||
#include "KeyToggleCheckButton.h"
|
||||
#include "CvarNegateCheckButton.h"
|
||||
#include "CvarToggleCheckButton.h"
|
||||
@ -27,54 +27,54 @@ using namespace vgui;
|
||||
COptionsSubTouch::COptionsSubTouch(vgui::Panel *parent) : PropertyPage(parent, NULL)
|
||||
{
|
||||
m_pTouchEnableCheckBox = new CCvarToggleCheckButton(this,
|
||||
"EnableTouch",
|
||||
"Enable touch",
|
||||
"touch_enable");
|
||||
"EnableTouch",
|
||||
"Enable touch",
|
||||
"touch_enable");
|
||||
|
||||
m_pTouchDrawCheckBox = new CCvarToggleCheckButton(this,
|
||||
"DrawTouch",
|
||||
"Draw touch",
|
||||
"touch_draw");
|
||||
"DrawTouch",
|
||||
"Draw touch",
|
||||
"touch_draw");
|
||||
|
||||
m_pReverseTouchCheckBox = new CCvarToggleCheckButton(
|
||||
this,
|
||||
"ReverseTouch",
|
||||
"Reverse touch",
|
||||
"touch_reverse" );
|
||||
"touch_reverse");
|
||||
|
||||
m_pTouchFilterCheckBox = new CCvarToggleCheckButton(
|
||||
this,
|
||||
"TouchFilter",
|
||||
"Touch filter",
|
||||
"touch_filter" );
|
||||
"touch_filter");
|
||||
|
||||
m_pTouchAccelerationCheckBox = new CCvarToggleCheckButton(
|
||||
this,
|
||||
"TouchAccelerationCheckbox",
|
||||
"Touch acceleration",
|
||||
"touch_enable_accel" );
|
||||
"touch_enable_accel");
|
||||
|
||||
m_pTouchSensitivitySlider = new CCvarSlider( this, "Slider", "Touch sensitivity",
|
||||
0.1f, 6.0f, "touch_sensitivity", true );
|
||||
m_pTouchSensitivitySlider = new CCvarSlider(this, "Slider", "Touch sensitivity",
|
||||
0.1f, 6.0f, "touch_sensitivity", true);
|
||||
|
||||
m_pTouchSensitivityLabel = new TextEntry(this, "SensitivityLabel");
|
||||
m_pTouchSensitivityLabel->AddActionSignalTarget(this);
|
||||
|
||||
m_pTouchAccelExponentSlider = new CCvarSlider( this, "TouchAccelerationSlider", "Touch acceleration",
|
||||
1.0f, 1.5f, "touch_accel", true );
|
||||
m_pTouchAccelExponentSlider = new CCvarSlider(this, "TouchAccelerationSlider", "Touch acceleration",
|
||||
1.0f, 1.5f, "touch_accel", true);
|
||||
|
||||
m_pTouchAccelExponentLabel = new TextEntry(this, "TouchAccelerationLabel");
|
||||
m_pTouchAccelExponentLabel->AddActionSignalTarget(this);
|
||||
|
||||
m_pTouchYawSensitivitySlider = new CCvarSlider( this, "TouchYawSlider", "#GameUI_JoystickYawSensitivity",
|
||||
50.f, 300.f, "touch_yaw", true );
|
||||
m_pTouchYawSensitivityPreLabel = new Label(this, "TouchYawSensitivityPreLabel", "#GameUI_JoystickLookSpeedYaw" );
|
||||
m_pTouchYawSensitivitySlider = new CCvarSlider(this, "TouchYawSlider", "#GameUI_JoystickYawSensitivity",
|
||||
50.f, 300.f, "touch_yaw", true);
|
||||
m_pTouchYawSensitivityPreLabel = new Label(this, "TouchYawSensitivityPreLabel", "#GameUI_JoystickLookSpeedYaw");
|
||||
m_pTouchYawSensitivityLabel = new TextEntry(this, "TouchYawSensitivityLabel");
|
||||
m_pTouchYawSensitivityLabel->AddActionSignalTarget(this);
|
||||
|
||||
m_pTouchPitchSensitivitySlider = new CCvarSlider( this, "TouchPitchSlider", "#GameUI_JoystickPitchSensitivity",
|
||||
50.f, 300.f, "touch_pitch", true );
|
||||
m_pTouchPitchSensitivityPreLabel = new Label(this, "TouchPitchSensitivityPreLabel", "#GameUI_JoystickLookSpeedPitch" );
|
||||
m_pTouchPitchSensitivitySlider = new CCvarSlider(this, "TouchPitchSlider", "#GameUI_JoystickPitchSensitivity",
|
||||
50.f, 300.f, "touch_pitch", true);
|
||||
m_pTouchPitchSensitivityPreLabel = new Label(this, "TouchPitchSensitivityPreLabel", "#GameUI_JoystickLookSpeedPitch");
|
||||
m_pTouchPitchSensitivityLabel = new TextEntry(this, "TouchPitchSensitivityLabel");
|
||||
m_pTouchPitchSensitivityLabel->AddActionSignalTarget(this);
|
||||
|
||||
@ -89,12 +89,10 @@ COptionsSubTouch::COptionsSubTouch(vgui::Panel *parent) : PropertyPage(parent, N
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
COptionsSubTouch::~COptionsSubTouch()
|
||||
{
|
||||
}
|
||||
COptionsSubTouch::~COptionsSubTouch() = default;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
void COptionsSubTouch::OnResetData()
|
||||
{
|
||||
@ -108,7 +106,7 @@ void COptionsSubTouch::OnResetData()
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
void COptionsSubTouch::OnApplyChanges()
|
||||
{
|
||||
@ -132,7 +130,7 @@ void COptionsSubTouch::ApplySchemeSettings(IScheme *pScheme)
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
void COptionsSubTouch::OnControlModified(Panel *panel)
|
||||
{
|
||||
@ -142,13 +140,13 @@ void COptionsSubTouch::OnControlModified(Panel *panel)
|
||||
// slider, it won't use the slider to determine the display value but leave the
|
||||
// real value that we determined in the constructor
|
||||
if (panel == m_pTouchSensitivitySlider && m_pTouchSensitivitySlider->HasBeenModified())
|
||||
UpdateLabel( m_pTouchSensitivitySlider, m_pTouchSensitivityLabel );
|
||||
UpdateLabel(m_pTouchSensitivitySlider, m_pTouchSensitivityLabel);
|
||||
else if (panel == m_pTouchAccelExponentSlider && m_pTouchAccelExponentSlider->HasBeenModified())
|
||||
UpdateLabel( m_pTouchAccelExponentSlider, m_pTouchAccelExponentLabel );
|
||||
UpdateLabel(m_pTouchAccelExponentSlider, m_pTouchAccelExponentLabel);
|
||||
else if (panel == m_pTouchYawSensitivitySlider && m_pTouchYawSensitivitySlider->HasBeenModified())
|
||||
UpdateLabel( m_pTouchYawSensitivitySlider, m_pTouchYawSensitivityLabel );
|
||||
UpdateLabel(m_pTouchYawSensitivitySlider, m_pTouchYawSensitivityLabel);
|
||||
else if (panel == m_pTouchPitchSensitivitySlider && m_pTouchPitchSensitivitySlider->HasBeenModified())
|
||||
UpdateLabel( m_pTouchPitchSensitivitySlider, m_pTouchPitchSensitivityLabel );
|
||||
UpdateLabel(m_pTouchPitchSensitivitySlider, m_pTouchPitchSensitivityLabel);
|
||||
else if (panel == m_pTouchAccelerationCheckBox)
|
||||
{
|
||||
m_pTouchAccelExponentSlider->SetEnabled(m_pTouchAccelerationCheckBox->IsSelected());
|
||||
@ -157,53 +155,53 @@ void COptionsSubTouch::OnControlModified(Panel *panel)
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
void COptionsSubTouch::OnTextChanged(Panel *panel)
|
||||
{
|
||||
if ( panel == m_pTouchSensitivityLabel )
|
||||
if (panel == m_pTouchSensitivityLabel)
|
||||
{
|
||||
char buf[64];
|
||||
m_pTouchSensitivityLabel->GetText(buf, 64);
|
||||
|
||||
float fValue;
|
||||
int numParsed = sscanf(buf, "%f", &fValue);
|
||||
if ( ( numParsed == 1 ) && ( fValue >= 0.0f ) )
|
||||
if ((numParsed == 1) && (fValue >= 0.0f))
|
||||
{
|
||||
m_pTouchSensitivitySlider->SetSliderValue(fValue);
|
||||
PostActionSignal(new KeyValues("ApplyButtonEnable"));
|
||||
}
|
||||
}
|
||||
else if ( panel == m_pTouchAccelExponentLabel )
|
||||
else if (panel == m_pTouchAccelExponentLabel)
|
||||
{
|
||||
char buf[64];
|
||||
m_pTouchAccelExponentLabel->GetText(buf, 64);
|
||||
|
||||
float fValue = (float) atof(buf);
|
||||
float fValue = (float)atof(buf);
|
||||
if (fValue >= 1.0)
|
||||
{
|
||||
m_pTouchAccelExponentSlider->SetSliderValue(fValue);
|
||||
PostActionSignal(new KeyValues("ApplyButtonEnable"));
|
||||
}
|
||||
}
|
||||
else if( panel == m_pTouchPitchSensitivityLabel )
|
||||
else if (panel == m_pTouchPitchSensitivityLabel)
|
||||
{
|
||||
char buf[64];
|
||||
m_pTouchPitchSensitivityLabel->GetText(buf, 64);
|
||||
|
||||
float fValue = (float) atof(buf);
|
||||
float fValue = (float)atof(buf);
|
||||
if (fValue >= 1.0)
|
||||
{
|
||||
m_pTouchPitchSensitivitySlider->SetSliderValue(fValue);
|
||||
PostActionSignal(new KeyValues("ApplyButtonEnable"));
|
||||
}
|
||||
}
|
||||
else if( panel == m_pTouchYawSensitivityLabel )
|
||||
else if (panel == m_pTouchYawSensitivityLabel)
|
||||
{
|
||||
char buf[64];
|
||||
m_pTouchYawSensitivityLabel->GetText(buf, 64);
|
||||
|
||||
float fValue = (float) atof(buf);
|
||||
float fValue = (float)atof(buf);
|
||||
if (fValue >= 1.0)
|
||||
{
|
||||
m_pTouchYawSensitivitySlider->SetSliderValue(fValue);
|
||||
@ -215,6 +213,6 @@ void COptionsSubTouch::OnTextChanged(Panel *panel)
|
||||
void COptionsSubTouch::UpdateLabel(CCvarSlider *slider, vgui::TextEntry *label)
|
||||
{
|
||||
char buf[64];
|
||||
Q_snprintf(buf, sizeof( buf ), " %.2f", slider->GetSliderValue());
|
||||
Q_snprintf(buf, sizeof(buf), " %.2f", slider->GetSliderValue());
|
||||
label->SetText(buf);
|
||||
}
|
||||
|
@ -1070,7 +1070,7 @@ COptionsSubVideo::COptionsSubVideo(vgui::Panel *parent) : PropertyPage(parent, N
|
||||
break;
|
||||
}
|
||||
#else
|
||||
int iNormalItemID = m_pAspectRatio->AddItem( "lemonparty.org", NULL );
|
||||
int iNormalItemID = m_pAspectRatio->AddItem( "NULL", NULL );
|
||||
m_pAspectRatio->ActivateItem( iNormalItemID );
|
||||
|
||||
m_pGammaButton->SetEnabled(false);
|
||||
@ -1544,6 +1544,7 @@ void COptionsSubVideo::OnApplyChanges()
|
||||
bConfigChanged = true;
|
||||
}
|
||||
|
||||
|
||||
#if defined( USE_SDL )
|
||||
if ( !windowed )
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
@ -28,7 +28,7 @@ using namespace vgui;
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
#include "tier0/memdbgon.h"
|
||||
|
||||
#define NEW_SAVE_GAME_TIMESTAMP 0xFFFFFFFF
|
||||
#define NEW_SAVE_GAME_TIMESTAMP 0xFFFFFFFF
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:Constructor
|
||||
@ -37,12 +37,12 @@ CSaveGameDialog::CSaveGameDialog(vgui::Panel *parent) : BaseClass(parent, "SaveG
|
||||
{
|
||||
SetDeleteSelfOnClose(true);
|
||||
SetBounds(0, 0, 512, 384);
|
||||
SetSizeable( true );
|
||||
SetSizeable(true);
|
||||
|
||||
SetTitle("#GameUI_SaveGame", true);
|
||||
|
||||
vgui::Button *cancel = new vgui::Button( this, "Cancel", "#GameUI_Cancel" );
|
||||
cancel->SetCommand( "Close" );
|
||||
vgui::Button *cancel = new vgui::Button(this, "Cancel", "#GameUI_Cancel");
|
||||
cancel->SetCommand("Close");
|
||||
|
||||
LoadControlSettings("Resource\\SaveGameDialog.res");
|
||||
}
|
||||
@ -53,27 +53,26 @@ CSaveGameDialog::CSaveGameDialog(vgui::Panel *parent) : BaseClass(parent, "SaveG
|
||||
CSaveGameDialog::~CSaveGameDialog()
|
||||
{
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Saves game
|
||||
//-----------------------------------------------------------------------------
|
||||
void CSaveGameDialog::OnCommand( const char *command )
|
||||
void CSaveGameDialog::OnCommand(const char *command)
|
||||
{
|
||||
if ( !stricmp( command, "loadsave" ) )
|
||||
if (!stricmp(command, "loadsave"))
|
||||
{
|
||||
int saveIndex = GetSelectedItemSaveIndex();
|
||||
if ( m_SaveGames.IsValidIndex(saveIndex) )
|
||||
if (m_SaveGames.IsValidIndex(saveIndex))
|
||||
{
|
||||
// see if we're overwriting
|
||||
if ( m_SaveGames[saveIndex].iTimestamp == NEW_SAVE_GAME_TIMESTAMP )
|
||||
if (m_SaveGames[saveIndex].iTimestamp == NEW_SAVE_GAME_TIMESTAMP)
|
||||
{
|
||||
// new save game, proceed
|
||||
OnCommand( "SaveOverwriteConfirmed" );
|
||||
OnCommand("SaveOverwriteConfirmed");
|
||||
}
|
||||
else
|
||||
{
|
||||
// open confirmation dialog
|
||||
QueryBox *box = new QueryBox( "#GameUI_ConfirmOverwriteSaveGame_Title", "#GameUI_ConfirmOverwriteSaveGame_Info" );
|
||||
QueryBox *box = new QueryBox("#GameUI_ConfirmOverwriteSaveGame_Title", "#GameUI_ConfirmOverwriteSaveGame_Info");
|
||||
box->AddActionSignalTarget(this);
|
||||
box->SetOKButtonText("#GameUI_ConfirmOverwriteSaveGame_OK");
|
||||
box->SetOKCommand(new KeyValues("Command", "command", "SaveOverwriteConfirmed"));
|
||||
@ -81,24 +80,24 @@ void CSaveGameDialog::OnCommand( const char *command )
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( !stricmp( command, "SaveOverwriteConfirmed" ) )
|
||||
else if (!stricmp(command, "SaveOverwriteConfirmed"))
|
||||
{
|
||||
int saveIndex = GetSelectedItemSaveIndex();
|
||||
if ( m_SaveGames.IsValidIndex(saveIndex) )
|
||||
if (m_SaveGames.IsValidIndex(saveIndex))
|
||||
{
|
||||
// delete any existing save
|
||||
DeleteSaveGame( m_SaveGames[saveIndex].szFileName );
|
||||
DeleteSaveGame(m_SaveGames[saveIndex].szFileName);
|
||||
|
||||
// save to a new name
|
||||
char saveName[128];
|
||||
FindSaveSlot( saveName, sizeof(saveName) );
|
||||
if ( saveName[ 0 ] )
|
||||
FindSaveSlot(saveName, sizeof(saveName));
|
||||
if (saveName[0])
|
||||
{
|
||||
// Load the game, return to top and switch to engine
|
||||
char sz[ 256 ];
|
||||
Q_snprintf(sz, sizeof( sz ), "save %s\n", saveName );
|
||||
char sz[256];
|
||||
Q_snprintf(sz, sizeof(sz), "save %s\n", saveName);
|
||||
|
||||
engine->ClientCmd_Unrestricted( sz );
|
||||
engine->ClientCmd_Unrestricted(sz);
|
||||
|
||||
// Close this dialog
|
||||
Close();
|
||||
@ -110,7 +109,7 @@ void CSaveGameDialog::OnCommand( const char *command )
|
||||
}
|
||||
else
|
||||
{
|
||||
BaseClass::OnCommand( command );
|
||||
BaseClass::OnCommand(command);
|
||||
}
|
||||
}
|
||||
|
||||
@ -129,30 +128,30 @@ void CSaveGameDialog::Activate()
|
||||
void CSaveGameDialog::OnScanningSaveGames()
|
||||
{
|
||||
// create dummy item for current saved game
|
||||
SaveGameDescription_t save = { "NewSavedGame", "", "", "#GameUI_NewSaveGame", "", "", "Current", NEW_SAVE_GAME_TIMESTAMP };
|
||||
SaveGameDescription_t save = {"NewSavedGame", "", "", "#GameUI_NewSaveGame", "", "", "Current", NEW_SAVE_GAME_TIMESTAMP};
|
||||
m_SaveGames.AddToTail(save);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: generates a new save game name
|
||||
//-----------------------------------------------------------------------------
|
||||
void CSaveGameDialog::FindSaveSlot( char *buffer, int bufsize )
|
||||
void CSaveGameDialog::FindSaveSlot(char *buffer, int bufsize)
|
||||
{
|
||||
buffer[0] = 0;
|
||||
char szFileName[512];
|
||||
for (int i = 0; i < 1000; i++)
|
||||
{
|
||||
Q_snprintf(szFileName, sizeof( szFileName ), "save/half-life-%03i.sav", i );
|
||||
Q_snprintf(szFileName, sizeof(szFileName), "save/half-life-%03i.sav", i);
|
||||
|
||||
FileHandle_t fp = g_pFullFileSystem->Open( szFileName, "rb" );
|
||||
FileHandle_t fp = g_pFullFileSystem->Open(szFileName, "rb");
|
||||
if (!fp)
|
||||
{
|
||||
// clean up name
|
||||
Q_strncpy( buffer, szFileName + 5, bufsize );
|
||||
char *ext = strstr( buffer, ".sav" );
|
||||
if ( ext )
|
||||
Q_strncpy(buffer, szFileName + 5, bufsize);
|
||||
char *ext = strstr(buffer, ".sav");
|
||||
if (ext)
|
||||
{
|
||||
*ext = 0;
|
||||
*ext = 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -57,9 +57,7 @@ CVGuiSystemModuleLoader::CVGuiSystemModuleLoader()
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Destructor
|
||||
//-----------------------------------------------------------------------------
|
||||
CVGuiSystemModuleLoader::~CVGuiSystemModuleLoader()
|
||||
{
|
||||
}
|
||||
CVGuiSystemModuleLoader::~CVGuiSystemModuleLoader() = default;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: returns true if the module loader has acquired the platform mutex and loaded the modules
|
||||
|
@ -93,6 +93,7 @@ def build(bld):
|
||||
'OptionsSubPortal.cpp',
|
||||
'OptionsSubVideo.cpp',
|
||||
'OptionsSubVoice.cpp',
|
||||
'OptionsSubModification.cpp', #added new page
|
||||
'../public/tier0/memoverride.cpp',
|
||||
]
|
||||
|
||||
|
@ -3607,12 +3607,12 @@ bool CDynamicMeshDX8::NeedsVertexFormatReset( VertexFormat_t fmt ) const
|
||||
//-----------------------------------------------------------------------------
|
||||
// Locks/unlocks the entire mesh
|
||||
//-----------------------------------------------------------------------------
|
||||
bool CDynamicMeshDX8::HasEnoughRoom( int nVertexCount, int nIndexCount ) const
|
||||
bool CDynamicMeshDX8::HasEnoughRoom( int nVertexCount, int nIndexCount ) const
|
||||
{
|
||||
if ( g_pShaderDeviceDx8->IsDeactivated() )
|
||||
return false;
|
||||
|
||||
Assert( m_pVertexBuffer != NULL );
|
||||
//Assert( m_pVertexBuffer != NULL );
|
||||
|
||||
// We need space in both the vertex and index buffer
|
||||
return m_pVertexBuffer->HasEnoughRoom( nVertexCount ) &&
|
||||
|
@ -1739,7 +1739,7 @@ jpeg_fdct_13x13 (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
|
||||
MULTIPLY(tmp1 - tmp5, FIX(0.239678205)); /* (c8-c12)/2 */
|
||||
z2 = MULTIPLY(tmp0 + tmp2, FIX(0.073342435)) - /* (c4-c6)/2 */
|
||||
MULTIPLY(tmp3 + tmp4, FIX(0.709910013)) + /* (c2+c10)/2 */
|
||||
MULTIPLY(tmp1 + tmp5, FIX(0.368787494)); /* (c8+c12)/2 */
|
||||
MULTIPLY(tmp1 + t, FIX(0.368787494)); /* (c8+c12)/2 */
|
||||
|
||||
dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(z1 + z2, CONST_BITS+1);
|
||||
dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 - z2, CONST_BITS+1);
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "pixelwriter.h"
|
||||
#include "tier2/tier2.h"
|
||||
#include "platform.h"
|
||||
#include <iostream>
|
||||
|
||||
|
||||
#if defined ( WIN32 )
|
||||
@ -340,8 +341,8 @@ VideoResult_t CQuickTimeVideoSubSystem::PlayVideoFileFullScreen( const char *fil
|
||||
|
||||
// what size do we set the output rect to?
|
||||
// Integral scaling is much faster, so always scale the video as such
|
||||
int nNewWidth = (int) theQTMovieRect.right;
|
||||
int nNewHeight = (int) theQTMovieRect.bottom;
|
||||
int nNewWidth = static_cast<int>theQTMovieRect.right;
|
||||
int nNewHeight = static_cast<int>theQTMovieRect.bottom;
|
||||
|
||||
// Determine the window we are rendering video into
|
||||
int displayWidth = windowWidth;
|
||||
|
3
wscript
3
wscript
@ -538,7 +538,7 @@ def configure(conf):
|
||||
else:
|
||||
cflags += [
|
||||
'/I'+os.path.abspath('.')+'/thirdparty/SDL',
|
||||
'/arch:SSE' if conf.env.DEST_CPU == 'x86' else '/arch:AVX',
|
||||
#'/arch:SSE' if conf.env.DEST_CPU == 'x86' else '/arch:AVX', (no AVX Support)
|
||||
'/GF',
|
||||
'/Gy',
|
||||
'/fp:fast',
|
||||
@ -548,7 +548,6 @@ def configure(conf):
|
||||
'/TP',
|
||||
'/EHsc'
|
||||
]
|
||||
|
||||
if conf.options.BUILD_TYPE == 'debug':
|
||||
linkflags += [
|
||||
'/FORCE:MULTIPLE',
|
||||
|
Loading…
Reference in New Issue
Block a user