From a56aca27beef7afcccf58c408a138d82aabee558 Mon Sep 17 00:00:00 2001 From: Hyper <34012267+hyperbx@users.noreply.github.com> Date: Thu, 12 Dec 2024 04:26:04 +0000 Subject: [PATCH] config: move future HMM codes to temporary Exports section Export implementation can be sorted later, will probably just toggle bools in a global struct. --- UnleashedRecomp/locale/config_locale.h | 36 ---------------------- UnleashedRecomp/patches/player_patches.cpp | 4 +-- UnleashedRecomp/user/config.h | 12 +++++--- 3 files changed, 9 insertions(+), 43 deletions(-) diff --git a/UnleashedRecomp/locale/config_locale.h b/UnleashedRecomp/locale/config_locale.h index 486512d..3db4bea 100644 --- a/UnleashedRecomp/locale/config_locale.h +++ b/UnleashedRecomp/locale/config_locale.h @@ -94,27 +94,6 @@ CONFIG_DEFINE_LOCALE(AchievementNotifications) { ELanguage::English, { "Achievement Notifications", "Show notifications for unlocking achievements.\n\nAchievements will still\nbe rewarded with notifications disabled." } } }; -CONFIG_DEFINE_LOCALE(SaveScoreAtCheckpoints) -{ - { ELanguage::English, { "Save Score at Checkpoints", "Keep your score from the last checkpoint upon respawning.\n\n[TO BE REMOVED]" } } -}; - -CONFIG_DEFINE_LOCALE(UnleashGaugeBehaviour) -{ - { ELanguage::English, { "Unleash Gauge Behavior", "Change how the Unleash gauge behaves.\n\n[TO BE REMOVED]" } } -}; - -CONFIG_DEFINE_ENUM_LOCALE(EUnleashGaugeBehaviour) -{ - { - ELanguage::English, - { - { EUnleashGaugeBehaviour::Original, { "ORIGINAL", "Original: the gauge will drain at all times regardless." } }, - { EUnleashGaugeBehaviour::Revised, { "REVISED", "Revised: the gauge will only drain when the player can move." } } - } - } -}; - CONFIG_DEFINE_LOCALE(TimeOfDayTransition) { { ELanguage::English, { "Time of Day Transition", "Change how the loading screen appears when switching time of day in the hub areas." } } @@ -148,11 +127,6 @@ CONFIG_DEFINE_ENUM_LOCALE(EControllerIcons) } }; -CONFIG_DEFINE_LOCALE(SkipIntroLogos) -{ - { ELanguage::English, { "Skip Intro Logos", "Skip the logos during the game's boot sequence.\n\n[TO BE REMOVED]" } } -}; - CONFIG_DEFINE_LOCALE(InvertCameraX) { { ELanguage::English, { "Invert Camera X", "Toggle between inverted left and right camera movement." } } @@ -163,16 +137,6 @@ CONFIG_DEFINE_LOCALE(InvertCameraY) { ELanguage::English, { "Invert Camera Y", "Toggle between inverted up and down camera movement." } } }; -CONFIG_DEFINE_LOCALE(XButtonHoming) -{ - { ELanguage::English, { "Homing Attack on Boost", "Toggle between using the boost button or the jump button for the homing attack.\n\n[TO BE REMOVED]" } } -}; - -CONFIG_DEFINE_LOCALE(AllowCancellingUnleash) -{ - { ELanguage::English, { "Allow Cancelling Unleash", "Allow Unleash to be cancelled at the cost of some energy by pressing the input again.\n\n[TO BE REMOVED]" } } -}; - CONFIG_DEFINE_LOCALE(AllowBackgroundInput) { { ELanguage::English, { "Allow Background Input", "Accept controller input whilst the game window is unfocused." } } diff --git a/UnleashedRecomp/patches/player_patches.cpp b/UnleashedRecomp/patches/player_patches.cpp index 8003ae3..6e129a7 100644 --- a/UnleashedRecomp/patches/player_patches.cpp +++ b/UnleashedRecomp/patches/player_patches.cpp @@ -62,7 +62,7 @@ PPC_FUNC(sub_823AF7A8) m_lastDarkGaiaEnergy = pEvilSonicContext->m_DarkGaiaEnergy; // Don't drain energy if out of control. - if (Config::UnleashGaugeBehaviour == EUnleashGaugeBehaviour::Revised && pEvilSonicContext->m_OutOfControlCount && ctx.f1.f64 < 0.0) + if (Config::FixUnleashOutOfControlDrain && pEvilSonicContext->m_OutOfControlCount && ctx.f1.f64 < 0.0) return; __imp__sub_823AF7A8(ctx, base); @@ -96,7 +96,7 @@ void PostUnleashMidAsmHook(PPCRegister& r30) void SetXButtonHomingMidAsmHook(PPCRegister& r30) { - r30.u32 = Config::XButtonHoming; + r30.u32 = Config::HomingAttackOnBoost; } // SWA::Player::CEvilSonicContext::Ctor diff --git a/UnleashedRecomp/user/config.h b/UnleashedRecomp/user/config.h index 79c43cc..491d483 100644 --- a/UnleashedRecomp/user/config.h +++ b/UnleashedRecomp/user/config.h @@ -14,15 +14,10 @@ public: CONFIG_DEFINE_LOCALISED("System", bool, Hints, true); CONFIG_DEFINE_LOCALISED("System", bool, ControlTutorial, true); CONFIG_DEFINE_LOCALISED("System", bool, AchievementNotifications, true); - CONFIG_DEFINE_LOCALISED("System", bool, SaveScoreAtCheckpoints, false); - CONFIG_DEFINE_ENUM_LOCALISED("System", EUnleashGaugeBehaviour, UnleashGaugeBehaviour, EUnleashGaugeBehaviour::Original); CONFIG_DEFINE_ENUM_LOCALISED("System", ETimeOfDayTransition, TimeOfDayTransition, ETimeOfDayTransition::Xbox); - CONFIG_DEFINE_LOCALISED("System", bool, SkipIntroLogos, false); CONFIG_DEFINE_LOCALISED("Input", bool, InvertCameraX, false); CONFIG_DEFINE_LOCALISED("Input", bool, InvertCameraY, false); - CONFIG_DEFINE_LOCALISED("Input", bool, XButtonHoming, true); - CONFIG_DEFINE_LOCALISED("Input", bool, AllowCancellingUnleash, false); CONFIG_DEFINE_LOCALISED("Input", bool, AllowBackgroundInput, false); CONFIG_DEFINE_ENUM_LOCALISED("Input", EControllerIcons, ControllerIcons, EControllerIcons::Auto); @@ -69,6 +64,13 @@ public: CONFIG_DEFINE_ENUM_LOCALISED("Video", EMovieScaleMode, MovieScaleMode, EMovieScaleMode::Fit); CONFIG_DEFINE_ENUM_LOCALISED("Video", EUIScaleMode, UIScaleMode, EUIScaleMode::Edge); + // TODO: remove these once the exports are implemented. + CONFIG_DEFINE("Exports", bool, AllowCancellingUnleash, false); + CONFIG_DEFINE("Exports", bool, FixUnleashOutOfControlDrain, false); + CONFIG_DEFINE("Exports", bool, HomingAttackOnBoost, true); + CONFIG_DEFINE("Exports", bool, SaveScoreAtCheckpoints, false); + CONFIG_DEFINE("Exports", bool, SkipIntroLogos, false); + static std::filesystem::path GetConfigPath() { return GetUserPath() / "config.toml";