diff --git a/src/audio/MusicManager.cpp b/src/audio/MusicManager.cpp index 3f4ae480..ad33ad34 100644 --- a/src/audio/MusicManager.cpp +++ b/src/audio/MusicManager.cpp @@ -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; diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp index 60bb7a76..19e72b80 100644 --- a/src/core/Pad.cpp +++ b/src/core/Pad.cpp @@ -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) diff --git a/src/core/config.h b/src/core/config.h index 352b5a4d..cf496946 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -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 diff --git a/src/core/re3.cpp b/src/core/re3.cpp index b8cd1f52..e3e069a0 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -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); diff --git a/src/renderer/Hud.cpp b/src/renderer/Hud.cpp index eeef585d..7ab4c07c 100644 --- a/src/renderer/Hud.cpp +++ b/src/renderer/Hud.cpp @@ -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()