From 851541c550dc37f12017dd14d7234cb901112ded Mon Sep 17 00:00:00 2001 From: thecozies <79979276+thecozies@users.noreply.github.com> Date: Fri, 28 Jun 2024 09:36:40 -0500 Subject: [PATCH] init config opt system w/ 3 types and description support --- CMakeLists.txt | 9 + assets/config_menu.rml | 8 + assets/config_menu/cheats.rml | 12 + assets/recomp.rcss | 2 +- assets/scss/styles/components/Config.scss | 156 ---------- .../styles/components/ConfigDescription.scss | 27 ++ .../scss/styles/components/ConfigGroup.scss | 29 ++ .../scss/styles/components/ConfigOption.scss | 274 ++++++++++++++++++ .../scss/styles/components/_components.scss | 3 + assets/scss/styles/globals/_old.scss | 14 +- config_example.cheats.en_us.json | 27 ++ config_example.cheats.json | 100 +++++++ include/recomp_ui.h | 2 + lib/N64ModernRuntime | 2 +- src/game/recomp_api.cpp | 18 ++ src/ui/config_options/ConfigOption.cpp | 31 ++ src/ui/config_options/ConfigOption.h | 65 +++++ src/ui/config_options/ConfigRegistry.cpp | 230 +++++++++++++++ src/ui/config_options/ConfigRegistry.h | 66 +++++ src/ui/elements/ElementConfigGroup.cpp | 139 +++++++++ src/ui/elements/ElementConfigGroup.h | 30 ++ src/ui/elements/ElementConfigOption.cpp | 145 +++++++++ src/ui/elements/ElementConfigOption.h | 33 +++ src/ui/elements/ElementDescription.cpp | 61 ++++ src/ui/elements/ElementDescription.h | 22 ++ src/ui/elements/ElementOptionTypeCheckbox.cpp | 78 +++++ src/ui/elements/ElementOptionTypeCheckbox.h | 34 +++ .../elements/ElementOptionTypeRadioTabs.cpp | 97 +++++++ src/ui/elements/ElementOptionTypeRadioTabs.h | 25 ++ src/ui/elements/ElementOptionTypeRange.cpp | 94 ++++++ src/ui/elements/ElementOptionTypeRange.h | 28 ++ src/ui/ui_elements.cpp | 50 ++++ src/ui/ui_elements.h | 20 ++ src/ui/ui_renderer.cpp | 32 ++ 34 files changed, 1803 insertions(+), 160 deletions(-) create mode 100644 assets/config_menu/cheats.rml create mode 100644 assets/scss/styles/components/ConfigDescription.scss create mode 100644 assets/scss/styles/components/ConfigGroup.scss create mode 100644 assets/scss/styles/components/ConfigOption.scss create mode 100644 config_example.cheats.en_us.json create mode 100644 config_example.cheats.json create mode 100644 src/ui/config_options/ConfigOption.cpp create mode 100644 src/ui/config_options/ConfigOption.h create mode 100644 src/ui/config_options/ConfigRegistry.cpp create mode 100644 src/ui/config_options/ConfigRegistry.h create mode 100644 src/ui/elements/ElementConfigGroup.cpp create mode 100644 src/ui/elements/ElementConfigGroup.h create mode 100644 src/ui/elements/ElementConfigOption.cpp create mode 100644 src/ui/elements/ElementConfigOption.h create mode 100644 src/ui/elements/ElementDescription.cpp create mode 100644 src/ui/elements/ElementDescription.h create mode 100644 src/ui/elements/ElementOptionTypeCheckbox.cpp create mode 100644 src/ui/elements/ElementOptionTypeCheckbox.h create mode 100644 src/ui/elements/ElementOptionTypeRadioTabs.cpp create mode 100644 src/ui/elements/ElementOptionTypeRadioTabs.h create mode 100644 src/ui/elements/ElementOptionTypeRange.cpp create mode 100644 src/ui/elements/ElementOptionTypeRange.h create mode 100644 src/ui/ui_elements.cpp create mode 100644 src/ui/ui_elements.h diff --git a/CMakeLists.txt b/CMakeLists.txt index d4ef3ef..5e8087a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -157,6 +157,15 @@ set (SOURCES ${CMAKE_SOURCE_DIR}/src/ui/ui_config.cpp ${CMAKE_SOURCE_DIR}/src/ui/ui_color_hack.cpp ${CMAKE_SOURCE_DIR}/src/ui/ui_rml_hacks.cpp + ${CMAKE_SOURCE_DIR}/src/ui/ui_elements.cpp + ${CMAKE_SOURCE_DIR}/src/ui/elements/ElementConfigGroup.cpp + ${CMAKE_SOURCE_DIR}/src/ui/elements/ElementConfigOption.cpp + ${CMAKE_SOURCE_DIR}/src/ui/elements/ElementOptionTypeCheckbox.cpp + ${CMAKE_SOURCE_DIR}/src/ui/elements/ElementOptionTypeRadioTabs.cpp + ${CMAKE_SOURCE_DIR}/src/ui/elements/ElementOptionTypeRange.cpp + ${CMAKE_SOURCE_DIR}/src/ui/elements/ElementDescription.cpp + ${CMAKE_SOURCE_DIR}/src/ui/config_options/ConfigRegistry.cpp + ${CMAKE_SOURCE_DIR}/src/ui/config_options/ConfigOption.cpp ${CMAKE_SOURCE_DIR}/rsp/aspMain.cpp ${CMAKE_SOURCE_DIR}/rsp/njpgdspMain.cpp diff --git a/assets/config_menu.rml b/assets/config_menu.rml index 6de1fb4..c8609bc 100644 --- a/assets/config_menu.rml +++ b/assets/config_menu.rml @@ -28,6 +28,7 @@ + @@ -71,6 +72,13 @@