summaryrefslogtreecommitdiff
path: root/src/common/settings.cpp
diff options
context:
space:
mode:
authorGravatar lat9nq2023-06-05 21:05:22 -0400
committerGravatar lat9nq2023-07-21 10:56:07 -0400
commit60773194a039fced8cf2da308e1b8220d08a1636 (patch)
tree5afb956619f995866c38d755feaa3a8b3fd7d522 /src/common/settings.cpp
parentuisettings: Fix typings (diff)
downloadyuzu-60773194a039fced8cf2da308e1b8220d08a1636.tar.gz
yuzu-60773194a039fced8cf2da308e1b8220d08a1636.tar.xz
yuzu-60773194a039fced8cf2da308e1b8220d08a1636.zip
settings: Add a registry of settings
LoadString: Sanitize input settings: Handle empty string, remove redundant category settings: Rename Input to Controls, FS to DataStorage settings: Fix Controls groups information settings: Move use_docked_mode to System (again) settings: Document settings: Add type identification function settings: Move registry into values settings: Move global_reset_registry into values settings: Separate AdvGraphics from Renderer settings: More document squash settings: Use linkage object uisettings: Move registry into settings Probably wont build without uisettings: Use settings linkage object config: Load settings with a map Uses the new all_settings vector to load settings. qt-config: Rename settings category qt config: Rename to read category config: Read/write contols category with for_each This is extremely limited due to the complexity of the Controls group, but this handles the the settings that use the interface. qt-config: Use new settings registry qt-config: Read/write advgrphics qt-config: Use settings linkage object yuzu_cmd: Load setting off of vector cmd-config: Finish settings rename config: Read controls settings group with for_each cmd/config: Move registry into values cmd: Read adv graphics cmd-config: Use settings linkage object
Diffstat (limited to 'src/common/settings.cpp')
-rw-r--r--src/common/settings.cpp52
1 files changed, 51 insertions, 1 deletions
diff --git a/src/common/settings.cpp b/src/common/settings.cpp
index 696929479..59934803e 100644
--- a/src/common/settings.cpp
+++ b/src/common/settings.cpp
@@ -144,6 +144,56 @@ float Volume() {
144 return values.volume.GetValue() / static_cast<f32>(values.volume.GetDefault()); 144 return values.volume.GetValue() / static_cast<f32>(values.volume.GetDefault());
145} 145}
146 146
147const char* TranslateCategory(Category category) {
148 switch (category) {
149 case Category::Audio:
150 return "Audio";
151 case Category::Core:
152 return "Core";
153 case Category::Cpu:
154 return "Cpu";
155 case Category::Renderer:
156 return "Renderer";
157 case Category::System:
158 return "System";
159 case Category::DataStorage:
160 return "Data Storage";
161 case Category::Debugging:
162 return "Debugging";
163 case Category::Miscellaneous:
164 return "Miscellaneous";
165 case Category::Network:
166 return "Network";
167 case Category::WebService:
168 return "WebService";
169 case Category::AddOns:
170 return "DisabledAddOns";
171 case Category::Controls:
172 return "Controls";
173 case Category::Ui:
174 return "UI";
175 case Category::UiLayout:
176 return "UiLayout";
177 case Category::UiGameList:
178 return "UiGameList";
179 case Category::Screenshots:
180 return "Screenshots";
181 case Category::Shortcuts:
182 return "Shortcuts";
183 case Category::Multiplayer:
184 return "Multiplayer";
185 case Category::Services:
186 return "Services";
187 case Category::Paths:
188 return "Paths";
189 case Category::MaxEnum:
190 break;
191 case Category::AdvancedGraphics:
192 return "Renderer";
193 }
194 return "Miscellaneous";
195}
196
147void UpdateRescalingInfo() { 197void UpdateRescalingInfo() {
148 const auto setup = values.resolution_setup.GetValue(); 198 const auto setup = values.resolution_setup.GetValue();
149 auto& info = values.resolution_info; 199 auto& info = values.resolution_info;
@@ -212,7 +262,7 @@ void RestoreGlobalState(bool is_powered_on) {
212 return; 262 return;
213 } 263 }
214 264
215 for (const auto& reset : global_reset_registry) { 265 for (const auto& reset : values.linkage.restore_functions) {
216 reset(); 266 reset();
217 } 267 }
218} 268}