Skip to content

Commit 9d560a0

Browse files
committed
support the Back command on settings screens (requested by Grimowy)
1 parent d586e87 commit 9d560a0

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

src/game/client/swarm/vgui/rd_vgui_settings.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ void CRD_VGUI_Settings::OnCommand( const char *command )
152152
{
153153
NavigateToTab( m_pBtnAbout, m_pPnlAbout, "about" );
154154
}
155+
else if ( !V_stricmp( "Back", command ) )
156+
{
157+
OnKeyCodePressed( ButtonCodeToJoystickButtonCode( KEY_XBUTTON_B, CBaseModPanel::GetSingleton().GetLastActiveUserId() ) );
158+
}
155159
else
156160
{
157161
BaseClass::OnCommand( command );
@@ -215,6 +219,18 @@ void CRD_VGUI_Settings_Panel_Base::NavigateTo()
215219
BaseClass::NavigateTo();
216220
}
217221

222+
void CRD_VGUI_Settings_Panel_Base::OnCommand( const char *command )
223+
{
224+
if ( !V_stricmp( "Back", command ) )
225+
{
226+
OnKeyCodePressed( ButtonCodeToJoystickButtonCode( KEY_XBUTTON_B, CBaseModPanel::GetSingleton().GetLastActiveUserId() ) );
227+
}
228+
else
229+
{
230+
BaseClass::OnCommand( command );
231+
}
232+
}
233+
218234
class CRD_VGUI_Option_Color : public vgui::EditablePanel
219235
{
220236
DECLARE_CLASS_SIMPLE( CRD_VGUI_Option_Color, vgui::EditablePanel );

src/game/client/swarm/vgui/rd_vgui_settings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ class CRD_VGUI_Settings_Panel_Base : public vgui::EditablePanel
6666

6767
void ApplySchemeSettings( vgui::IScheme *pScheme ) override;
6868
void NavigateTo() override;
69+
void OnCommand( const char *command ) override;
6970

7071
virtual void Activate() = 0;
7172
virtual BaseModUI::BaseModHybridButton *GetButton( BaseModUI::CRD_VGUI_Settings *pSettings ) = 0;

0 commit comments

Comments
 (0)