Merge branch 'master' into windows

This commit is contained in:
HappyDOGE
2022-07-27 12:58:56 +03:00
3089 changed files with 38639 additions and 844820 deletions
+37 -7
View File
@@ -242,8 +242,12 @@ public:
{
BaseClass::ApplySchemeSettings(pScheme);
int height = atoi(pScheme->GetResourceString("MainMenu.MenuItemHeight"));
if( IsProportional() )
height = scheme()->GetProportionalScaledValue( height );
// make fully transparent
SetMenuItemHeight(atoi(pScheme->GetResourceString("MainMenu.MenuItemHeight")));
SetMenuItemHeight(height);
SetBgColor(Color(0, 0, 0, 0));
SetBorder(NULL);
}
@@ -297,6 +301,16 @@ public:
return BaseClass::AddMenuItem(item);
}
virtual int AddMenuItem(const char *itemName, wchar_t *itemText, const char *command, Panel *target, KeyValues *userData = NULL)
{
MenuItem *item = new CGameMenuItem(this, itemName);
item->AddActionSignalTarget(target);
item->SetCommand(command);
item->SetText(itemText);
item->SetUserData(userData);
return BaseClass::AddMenuItem(item);
}
virtual int AddMenuItem(const char *itemName, const char *itemText, KeyValues *command, Panel *target, KeyValues *userData = NULL)
{
CGameMenuItem *item = new CGameMenuItem(this, itemName);
@@ -586,6 +600,9 @@ public:
KeyValues *kv1 = menuItem1->GetUserData();
KeyValues *kv2 = menuItem2->GetUserData();
if( !kv1 || !kv2 )
continue;
if ( kv1->GetInt("InGameOrder") > kv2->GetInt("InGameOrder") )
MoveMenuItem( iID2, iID1 );
}
@@ -616,7 +633,7 @@ public:
}
}
MESSAGE_FUNC_INT( OnCursorEnteredMenuItem, "CursorEnteredMenuItem", VPanel);
MESSAGE_FUNC_HANDLE( OnCursorEnteredMenuItem, "CursorEnteredMenuItem", menuItem);
private:
CFooterPanel *m_pConsoleFooter;
@@ -627,9 +644,8 @@ private:
//-----------------------------------------------------------------------------
// Purpose: Respond to cursor entering a menuItem.
//-----------------------------------------------------------------------------
void CGameMenu::OnCursorEnteredMenuItem(int VPanel)
void CGameMenu::OnCursorEnteredMenuItem(VPANEL menuItem)
{
VPANEL menuItem = (VPANEL)VPanel;
MenuItem *item = static_cast<MenuItem *>(ipanel()->GetPanel(menuItem, GetModuleName()));
KeyValues *pCommand = item->GetCommand();
if ( !pCommand->GetFirstSubKey() )
@@ -638,13 +654,12 @@ void CGameMenu::OnCursorEnteredMenuItem(int VPanel)
if ( !pszCmd || !pszCmd[0] )
return;
BaseClass::OnCursorEnteredMenuItem( VPanel );
BaseClass::OnCursorEnteredMenuItem( menuItem );
}
static CBackgroundMenuButton* CreateMenuButton( CBasePanel *parent, const char *panelName, const wchar_t *panelText )
{
CBackgroundMenuButton *pButton = new CBackgroundMenuButton( parent, panelName );
pButton->SetProportional(true);
pButton->SetCommand("OpenGameMenu");
pButton->SetText(panelText);
@@ -657,7 +672,10 @@ bool g_bIsCreatingNewGameMenuForPreFetching = false;
// Purpose: Constructor
//-----------------------------------------------------------------------------
CBasePanel::CBasePanel() : Panel(NULL, "BaseGameUIPanel")
{
{
if( NeedProportional() )
SetProportional( true );
g_pBasePanel = this;
m_bLevelLoading = false;
m_eBackgroundState = BACKGROUND_INITIAL;
@@ -863,6 +881,7 @@ CBasePanel::~CBasePanel()
static const char *g_rgValidCommands[] =
{
"OpenGameMenu",
"OpenConsole",
"OpenPlayerListDialog",
"OpenNewGameDialog",
"OpenLoadGameDialog",
@@ -1477,6 +1496,13 @@ CGameMenu *CBasePanel::RecursiveLoadGameMenu(KeyValues *datafile)
{
CGameMenu *menu = new CGameMenu(this, datafile->GetName());
wchar_t *pString = g_pVGuiLocalize->Find( "#GameUI_Console" );
if( pString )
menu->AddMenuItem("Console", V_wcsupr(pString), "OpenConsole", this);
else
menu->AddMenuItem("Console", "CONSOLE", "OpenConsole", this);
// loop through all the data adding items to the menu
for (KeyValues *dat = datafile->GetFirstSubKey(); dat != NULL; dat = dat->GetNextKey())
{
@@ -1899,6 +1925,10 @@ void CBasePanel::RunMenuCommand(const char *command)
{
OnOpenNewGameDialog();
}
else if ( !Q_stricmp( command, "OpenConsole" ) )
{
GameConsole().Activate();
}
else if ( !Q_stricmp( command, "OpenLoadGameDialog" ) )
{
if ( !GameUI().IsConsoleUI() )
+11 -6
View File
@@ -560,7 +560,7 @@ int SaveReadNameAndComment( FileHandle_t f, OUT_Z_CAP(nameSize) char *name, int
int nNumberOfFields;
char *pData;
int nFieldSize;
short nFieldSize;
pData = pSaveData;
@@ -580,9 +580,12 @@ int SaveReadNameAndComment( FileHandle_t f, OUT_Z_CAP(nameSize) char *name, int
pTokenList = NULL;
// short, short (size, index of field name)
nFieldSize = *(short *)pData;
memcpy( &nFieldSize, pData, sizeof(short) );
pData += sizeof(short);
pFieldName = pTokenList[ *(short *)pData ];
short index;
memcpy( &index, pData, sizeof(short) );
pFieldName = pTokenList[index];
if (stricmp(pFieldName, "GameHeader"))
{
@@ -592,7 +595,7 @@ int SaveReadNameAndComment( FileHandle_t f, OUT_Z_CAP(nameSize) char *name, int
// int (fieldcount)
pData += sizeof(short);
nNumberOfFields = *(int*)pData;
memcpy( &nNumberOfFields, pData, sizeof(int) );
pData += nFieldSize;
// Each field is a short (size), short (index of name), binary string of "size" bytes (data)
@@ -603,10 +606,12 @@ int SaveReadNameAndComment( FileHandle_t f, OUT_Z_CAP(nameSize) char *name, int
// szName
// Actual Data
nFieldSize = *(short *)pData;
memcpy( &nFieldSize, pData, sizeof(short) );
pData += sizeof(short);
pFieldName = pTokenList[ *(short *)pData ];
short index;
memcpy( &index, pData, sizeof(short));
pFieldName = pTokenList[index];
pData += sizeof(short);
if (!stricmp(pFieldName, "comment"))
+1 -1
View File
@@ -141,7 +141,7 @@ void CGameConsole::ActivateDelayed(float time)
#endif
}
void CGameConsole::SetParent( int parent )
void CGameConsole::SetParent( intp parent )
{
#ifndef _XBOX
if (!m_bInitialized)
+1 -1
View File
@@ -40,7 +40,7 @@ public:
// activates the console after a delay
void ActivateDelayed(float time);
void SetParent( int parent );
void SetParent( intp parent );
static void OnCmdCondump();
private:
+2
View File
@@ -12,6 +12,7 @@
#include "vgui/KeyCode.h"
#include "LoadingDialog.h"
#include "IGameUIFuncs.h"
#include "tier0/icommandline.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
@@ -24,6 +25,7 @@ using namespace vgui;
//-----------------------------------------------------------------------------
CGameConsoleDialog::CGameConsoleDialog() : BaseClass( NULL, "GameConsole", false )
{
if( NeedProportional() ) SetProportional(true);
AddActionSignalTarget( this );
}
+4 -4
View File
@@ -203,6 +203,8 @@ void CGameUI::Initialize( CreateInterfaceFn factory )
Error( "CGameUI::Initialize() failed to get necessary interfaces\n" );
}
vgui::VPANEL rootpanel = enginevguifuncs->GetPanel( PANEL_GAMEUIDLL );
// setup base panel
staticPanel = new CBasePanel();
staticPanel->SetBounds(0, 0, 400, 300 );
@@ -212,9 +214,7 @@ void CGameUI::Initialize( CreateInterfaceFn factory )
staticPanel->SetVisible( true );
staticPanel->SetMouseInputEnabled( false );
staticPanel->SetKeyBoardInputEnabled( false );
vgui::VPANEL rootpanel = enginevguifuncs->GetPanel( PANEL_GAMEUIDLL );
staticPanel->SetParent( rootpanel );
staticPanel->SetParent(rootpanel);
}
void CGameUI::PostInit()
@@ -1282,4 +1282,4 @@ void CGameUI::SendMainMenuCommand( const char *pszCommand )
{
pBasePanel->RunMenuCommand( pszCommand );
}
}
}
+6 -1
View File
@@ -22,6 +22,7 @@
#include "KeyValues.h"
#include "OptionsSubKeyboard.h"
#include "OptionsSubMouse.h"
#include "OptionsSubTouch.h"
#include "OptionsSubAudio.h"
#include "OptionsSubVideo.h"
#include "OptionsSubVoice.h"
@@ -53,7 +54,7 @@ COptionsDialog::COptionsDialog(vgui::Panel *parent) : PropertyDialog(parent, "Op
w = scheme()->GetProportionalScaledValueEx(GetScheme(), w);
h = scheme()->GetProportionalScaledValueEx(GetScheme(), h);
}
SetBounds(0, 0, w, h);
SetSizeable( false );
@@ -86,6 +87,10 @@ COptionsDialog::COptionsDialog(vgui::Panel *parent) : PropertyDialog(parent, "Op
AddPage(new COptionsSubKeyboard(this), "#GameUI_Keyboard");
AddPage(new COptionsSubMouse(this), "#GameUI_Mouse");
#ifdef ANDROID
AddPage(new COptionsSubTouch(this), "Touch");
#endif
m_pOptionsSubAudio = new COptionsSubAudio(this);
AddPage(m_pOptionsSubAudio, "#GameUI_Audio");
m_pOptionsSubVideo = new COptionsSubVideo(this);
-4
View File
@@ -362,10 +362,6 @@ void COptionsSubAudio::OnCommand( const char *command )
RunTestSpeakers();
}
}
else if ( !stricmp( command, "ShowThirdPartyAudioCredits" ) )
{
OpenThirdPartySoundCreditsDialog();
}
BaseClass::OnCommand( command );
}
+9 -1
View File
@@ -30,6 +30,7 @@
#include <vstdlib/IKeyValuesSystem.h>
#include "tier2/tier2.h"
#include "inputsystem/iinputsystem.h"
#include "tier0/icommandline.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
@@ -760,8 +761,15 @@ public:
{
// parent is ignored, since we want look like we're steal focus from the parent (we'll become modal below)
if( NeedProportional() )
SetProportional(true);
SetTitle("#GameUI_KeyboardAdvanced_Title", true);
SetSize( 280, 140 );
if( IsProportional() )
SetSize( scheme()->GetProportionalScaledValue( 280 ), scheme()->GetProportionalScaledValue( 140 ) );
else
SetSize( 280, 140 );
LoadControlSettings( "resource/OptionsSubKeyboardAdvancedDlg.res" );
MoveToCenterOfScreen();
SetSizeable( false );
+220
View File
@@ -0,0 +1,220 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//
//=============================================================================//
#include "OptionsSubTouch.h"
//#include "CommandCheckButton.h"
#include "KeyToggleCheckButton.h"
#include "CvarNegateCheckButton.h"
#include "CvarToggleCheckButton.h"
#include "cvarslider.h"
#include "EngineInterface.h"
#include <KeyValues.h>
#include <vgui/IScheme.h>
#include "tier1/convar.h"
#include <stdio.h>
#include <vgui_controls/TextEntry.h>
// memdbgon must be the last include file in a .cpp file!!!
#include <tier0/memdbgon.h>
using namespace vgui;
COptionsSubTouch::COptionsSubTouch(vgui::Panel *parent) : PropertyPage(parent, NULL)
{
m_pTouchEnableCheckBox = new CCvarToggleCheckButton(this,
"EnableTouch",
"Enable touch",
"touch_enable");
m_pTouchDrawCheckBox = new CCvarToggleCheckButton(this,
"DrawTouch",
"Draw touch",
"touch_draw");
m_pReverseTouchCheckBox = new CCvarToggleCheckButton(
this,
"ReverseTouch",
"Reverse touch",
"touch_reverse" );
m_pTouchFilterCheckBox = new CCvarToggleCheckButton(
this,
"TouchFilter",
"Touch filter",
"touch_filter" );
m_pTouchAccelerationCheckBox = new CCvarToggleCheckButton(
this,
"TouchAccelerationCheckbox",
"Touch acceleration",
"touch_enable_accel" );
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_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_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_pTouchPitchSensitivityLabel = new TextEntry(this, "TouchPitchSensitivityLabel");
m_pTouchPitchSensitivityLabel->AddActionSignalTarget(this);
LoadControlSettings("Resource\\OptionsSubTouch.res");
UpdateLabel(m_pTouchSensitivitySlider, m_pTouchSensitivityLabel);
UpdateLabel(m_pTouchAccelExponentSlider, m_pTouchAccelExponentLabel);
UpdateLabel(m_pTouchYawSensitivitySlider, m_pTouchYawSensitivityLabel);
UpdateLabel(m_pTouchPitchSensitivitySlider, m_pTouchPitchSensitivityLabel);
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
COptionsSubTouch::~COptionsSubTouch()
{
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void COptionsSubTouch::OnResetData()
{
m_pReverseTouchCheckBox->Reset();
m_pTouchFilterCheckBox->Reset();
m_pTouchSensitivitySlider->Reset();
m_pTouchAccelExponentSlider->Reset();
m_pTouchYawSensitivitySlider->Reset();
m_pTouchPitchSensitivitySlider->Reset();
m_pTouchAccelerationCheckBox->Reset();
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void COptionsSubTouch::OnApplyChanges()
{
m_pReverseTouchCheckBox->ApplyChanges();
m_pTouchFilterCheckBox->ApplyChanges();
m_pTouchSensitivitySlider->ApplyChanges();
m_pTouchAccelExponentSlider->ApplyChanges();
m_pTouchYawSensitivitySlider->ApplyChanges();
m_pTouchPitchSensitivitySlider->ApplyChanges();
m_pTouchEnableCheckBox->ApplyChanges();
m_pTouchDrawCheckBox->ApplyChanges();
m_pTouchAccelerationCheckBox->ApplyChanges();
}
//-----------------------------------------------------------------------------
// Purpose: sets background color & border
//-----------------------------------------------------------------------------
void COptionsSubTouch::ApplySchemeSettings(IScheme *pScheme)
{
BaseClass::ApplySchemeSettings(pScheme);
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void COptionsSubTouch::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_pTouchSensitivitySlider && m_pTouchSensitivitySlider->HasBeenModified())
UpdateLabel( m_pTouchSensitivitySlider, m_pTouchSensitivityLabel );
else if (panel == m_pTouchAccelExponentSlider && m_pTouchAccelExponentSlider->HasBeenModified())
UpdateLabel( m_pTouchAccelExponentSlider, m_pTouchAccelExponentLabel );
else if (panel == m_pTouchYawSensitivitySlider && m_pTouchYawSensitivitySlider->HasBeenModified())
UpdateLabel( m_pTouchYawSensitivitySlider, m_pTouchYawSensitivityLabel );
else if (panel == m_pTouchPitchSensitivitySlider && m_pTouchPitchSensitivitySlider->HasBeenModified())
UpdateLabel( m_pTouchPitchSensitivitySlider, m_pTouchPitchSensitivityLabel );
else if (panel == m_pTouchAccelerationCheckBox)
{
m_pTouchAccelExponentSlider->SetEnabled(m_pTouchAccelerationCheckBox->IsSelected());
m_pTouchAccelExponentLabel->SetEnabled(m_pTouchAccelerationCheckBox->IsSelected());
}
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void COptionsSubTouch::OnTextChanged(Panel *panel)
{
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 ) )
{
m_pTouchSensitivitySlider->SetSliderValue(fValue);
PostActionSignal(new KeyValues("ApplyButtonEnable"));
}
}
else if ( panel == m_pTouchAccelExponentLabel )
{
char buf[64];
m_pTouchAccelExponentLabel->GetText(buf, 64);
float fValue = (float) atof(buf);
if (fValue >= 1.0)
{
m_pTouchAccelExponentSlider->SetSliderValue(fValue);
PostActionSignal(new KeyValues("ApplyButtonEnable"));
}
}
else if( panel == m_pTouchPitchSensitivityLabel )
{
char buf[64];
m_pTouchPitchSensitivityLabel->GetText(buf, 64);
float fValue = (float) atof(buf);
if (fValue >= 1.0)
{
m_pTouchPitchSensitivitySlider->SetSliderValue(fValue);
PostActionSignal(new KeyValues("ApplyButtonEnable"));
}
}
else if( panel == m_pTouchYawSensitivityLabel )
{
char buf[64];
m_pTouchYawSensitivityLabel->GetText(buf, 64);
float fValue = (float) atof(buf);
if (fValue >= 1.0)
{
m_pTouchYawSensitivitySlider->SetSliderValue(fValue);
PostActionSignal(new KeyValues("ApplyButtonEnable"));
}
}
}
void COptionsSubTouch::UpdateLabel(CCvarSlider *slider, vgui::TextEntry *label)
{
char buf[64];
Q_snprintf(buf, sizeof( buf ), " %.2f", slider->GetSliderValue());
label->SetText(buf);
}
+81
View File
@@ -0,0 +1,81 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef OPTIONS_SUB_TOUCH_H
#define OPTIONS_SUB_TOUCH_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 COptionsSubTouch : public vgui::PropertyPage
{
DECLARE_CLASS_SIMPLE( COptionsSubTouch, vgui::PropertyPage );
public:
COptionsSubTouch(vgui::Panel *parent);
~COptionsSubTouch();
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;
};
#endif // OPTIONS_SUB_TOUCH_H
+44 -6
View File
@@ -1030,7 +1030,8 @@ COptionsSubVideo::COptionsSubVideo(vgui::Panel *parent) : PropertyPage(parent, N
m_pBenchmark = new Button( this, "BenchmarkButton", "#GameUI_LaunchBenchmark" );
m_pBenchmark->SetCommand(new KeyValues("LaunchBenchmark"));
m_pThirdPartyCredits = new URLButton(this, "ThirdPartyVideoCredits", "#GameUI_ThirdPartyTechCredits");
m_pThirdPartyCredits->SetCommand(new KeyValues("OpenThirdPartyVideoCreditsDialog"));
// m_pThirdPartyCredits->SetCommand(new KeyValues("OpenThirdPartyVideoCreditsDialog"));
m_pThirdPartyCredits->SetVisible(false);
m_pHDContent = new CheckButton( this, "HDContentButton", "#GameUI_HDContent" );
char pszAspectName[3][64];
@@ -1041,6 +1042,7 @@ COptionsSubVideo::COptionsSubVideo(vgui::Panel *parent) : PropertyPage(parent, N
unicodeText = g_pVGuiLocalize->Find("#GameUI_AspectWide16x10");
g_pVGuiLocalize->ConvertUnicodeToANSI(unicodeText, pszAspectName[2], 32);
#ifndef ANDROID
int iNormalItemID = m_pAspectRatio->AddItem( pszAspectName[0], NULL );
int i16x9ItemID = m_pAspectRatio->AddItem( pszAspectName[1], NULL );
int i16x10ItemID = m_pAspectRatio->AddItem( pszAspectName[2], NULL );
@@ -1061,6 +1063,12 @@ COptionsSubVideo::COptionsSubVideo(vgui::Panel *parent) : PropertyPage(parent, N
m_pAspectRatio->ActivateItem( i16x10ItemID );
break;
}
#else
int iNormalItemID = m_pAspectRatio->AddItem( "lemonparty.org", NULL );
m_pAspectRatio->ActivateItem( iNormalItemID );
m_pGammaButton->SetEnabled(false);
#endif
char pszVRModeName[2][64];
unicodeText = g_pVGuiLocalize->Find("#GameUI_Disabled");
@@ -1110,6 +1118,10 @@ COptionsSubVideo::COptionsSubVideo(vgui::Panel *parent) : PropertyPage(parent, N
m_pWindowed->AddItem( "#GameUI_Windowed", NULL );
#endif
#ifdef ANDROID
m_pWindowed->SetEnabled( false );
#endif
LoadControlSettings("Resource\\OptionsSubVideo.res");
// Moved down here so we can set the Drop down's
@@ -1160,9 +1172,10 @@ void COptionsSubVideo::PrepareResolutionList()
// Clean up before filling the info again.
m_pMode->DeleteAllItems();
#ifndef ANDROID
m_pAspectRatio->SetItemEnabled(1, false);
m_pAspectRatio->SetItemEnabled(2, false);
#endif
// get full video mode list
vmode_t *plist = NULL;
int count = 0;
@@ -1225,7 +1238,9 @@ void COptionsSubVideo::PrepareResolutionList()
GetResolutionName( plist, sz, sizeof( sz ), desktopWidth, desktopHeight );
int itemID = -1;
int iAspectMode = GetScreenAspectMode( plist->width, plist->height );
#ifndef ANDROID
if ( iAspectMode > 0 )
{
m_pAspectRatio->SetItemEnabled( iAspectMode, true );
@@ -1237,8 +1252,15 @@ void COptionsSubVideo::PrepareResolutionList()
{
itemID = m_pMode->AddItem( sz, NULL);
}
#else
float aspect = (float)plist->width / plist->height;
float native_aspect = (float)desktopWidth / desktopHeight;
// try and find the best match for the resolution to be selected
if( fabs(native_aspect - aspect) < 0.01f )
itemID = m_pMode->AddItem( sz, NULL);
#endif
// try and find the bestplistplistplist match for the resolution to be selected
if ( plist->width == currentWidth && plist->height == currentHeight )
{
selectedItemID = itemID;
@@ -1250,7 +1272,9 @@ void COptionsSubVideo::PrepareResolutionList()
}
// disable ratio selection if we can't display widescreen.
#ifndef ANDROID
m_pAspectRatio->SetEnabled( bFoundWidescreen );
#endif
m_nSelectedMode = selectedItemID;
@@ -1377,7 +1401,11 @@ void COptionsSubVideo::OnResetData()
#endif
// reset gamma control
#ifdef ANDROID
m_pGammaButton->SetEnabled( false );
#else
m_pGammaButton->SetEnabled( !config.Windowed() );
#endif
m_pHDContent->SetSelected( BUseHDContent() );
@@ -1577,8 +1605,12 @@ void COptionsSubVideo::PerformLayout()
if ( m_pGammaButton )
{
#ifdef ANDROID
m_pGammaButton->SetEnabled( false );
#else
const MaterialSystem_Config_t &config = materials->GetCurrentConfigForVideoCard();
m_pGammaButton->SetEnabled( !config.Windowed() );
#endif
}
}
@@ -1600,10 +1632,12 @@ void COptionsSubVideo::OnTextChanged(Panel *pPanel, const char *pszText)
OnDataChanged();
}
}
else if (pPanel == m_pAspectRatio)
{
#ifndef ANDROID
else if (pPanel == m_pAspectRatio)
{
PrepareResolutionList();
}
}
#endif
else if (pPanel == m_pWindowed)
{
PrepareResolutionList();
@@ -1645,7 +1679,11 @@ void COptionsSubVideo::EnableOrDisableWindowedForVR()
}
else
{
#ifdef ANDROID
m_pWindowed->SetEnabled( false );
#else
m_pWindowed->SetEnabled( true );
#endif
}
}
+9 -2
View File
@@ -366,7 +366,12 @@ void CAchievementsDialog_XBox::OnClose()
CAchievementsDialog::CAchievementsDialog(vgui::Panel *parent) : BaseClass(parent, "AchievementsDialog")
{
SetDeleteSelfOnClose(true);
SetBounds(0, 0, 512, 384);
if( IsProportional() )
SetBounds(0, 0, scheme()->GetProportionalScaledValue(512), scheme()->GetProportionalScaledValue(384));
else
SetBounds(0, 0, 512, 384);
SetMinimumSize( 256, 300 );
SetSizeable( true );
@@ -506,7 +511,8 @@ void CAchievementsDialog::CreateNewAchievementGroup( int iMinRange, int iMaxRang
//----------------------------------------------------------
void CAchievementsDialog::ApplySettings( KeyValues *pResourceData )
{
m_iFixedWidth = pResourceData->GetInt( "wide", 512 );
int width = pResourceData->GetInt( "wide", 512 );
m_iFixedWidth = IsProportional() ? scheme()->GetProportionalScaledValue(width) : width;
BaseClass::ApplySettings( pResourceData );
}
@@ -1073,3 +1079,4 @@ void CAchievementDialogItemPanel::OnCheckButtonChecked(Panel *panel)
m_pSourceAchievement->SetShowOnHUD( m_pShowOnHUDCheck->IsSelected() );
}
}
+2
View File
@@ -13,6 +13,7 @@ def options(opt):
def configure(conf):
conf.define('GAMEUI_EXPORTS',1)
conf.define('NO_STEAM',1)
conf.define('VERSION_SAFE_STEAM_API_INTERFACES',1)
def build(bld):
@@ -87,6 +88,7 @@ def build(bld):
'OptionsSubGame.cpp',
'OptionsSubKeyboard.cpp',
'OptionsSubMouse.cpp',
'OptionsSubTouch.cpp',
'OptionsSubMultiplayer.cpp',
'OptionsSubPortal.cpp',
'OptionsSubVideo.cpp',