feat: GTA V-style weapon and radio wheels behind IMPROVED_WEAPON_WHEEL (issue #31)
linux / build (push) Canceled after 21m54s

This commit is contained in:
2026-12-01 19:32:04 +00:00
parent e08d7fc21d
commit 97f3c73cea
5 changed files with 69 additions and 0 deletions
+11
View File
@@ -15,6 +15,10 @@
#include "World.h"
#include "sampman.h"
#ifdef IMPROVED_WEAPON_WHEEL
#include "weaponwheel.h"
#endif
#if !defined FIX_BUGS && (defined RADIO_SCROLL_TO_PREV_STATION || defined RADIO_OFF_TEXT)
static_assert(false, "RADIO_SCROLL_TO_PREV_STATION and RADIO_OFF_TEXT won't work correctly without FIX_BUGS");
#endif
@@ -75,6 +79,13 @@ cMusicManager::PlayerInCar()
void
cMusicManager::DisplayRadioStationName()
{
#ifdef IMPROVED_WEAPON_WHEEL
// The radio wheel is the station-change HUD now (issue #31); don't draw the
// old station-name banner underneath it.
if (Wheel_IsRadioWheelOpen())
return;
#endif
int8 pRetune;
int8 gStreamedSound;
int8 gRetuneCounter;
+15
View File
@@ -2183,6 +2183,10 @@ bool CPad::CycleCameraModeDownJustDown(void)
bool CPad::ChangeStationJustDown(void)
{
#ifdef IMPROVED_WEAPON_WHEEL
// The radio wheel replaces the station-change button (issue #31).
return false;
#else
if ( ArePlayerControlsDisabled() )
return false;
@@ -2218,23 +2222,34 @@ bool CPad::ChangeStationJustDown(void)
}
return false;
#endif
}
bool CPad::CycleWeaponLeftJustDown(void)
{
#ifdef IMPROVED_WEAPON_WHEEL
// The weapon wheel replaces D-pad/shoulder weapon cycling (issue #31).
return false;
#else
if ( ArePlayerControlsDisabled() )
return false;
return !!(NewState.LeftShoulder2 && !OldState.LeftShoulder2);
#endif
}
bool CPad::CycleWeaponRightJustDown(void)
{
#ifdef IMPROVED_WEAPON_WHEEL
// The weapon wheel replaces D-pad/shoulder weapon cycling (issue #31).
return false;
#else
if ( ArePlayerControlsDisabled() )
return false;
return !!(NewState.RightShoulder2 && !OldState.RightShoulder2);
#endif
}
bool CPad::GetTarget(void)
+12
View File
@@ -344,6 +344,18 @@ enum Config {
//#define PS2_HUD
#define HUD_REWORK // dynamic HUD (issue #33): vehicle-only minimap (F10 toggle), top-right clock, health/armour bars, money fade, aim-only crosshair
#define HUD_ENHANCEMENTS // Adjusts some aspects to make the HUD look/behave a little bit better.
// GTA V-style wheels (issue #31): a hold-to-open radial weapon wheel that replaces
// the icon + D-pad weapon cycling, and a radio station wheel that replaces the
// radio-switch station-name HUD. Entirely custom UI, so it lives behind this guard
// and in src/extras/weaponwheel.cpp; no reversed code is changed outside a few
// guarded seams in Pad.cpp, Hud.cpp and MusicManager.cpp.
// Off by default: guard-off builds are byte-identical to vanilla.
//#define IMPROVED_WEAPON_WHEEL
#ifdef IMPROVED_WEAPON_WHEEL
# define IMPROVED_RADIO_WHEEL // radio wheel shares the wheel primitive; undef to keep only the weapon wheel
//# define IMPROVED_WEAPON_WHEEL_SLOWMO // optional light time-slow while a wheel is open (see design note)
#endif
// #define BETA_SLIDING_TEXT
#define TRIANGULAR_BLIPS // height indicating triangular radar blips, as in VC
#define FIX_RADAR // use radar size from early version before R* broke it
+16
View File
@@ -960,6 +960,22 @@ DebugMenuPopulate(void)
#endif
DebugMenuAddVarBool8ReadOnly("Graphics", "Extended draw", &bExtendedDraw);
// GTA V-style wheels (issue #31), compile-time guard for reference only
static bool bWeaponWheel =
#ifdef IMPROVED_WEAPON_WHEEL
true;
#else
false;
#endif
DebugMenuAddVarBool8ReadOnly("Gameplay", "Weapon wheel (Tab/R2)", &bWeaponWheel);
static bool bRadioWheel =
#ifdef IMPROVED_RADIO_WHEEL
true;
#else
false;
#endif
DebugMenuAddVarBool8ReadOnly("Gameplay", "Radio wheel (R/L2)", &bRadioWheel);
static int spawnCarId = MI_LANDSTAL;
e = DebugMenuAddVar("Spawn", "Spawn Car ID", &spawnCarId, nil, 1, MI_LANDSTAL, MI_GHOST, carnames);
DebugMenuEntrySetWrap(e, true);
+15
View File
@@ -21,6 +21,10 @@
#include "User.h"
#include "World.h"
#ifdef IMPROVED_WEAPON_WHEEL
#include "weaponwheel.h"
#endif
#ifdef PS2_HUD
#define MONEY_X 100.0f
#define WEAPON_X 91.0f
@@ -455,6 +459,13 @@ void CHud::SetVehicleName(wchar *name)
void CHud::Draw()
{
#ifdef IMPROVED_WEAPON_WHEEL
// Custom UI (issue #31). Runs before the replay early-out so an open wheel
// can always release PLAYERCONTROL_CAMERA. Drawing itself happens at the
// end of the function so it sits above the rest of the HUD.
Wheel_Process();
#endif
// disable hud via second controller
if (CPad::GetPad(1)->GetStartJustDown())
m_Wants_To_Draw_Hud = !m_Wants_To_Draw_Hud;
@@ -1487,6 +1498,10 @@ void CHud::Draw()
BigMessageInUse[2] = 0.0f;
}
}
#ifdef IMPROVED_WEAPON_WHEEL
Wheel_Draw();
#endif
}
void CHud::DrawAfterFade()