From 2ad3902ff0147cd71c9c029900c33243aff78693 Mon Sep 17 00:00:00 2001 From: James R Date: Tue, 27 Feb 2024 06:21:53 -0800 Subject: [PATCH] Menus/Grand Prix: tooltips for difficulty selection --- src/cvars.cpp | 3 ++- src/menus/play-local-race-difficulty.c | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/cvars.cpp b/src/cvars.cpp index 7c53c509d..1cd32e4cb 100644 --- a/src/cvars.cpp +++ b/src/cvars.cpp @@ -913,7 +913,8 @@ consvar_t cv_dummyaddonsearch = MenuDummy("dummyaddonsearch", "").onchange_noini consvar_t cv_dummyextraspassword = MenuDummy("dummyextraspassword", ""); extern CV_PossibleValue_t gpdifficulty_cons_t[]; -consvar_t cv_dummygpdifficulty = MenuDummy("dummygpdifficulty", "Normal").values(gpdifficulty_cons_t); +void Dummygpdifficulty_OnChange(void); +consvar_t cv_dummygpdifficulty = MenuDummy("dummygpdifficulty", "Normal").values(gpdifficulty_cons_t).onchange(Dummygpdifficulty_OnChange); consvar_t cv_dummygpencore = MenuDummy("dummygpencore", "Off").on_off(); consvar_t cv_dummyip = MenuDummy("dummyip", ""); diff --git a/src/menus/play-local-race-difficulty.c b/src/menus/play-local-race-difficulty.c index 060443700..373574b5f 100644 --- a/src/menus/play-local-race-difficulty.c +++ b/src/menus/play-local-race-difficulty.c @@ -151,3 +151,27 @@ void M_SetupDifficultySelect(INT32 choice) M_SetupNextMenu(&PLAY_RaceDifficultyDef, false); } + +void Dummygpdifficulty_OnChange(void); +void Dummygpdifficulty_OnChange(void) +{ + const char *tooltip = NULL; + + switch (cv_dummygpdifficulty.value) + { + case KARTSPEED_EASY: + tooltip = "Warm up to the track with some\x83 Gear 1\x80 practice. For\x83 beginners."; + break; + case KARTSPEED_NORMAL: + tooltip = "Push to the top in\x82 Gear 2\x80. A balanced challenge for\x82 everyone!"; + break; + case KARTSPEED_HARD: + tooltip = "Challenge tough competition at\x87 Gear 3\x80. For\x87 thrill-seekers!"; + break; + case KARTGP_MASTER: + tooltip = "Let's go crazy! Take on brutal CPUs at\x87 Gear 3\x80: for\x85 lunatics only!"; + break; + } + + PLAY_RaceDifficulty[drace_gpdifficulty].tooltip = tooltip; +}