From b2c3ba8acaf57957a68e92c6d3058bfa86f57c5c Mon Sep 17 00:00:00 2001 From: Hyper <34012267+hyperbx@users.noreply.github.com> Date: Thu, 21 Nov 2024 21:49:58 +0000 Subject: [PATCH] config: added Aspect Ratio option (to be implemented) --- UnleashedRecomp/cfg/config.h | 1 + UnleashedRecomp/cfg/config_detail.h | 14 ++++++++++++++ UnleashedRecomp/locale/config_locale.h | 14 ++++++++++++-- UnleashedRecomp/locale/locale.h | 12 ++++++++++++ UnleashedRecomp/ui/options_menu.cpp | 1 + 5 files changed, 40 insertions(+), 2 deletions(-) diff --git a/UnleashedRecomp/cfg/config.h b/UnleashedRecomp/cfg/config.h index f391cc1d..83686050 100644 --- a/UnleashedRecomp/cfg/config.h +++ b/UnleashedRecomp/cfg/config.h @@ -35,6 +35,7 @@ public: CONFIG_DEFINE("Video", int32_t, WindowWidth, 1280); CONFIG_DEFINE("Video", int32_t, WindowHeight, 720); CONFIG_DEFINE_ENUM("Video", EWindowState, WindowState, EWindowState::Normal); + CONFIG_DEFINE_ENUM_LOCALISED("Video", EAspectRatio, AspectRatio, EAspectRatio::Auto); CONFIG_DEFINE_CALLBACK("Video", float, ResolutionScale, 1.0f, { diff --git a/UnleashedRecomp/cfg/config_detail.h b/UnleashedRecomp/cfg/config_detail.h index 8c55f7e8..98f4be1e 100644 --- a/UnleashedRecomp/cfg/config_detail.h +++ b/UnleashedRecomp/cfg/config_detail.h @@ -108,6 +108,20 @@ CONFIG_DEFINE_ENUM_TEMPLATE(EWindowState) { "Maximized", EWindowState::Maximised } }; +enum class EAspectRatio : uint32_t +{ + Auto, + Square, + Widescreen +}; + +CONFIG_DEFINE_ENUM_TEMPLATE(EAspectRatio) +{ + { "Auto", EAspectRatio::Auto }, + { "4:3", EAspectRatio::Square }, + { "16:9", EAspectRatio::Widescreen } +}; + enum class EAntiAliasing : uint32_t { None = 0, diff --git a/UnleashedRecomp/locale/config_locale.h b/UnleashedRecomp/locale/config_locale.h index fd61b596..95aa5db3 100644 --- a/UnleashedRecomp/locale/config_locale.h +++ b/UnleashedRecomp/locale/config_locale.h @@ -192,9 +192,19 @@ CONFIG_DEFINE_LOCALE(BattleTheme) { ELanguage::English, { "Battle Theme", "Play the Werehog battle theme during combat.\n\nThis option will apply the next time you're in combat." } } }; -CONFIG_DEFINE_LOCALE(WindowSize) +CONFIG_DEFINE_LOCALE(AspectRatio) { - { ELanguage::English, { "Window Size", "Adjust the size of the game window in windowed mode." } } + { ELanguage::English, { "Aspect Ratio", "Change the aspect ratio." } } +}; + +CONFIG_DEFINE_ENUM_LOCALE(EAspectRatio) +{ + { + ELanguage::English, + { + { EAspectRatio::Auto, { "AUTO", "Auto: the aspect ratio will dynamically adjust to the window size." } } + } + } }; CONFIG_DEFINE_LOCALE(ResolutionScale) diff --git a/UnleashedRecomp/locale/locale.h b/UnleashedRecomp/locale/locale.h index 16988494..6e3a4253 100644 --- a/UnleashedRecomp/locale/locale.h +++ b/UnleashedRecomp/locale/locale.h @@ -36,6 +36,18 @@ inline static std::unordered_map