mirror of
https://github.com/nillerusr/source-engine.git
synced 2025-04-11 18:57:47 +00:00
added OptionsSubModification
This commit is contained in:
parent
29985681a1
commit
13dc30a464
@ -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 )
|
||||
{
|
||||
|
@ -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;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -232,7 +232,7 @@ enum CastVote
|
||||
|
||||
#define MAX_PLACE_NAME_LENGTH 18
|
||||
|
||||
#define MAX_FOV 110
|
||||
#define MAX_FOV 150
|
||||
|
||||
//===================================================================================================================
|
||||
// Team Defines
|
||||
|
@ -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,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() )
|
||||
{
|
||||
@ -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;
|
||||
};
|
||||
|
||||
|
@ -22,9 +22,7 @@ COptionsSubGame::COptionsSubGame( vgui::Panel *parent, const char *name ) : Base
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Destructor
|
||||
//-----------------------------------------------------------------------------
|
||||
COptionsSubGame::~COptionsSubGame()
|
||||
{
|
||||
}
|
||||
COptionsSubGame::~COptionsSubGame() = default;
|
||||
|
||||
void COptionsSubGame::OnClose( void )
|
||||
{
|
||||
|
110
gameui/OptionsSubModification.cpp
Normal file
110
gameui/OptionsSubModification.cpp
Normal file
@ -0,0 +1,110 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
#include "OptionsSubModification.h"
|
||||
#include "CvarSlider.h"
|
||||
|
||||
#include "EngineInterface.h"
|
||||
|
||||
#include <KeyValues.h>
|
||||
#include <vgui/IScheme.h>
|
||||
#include "tier1/convar.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_pEnableModificationsCheckBox = new CCvarSlider(
|
||||
this,
|
||||
"AspectRatioSlider",
|
||||
"Aspect Ratio",
|
||||
0.1f, 3.0f, // Slider range: 0.1 to 3.0
|
||||
"r_aspectratio",
|
||||
true // Allow fractional values
|
||||
);
|
||||
m_aspectRatioLabel = new TextEntry(this, "AspectRatioLabel");
|
||||
m_aspectRatioLabel->AddActionSignalTarget(this);
|
||||
|
||||
// Load settings from the associated resource file
|
||||
LoadControlSettings("Resource\\OptionsSubModification.res");
|
||||
|
||||
UpdateLabel(m_pEnableModificationsCheckBox, m_aspectRatioLabel);
|
||||
}
|
||||
COptionsSubModification::~COptionsSubModification() = default;
|
||||
|
||||
void COptionsSubModification::OnTextChanged(Panel *panel)
|
||||
{
|
||||
if (panel == m_aspectRatioLabel)
|
||||
{
|
||||
char buf[64];
|
||||
m_aspectRatioLabel->GetText(buf, 64);
|
||||
|
||||
float fValue;
|
||||
int numParsed = sscanf(buf, "%f", &fValue);
|
||||
if ((numParsed == 1) && (fValue >= 0.0f))
|
||||
{
|
||||
m_pEnableModificationsCheckBox->SetSliderValue(fValue);
|
||||
PostActionSignal(new KeyValues("ApplyButtonEnable"));
|
||||
}
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Resets the data to the initial state
|
||||
//-----------------------------------------------------------------------------
|
||||
void COptionsSubModification::OnResetData()
|
||||
{
|
||||
m_pEnableModificationsCheckBox->Reset();
|
||||
// m_aspectRatioLabel->Reset();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Applies changes made by the user
|
||||
//-----------------------------------------------------------------------------
|
||||
void COptionsSubModification::OnApplyChanges()
|
||||
{
|
||||
m_pEnableModificationsCheckBox->ApplyChanges();
|
||||
// m_aspectRatioLabel->ApplyChanges();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Handles slider modifications
|
||||
//-----------------------------------------------------------------------------
|
||||
void COptionsSubModification::OnControlModified(Panel *panel)
|
||||
{
|
||||
PostActionSignal(new KeyValues("ApplyButtonEnable"));
|
||||
|
||||
// Update the label based on slider changes
|
||||
if (panel == m_pEnableModificationsCheckBox && m_pEnableModificationsCheckBox->HasBeenModified())
|
||||
{
|
||||
UpdateLabel(m_pEnableModificationsCheckBox, m_aspectRatioLabel);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// 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);
|
||||
}
|
81
gameui/OptionsSubModification.h
Normal file
81
gameui/OptionsSubModification.h
Normal file
@ -0,0 +1,81 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef OPTIONS_SUB_MODIFICATION_H
|
||||
#define OPTIONS_SUB_MODIFICATION_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;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// 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();
|
||||
|
||||
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:
|
||||
CCvarToggleCheckButton *m_pReverseTouchCheckBox;
|
||||
CCvarToggleCheckButton *m_pTouchFilterCheckBox;
|
||||
CCvarToggleCheckButton *m_pTouchRawCheckBox;
|
||||
CCvarToggleCheckButton *m_pTouchAccelerationCheckBox;
|
||||
|
||||
CCvarToggleCheckButton *m_pTouchCheckBox;
|
||||
CCvarToggleCheckButton *m_pTouchSouthpawCheckBox;
|
||||
CCvarToggleCheckButton *m_pQuickInfoCheckBox;
|
||||
CCvarToggleCheckButton *m_pTouchEnableCheckBox;
|
||||
CCvarToggleCheckButton *m_pTouchDrawCheckBox;
|
||||
|
||||
CCvarSlider *m_pTouchSensitivitySlider;
|
||||
vgui::TextEntry *m_pTouchSensitivityLabel;
|
||||
|
||||
CCvarSlider *m_pTouchAccelExponentSlider;
|
||||
vgui::TextEntry *m_pTouchAccelExponentLabel;
|
||||
|
||||
CCvarSlider *m_pTouchYawSensitivitySlider;
|
||||
vgui::Label *m_pTouchYawSensitivityPreLabel;
|
||||
CCvarSlider *m_pTouchPitchSensitivitySlider;
|
||||
vgui::Label *m_pTouchPitchSensitivityPreLabel;
|
||||
vgui::TextEntry *m_pTouchYawSensitivityLabel;
|
||||
vgui::TextEntry *m_pTouchPitchSensitivityLabel;
|
||||
vgui::TextEntry *m_aspectRatioLabel;
|
||||
CCvarSlider *m_pEnableModificationsCheckBox;
|
||||
};
|
||||
|
||||
#endif // OPTIONS_SUB_MODIFICATION_H
|
@ -1,12 +1,12 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//
|
||||
//=============================================================================//
|
||||
#include "OptionsSubMouse.h"
|
||||
//#include "CommandCheckButton.h"
|
||||
// #include "CommandCheckButton.h"
|
||||
#include "KeyToggleCheckButton.h"
|
||||
#include "CvarNegateCheckButton.h"
|
||||
#include "CvarToggleCheckButton.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);
|
||||
}
|
||||
|
@ -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',
|
||||
]
|
||||
|
||||
|
@ -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