Skip to content

Commit b98c091

Browse files
authored
Add ability to show/hide radar components (#4331)
1 parent be39566 commit b98c091

File tree

7 files changed

+23
-1
lines changed

7 files changed

+23
-1
lines changed

Client/game_sa/CHudSA.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ void CHudSA::InitComponentList()
122122
{1, HUD_VEHICLE_NAME, 1, FUNC_DrawVehicleName, 1, 0xCC, 0xC3},
123123
{1, HUD_AREA_NAME, 1, FUNC_DrawAreaName, 1, 0xCC, 0xC3},
124124
{1, HUD_RADAR, 1, FUNC_DrawRadar, 1, 0xCC, 0xC3},
125+
{1, HUD_RADAR_MAP, 1, FUNC_CRadar_DrawMap, 1, 0xCC, 0xC3},
126+
{1, HUD_RADAR_BLIPS, 1, FUNC_CRadar_DrawBlips, 1, 0xCC, 0xC3},
127+
{1, HUD_RADAR_ALTIMETER, 1, CODE_ShowRadarAltimeter, 2, 0xCC, 0xEB30},
125128
{1, HUD_CLOCK, 0, VAR_DisableClock, 1, 1, 0},
126129
{1, HUD_RADIO, 1, FUNC_DrawRadioName, 1, 0xCC, 0xC3},
127130
{1, HUD_WANTED, 1, FUNC_DrawWantedLevel, 1, 0xCC, 0xC3},

Client/game_sa/CHudSA.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@
4949
#define FUNC_CSprite2d_Draw 0x728350
5050
#define FUNC_CSprite_RenderOneXLUSprite 0x70D000
5151

52+
#define FUNC_CRadar_DrawMap 0x586B00
53+
#define FUNC_CRadar_DrawBlips 0x588050
54+
5255
#define CODE_ShowMoney 0x58F47D
56+
#define CODE_ShowRadarAltimeter 0x58A5A6
5357

5458
#define VAR_CTheScripts_bDrawCrossHair 0xA44490
5559
#define VAR_RSGlobal 0xC17040

Client/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ ADD_ENUM(HUD_MONEY, "money")
104104
ADD_ENUM(HUD_VEHICLE_NAME, "vehicle_name")
105105
ADD_ENUM(HUD_AREA_NAME, "area_name")
106106
ADD_ENUM(HUD_RADAR, "radar")
107+
ADD_ENUM(HUD_RADAR_MAP, "radar_map")
108+
ADD_ENUM(HUD_RADAR_BLIPS, "radar_blips")
109+
ADD_ENUM(HUD_RADAR_ALTIMETER, "radar_altimeter")
107110
ADD_ENUM(HUD_CLOCK, "clock")
108111
ADD_ENUM(HUD_RADIO, "radio")
109112
ADD_ENUM(HUD_WANTED, "wanted")

Client/mods/deathmatch/logic/luadefs/CLuaPlayerDefs.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,8 @@ bool CLuaPlayerDefs::IsPlayerCrosshairVisible()
653653

654654
bool CLuaPlayerDefs::SetPlayerHudComponentProperty(eHudComponent component, eHudComponentProperty property, std::variant<CVector2D, float, bool, std::string> value)
655655
{
656-
if (component == HUD_ALL || component == HUD_CROSSHAIR || component == HUD_VITAL_STATS || component == HUD_HELP_TEXT || component == HUD_RADAR)
656+
if (component == HUD_ALL || component == HUD_CROSSHAIR || component == HUD_VITAL_STATS || component == HUD_HELP_TEXT || component == HUD_RADAR
657+
|| component == HUD_RADAR_MAP || component == HUD_RADAR_BLIPS || component == HUD_RADAR_ALTIMETER)
657658
return false;
658659

659660
CHud* hud = g_pGame->GetHud();

Client/sdk/game/CHud.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ enum eHudComponent
3131
HUD_ALL,
3232
HUD_VITAL_STATS,
3333
HUD_HELP_TEXT,
34+
HUD_RADAR_MAP,
35+
HUD_RADAR_BLIPS,
36+
HUD_RADAR_ALTIMETER,
3437
};
3538

3639
enum class eHudComponentProperty

Server/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ ADD_ENUM(HUD_MONEY, "money")
7878
ADD_ENUM(HUD_VEHICLE_NAME, "vehicle_name")
7979
ADD_ENUM(HUD_AREA_NAME, "area_name")
8080
ADD_ENUM(HUD_RADAR, "radar")
81+
ADD_ENUM(HUD_RADAR_MAP, "radar_map")
82+
ADD_ENUM(HUD_RADAR_BLIPS, "radar_blips")
83+
ADD_ENUM(HUD_RADAR_ALTIMETER, "radar_altimeter")
8184
ADD_ENUM(HUD_CLOCK, "clock")
8285
ADD_ENUM(HUD_RADIO, "radio")
8386
ADD_ENUM(HUD_WANTED, "wanted")

Server/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ enum eHudComponent
5656
HUD_WANTED,
5757
HUD_CROSSHAIR,
5858
HUD_ALL,
59+
HUD_VITAL_STATS, // Unused on server, but used on client side
60+
HUD_HELP_TEXT, // Unused on server, but used on client side
61+
HUD_RADAR_MAP,
62+
HUD_RADAR_BLIPS,
63+
HUD_RADAR_ALTIMETER,
5964
};
6065
DECLARE_ENUM(eHudComponent);
6166

0 commit comments

Comments
 (0)