Skip to content

Add ability to show/hide radar components #4331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Client/game_sa/CHudSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ void CHudSA::InitComponentList()
{1, HUD_VEHICLE_NAME, 1, FUNC_DrawVehicleName, 1, 0xCC, 0xC3},
{1, HUD_AREA_NAME, 1, FUNC_DrawAreaName, 1, 0xCC, 0xC3},
{1, HUD_RADAR, 1, FUNC_DrawRadar, 1, 0xCC, 0xC3},
{1, HUD_RADAR_MAP, 1, FUNC_CRadar_DrawMap, 1, 0xCC, 0xC3},
{1, HUD_RADAR_BLIPS, 1, FUNC_CRadar_DrawBlips, 1, 0xCC, 0xC3},
{1, HUD_RADAR_ALTIMETER, 1, CODE_ShowRadarAltimeter, 2, 0xCC, 0xEB30},
{1, HUD_CLOCK, 0, VAR_DisableClock, 1, 1, 0},
{1, HUD_RADIO, 1, FUNC_DrawRadioName, 1, 0xCC, 0xC3},
{1, HUD_WANTED, 1, FUNC_DrawWantedLevel, 1, 0xCC, 0xC3},
Expand Down
4 changes: 4 additions & 0 deletions Client/game_sa/CHudSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@
#define FUNC_CSprite2d_Draw 0x728350
#define FUNC_CSprite_RenderOneXLUSprite 0x70D000

#define FUNC_CRadar_DrawMap 0x586B00
#define FUNC_CRadar_DrawBlips 0x588050

#define CODE_ShowMoney 0x58F47D
#define CODE_ShowRadarAltimeter 0x58A5A6

#define VAR_CTheScripts_bDrawCrossHair 0xA44490
#define VAR_RSGlobal 0xC17040
Expand Down
3 changes: 3 additions & 0 deletions Client/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ ADD_ENUM(HUD_MONEY, "money")
ADD_ENUM(HUD_VEHICLE_NAME, "vehicle_name")
ADD_ENUM(HUD_AREA_NAME, "area_name")
ADD_ENUM(HUD_RADAR, "radar")
ADD_ENUM(HUD_RADAR_MAP, "radar_map")
ADD_ENUM(HUD_RADAR_BLIPS, "radar_blips")
ADD_ENUM(HUD_RADAR_ALTIMETER, "radar_altimeter")
ADD_ENUM(HUD_CLOCK, "clock")
ADD_ENUM(HUD_RADIO, "radio")
ADD_ENUM(HUD_WANTED, "wanted")
Expand Down
3 changes: 2 additions & 1 deletion Client/mods/deathmatch/logic/luadefs/CLuaPlayerDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,8 @@ bool CLuaPlayerDefs::IsPlayerCrosshairVisible()

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

CHud* hud = g_pGame->GetHud();
Expand Down
3 changes: 3 additions & 0 deletions Client/sdk/game/CHud.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ enum eHudComponent
HUD_ALL,
HUD_VITAL_STATS,
HUD_HELP_TEXT,
HUD_RADAR_MAP,
HUD_RADAR_BLIPS,
HUD_RADAR_ALTIMETER,
};

enum class eHudComponentProperty
Expand Down
3 changes: 3 additions & 0 deletions Server/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ ADD_ENUM(HUD_MONEY, "money")
ADD_ENUM(HUD_VEHICLE_NAME, "vehicle_name")
ADD_ENUM(HUD_AREA_NAME, "area_name")
ADD_ENUM(HUD_RADAR, "radar")
ADD_ENUM(HUD_RADAR_MAP, "radar_map")
ADD_ENUM(HUD_RADAR_BLIPS, "radar_blips")
ADD_ENUM(HUD_RADAR_ALTIMETER, "radar_altimeter")
ADD_ENUM(HUD_CLOCK, "clock")
ADD_ENUM(HUD_RADIO, "radio")
ADD_ENUM(HUD_WANTED, "wanted")
Expand Down
5 changes: 5 additions & 0 deletions Server/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ enum eHudComponent
HUD_WANTED,
HUD_CROSSHAIR,
HUD_ALL,
HUD_VITAL_STATS, // Unused on server, but used on client side
HUD_HELP_TEXT, // Unused on server, but used on client side
HUD_RADAR_MAP,
HUD_RADAR_BLIPS,
HUD_RADAR_ALTIMETER,
};
DECLARE_ENUM(eHudComponent);

Expand Down
Loading