Skip to content

Commit

Permalink
added OptionsSubModification
Browse files Browse the repository at this point in the history
  • Loading branch information
IOleg-crypto committed Jan 13, 2025
1 parent 2998568 commit 13dc30a
Show file tree
Hide file tree
Showing 18 changed files with 445 additions and 267 deletions.
12 changes: 4 additions & 8 deletions game/client/hl1/hl1_clientmode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -32,13 +32,9 @@ class CHLModeManager : public IVModeManager
virtual void LevelShutdown( void );
};

CHLModeManager::CHLModeManager( void )
{
}
CHLModeManager::CHLModeManager( void ) = default;

CHLModeManager::~CHLModeManager( void )
{
}
CHLModeManager::~CHLModeManager( void ) = default;

void CHLModeManager::Init( void )
{
Expand Down
6 changes: 2 additions & 4 deletions game/client/hl2/clientmode_hlnormal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -70,9 +70,7 @@ ClientModeHLNormal::ClientModeHLNormal()
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
ClientModeHLNormal::~ClientModeHLNormal()
{
}
ClientModeHLNormal::~ClientModeHLNormal() = default;


//-----------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions game/server/items.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
130 changes: 65 additions & 65 deletions game/server/lightglow.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
Expand All @@ -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( float, m_flGlowProxySize );
CNetworkVar( float, m_flHDRColorScale );
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);
};

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()

LINK_ENTITY_TO_CLASS( env_lightglow, 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 ),

END_DATADESC()

//-----------------------------------------------------------------------------
// Constructor
//-----------------------------------------------------------------------------
CLightGlow::CLightGlow( void )
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()

LINK_ENTITY_TO_CLASS(env_lightglow, 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),

END_DATADESC()

//-----------------------------------------------------------------------------
// Constructor
//-----------------------------------------------------------------------------
CLightGlow::CLightGlow(void)
{
m_nHorizontalSize = 0.0f;
m_nVerticalSize = 0.0f;
Expand All @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion game/shared/shareddefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ enum CastVote

#define MAX_PLACE_NAME_LENGTH 18

#define MAX_FOV 110
#define MAX_FOV 150

//===================================================================================================================
// Team Defines
Expand Down
8 changes: 5 additions & 3 deletions gameui/OptionsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -94,7 +95,10 @@ 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() )
{
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions gameui/OptionsDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#ifndef OPTIONSDIALOG_H
#define OPTIONSDIALOG_H
#include "OptionsSubModification.h"
#ifdef _WIN32
#pragma once
#endif
Expand Down Expand Up @@ -37,6 +38,7 @@ class COptionsDialog : public vgui::PropertyDialog
private:
class COptionsSubAudio *m_pOptionsSubAudio;
class COptionsSubVideo *m_pOptionsSubVideo;
class COptionsSubModification *m_pOptionsSubModification;
vgui::PropertyPage *m_pOptionsSubMultiplayer;
};

Expand Down
4 changes: 1 addition & 3 deletions gameui/OptionsSubGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ COptionsSubGame::COptionsSubGame( vgui::Panel *parent, const char *name ) : Base
//-----------------------------------------------------------------------------
// Purpose: Destructor
//-----------------------------------------------------------------------------
COptionsSubGame::~COptionsSubGame()
{
}
COptionsSubGame::~COptionsSubGame() = default;

void COptionsSubGame::OnClose( void )
{
Expand Down
Loading

0 comments on commit 13dc30a

Please sign in to comment.