Skip to content

Commit

Permalink
[Gameplay] Added disabling for location name in HUD
Browse files Browse the repository at this point in the history
  • Loading branch information
APAmk2 committed Mar 20, 2024
1 parent df9d86b commit a5e50ec
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions neo/d3xp/gamesys/SysCvar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ idCVar g_testModelBlend( "g_testModelBlend", "0", CVAR_GAME | CVAR_INTEGER
idCVar g_testDeath( "g_testDeath", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar g_flushSave( "g_flushSave", "0", CVAR_GAME | CVAR_BOOL, "1 = don't buffer file writing for save games." );

idCVar g_showLocName( "g_showLocName", "1", CVAR_GAME | CVAR_BOOL, "");

idCVar aas_test( "aas_test", "0", CVAR_GAME | CVAR_INTEGER, "" );
idCVar aas_showAreas( "aas_showAreas", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar aas_showPath( "aas_showPath", "0", CVAR_GAME | CVAR_INTEGER, "" );
Expand Down
2 changes: 2 additions & 0 deletions neo/d3xp/gamesys/SysCvar.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ extern idCVar g_testModelAnimate;
extern idCVar g_testModelBlend;
extern idCVar g_flushSave;

extern idCVar g_showLocName;

extern idCVar g_enableSlowmo;
extern idCVar g_slowmoStepRate;
extern idCVar g_testFullscreenFX;
Expand Down
1 change: 1 addition & 0 deletions neo/d3xp/menus/MenuScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,7 @@ class idMenuScreen_Shell_GameOptions : public idMenuScreen
GAME_FIELD_ALWAYS_SPRINT,
GAME_FIELD_FLASHLIGHT_SHADOWS,
GAME_FIELD_MUZZLE_FLASHES,
GAME_FIELD_LOCATION_NAME,
MAX_GAME_FIELDS
};

Expand Down
6 changes: 6 additions & 0 deletions neo/d3xp/menus/MenuScreen_HUD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1303,6 +1303,12 @@ void idMenuScreen_HUD::UpdateLocation( idPlayer* player )
{
locationName->SetText( idLocalization::GetString( "#str_02911" ) );
}

if ( !g_showLocName.GetBool() )
{
locationName->SetText("");
}

locationName->SetStrokeInfo( true, 0.6f, 2.0f );

}
Expand Down
15 changes: 15 additions & 0 deletions neo/d3xp/menus/MenuScreen_Shell_GameOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,14 @@ void idMenuScreen_Shell_GameOptions::Initialize( idMenuHandler* data )
control->AddEventAction( WIDGET_EVENT_PRESS ).Set( WIDGET_ACTION_PRESS_FOCUSED, options->GetChildren().Num() );
options->AddChild( control );

control = new(TAG_SWF) idMenuWidget_ControlButton();
control->SetOptionType(OPTION_SLIDER_TOGGLE);
control->SetLabel("#str_swf_showLocName");
control->SetDataSource(&systemData, idMenuDataSource_GameSettings::GAME_FIELD_LOCATION_NAME);
control->SetupEvents(DEFAULT_REPEAT_TIME, options->GetChildren().Num());
control->AddEventAction(WIDGET_EVENT_PRESS).Set(WIDGET_ACTION_PRESS_FOCUSED, options->GetChildren().Num());
options->AddChild(control);

options->AddEventAction( WIDGET_EVENT_SCROLL_DOWN ).Set( new( TAG_SWF ) idWidgetActionHandler( options, WIDGET_ACTION_EVENT_SCROLL_DOWN_START_REPEATER, WIDGET_EVENT_SCROLL_DOWN ) );
options->AddEventAction( WIDGET_EVENT_SCROLL_UP ).Set( new( TAG_SWF ) idWidgetActionHandler( options, WIDGET_ACTION_EVENT_SCROLL_UP_START_REPEATER, WIDGET_EVENT_SCROLL_UP ) );
options->AddEventAction( WIDGET_EVENT_SCROLL_DOWN_RELEASE ).Set( new( TAG_SWF ) idWidgetActionHandler( options, WIDGET_ACTION_EVENT_STOP_REPEATER, WIDGET_EVENT_SCROLL_DOWN_RELEASE ) );
Expand Down Expand Up @@ -339,6 +347,7 @@ void idMenuScreen_Shell_GameOptions::idMenuDataSource_GameSettings::LoadData()
fields[ GAME_FIELD_ALWAYS_SPRINT ].SetBool( in_alwaysRun.GetBool() );
fields[ GAME_FIELD_FLASHLIGHT_SHADOWS ].SetBool( g_weaponShadows.GetBool() );
fields[ GAME_FIELD_MUZZLE_FLASHES ].SetBool( g_muzzleFlash.GetBool() );
fields[ GAME_FIELD_LOCATION_NAME ].SetBool( g_showLocName.GetBool() );
originalFields = fields;
}

Expand All @@ -361,6 +370,7 @@ void idMenuScreen_Shell_GameOptions::idMenuDataSource_GameSettings::CommitData()
in_alwaysRun.SetBool( fields[ GAME_FIELD_ALWAYS_SPRINT ].ToBool() );
g_weaponShadows.SetBool( fields[ GAME_FIELD_FLASHLIGHT_SHADOWS ].ToBool() );
g_muzzleFlash.SetBool( fields[ GAME_FIELD_MUZZLE_FLASHES ].ToBool() );
g_showLocName.SetBool( fields[ GAME_FIELD_LOCATION_NAME ].ToBool() );

cvarSystem->SetModifiedFlags( CVAR_ARCHIVE );

Expand Down Expand Up @@ -437,5 +447,10 @@ bool idMenuScreen_Shell_GameOptions::idMenuDataSource_GameSettings::IsDataChange
{
return true;
}

if (fields[ GAME_FIELD_LOCATION_NAME ].ToBool() != originalFields[ GAME_FIELD_LOCATION_NAME ].ToBool() )
{
return true;
}
return false;
}

0 comments on commit a5e50ec

Please sign in to comment.