mirror of
https://git.suyu.dev/suyu/suyu
synced 2024-12-27 03:42:51 -06:00
settings: Define specializations for settings
Suggests to a frontend how to represent each setting.
This commit is contained in:
parent
ad645c29a4
commit
b2438f1fb7
4 changed files with 130 additions and 64 deletions
|
@ -128,25 +128,31 @@ struct Values {
|
||||||
Linkage linkage{};
|
Linkage linkage{};
|
||||||
|
|
||||||
// Audio
|
// Audio
|
||||||
Setting<AudioEngine> sink_id{linkage, AudioEngine::Auto, "output_engine", Category::Audio};
|
Setting<AudioEngine> sink_id{linkage, AudioEngine::Auto, "output_engine", Category::Audio,
|
||||||
Setting<std::string> audio_output_device_id{linkage, "auto", "output_device", Category::Audio};
|
Specialization::RuntimeList};
|
||||||
Setting<std::string> audio_input_device_id{linkage, "auto", "input_device", Category::Audio};
|
Setting<std::string> audio_output_device_id{linkage, "auto", "output_device", Category::Audio,
|
||||||
|
Specialization::RuntimeList};
|
||||||
|
Setting<std::string> audio_input_device_id{linkage, "auto", "input_device", Category::Audio,
|
||||||
|
Specialization::RuntimeList};
|
||||||
SwitchableSetting<AudioMode, true> sound_index{linkage, AudioMode::Stereo,
|
SwitchableSetting<AudioMode, true> sound_index{linkage, AudioMode::Stereo,
|
||||||
AudioMode::Mono, AudioMode::Surround,
|
AudioMode::Mono, AudioMode::Surround,
|
||||||
"sound_index", Category::SystemAudio};
|
"sound_index", Category::SystemAudio};
|
||||||
SwitchableSetting<u8, true> volume{linkage, 100, 0, 200, "volume", Category::Audio, true, true};
|
SwitchableSetting<u8, true> volume{
|
||||||
Setting<bool, false> audio_muted{linkage, false, "audio_muted", Category::Audio, false};
|
linkage, 100, 0, 200, "volume", Category::Audio, Specialization::Scalar, true, true};
|
||||||
Setting<bool, false> dump_audio_commands{linkage, false, "dump_audio_commands", Category::Audio,
|
Setting<bool, false> audio_muted{
|
||||||
false};
|
linkage, false, "audio_muted", Category::Audio, Specialization::Default, false};
|
||||||
|
Setting<bool, false> dump_audio_commands{
|
||||||
|
linkage, false, "dump_audio_commands", Category::Audio, Specialization::Default, false};
|
||||||
|
|
||||||
// Core
|
// Core
|
||||||
SwitchableSetting<bool> use_multi_core{linkage, true, "use_multi_core", Category::Core};
|
SwitchableSetting<bool> use_multi_core{linkage, true, "use_multi_core", Category::Core};
|
||||||
SwitchableSetting<bool> use_unsafe_extended_memory_layout{
|
SwitchableSetting<bool> use_unsafe_extended_memory_layout{
|
||||||
linkage, false, "use_unsafe_extended_memory_layout", Category::Core};
|
linkage, false, "use_unsafe_extended_memory_layout", Category::Core};
|
||||||
SwitchableSetting<bool> use_speed_limit{linkage, true, "use_speed_limit",
|
SwitchableSetting<bool> use_speed_limit{
|
||||||
Category::Core, false, true};
|
linkage, true, "use_speed_limit", Category::Core, Specialization::Paired, false, true};
|
||||||
SwitchableSetting<u16, true> speed_limit{linkage, 100, 0, 9999, "speed_limit",
|
SwitchableSetting<u16, true> speed_limit{
|
||||||
Category::Core, true, true};
|
linkage, 100, 0, 9999, "speed_limit", Category::Core, Specialization::Countable,
|
||||||
|
true, true};
|
||||||
|
|
||||||
// Cpu
|
// Cpu
|
||||||
SwitchableSetting<CpuAccuracy, true> cpu_accuracy{linkage, CpuAccuracy::Auto,
|
SwitchableSetting<CpuAccuracy, true> cpu_accuracy{linkage, CpuAccuracy::Auto,
|
||||||
|
@ -193,8 +199,9 @@ struct Values {
|
||||||
"backend", Category::Renderer};
|
"backend", Category::Renderer};
|
||||||
SwitchableSetting<ShaderBackend, true> shader_backend{
|
SwitchableSetting<ShaderBackend, true> shader_backend{
|
||||||
linkage, ShaderBackend::Glsl, ShaderBackend::Glsl, ShaderBackend::SpirV,
|
linkage, ShaderBackend::Glsl, ShaderBackend::Glsl, ShaderBackend::SpirV,
|
||||||
"shader_backend", Category::Renderer};
|
"shader_backend", Category::Renderer, Specialization::RuntimeList};
|
||||||
SwitchableSetting<int> vulkan_device{linkage, 0, "vulkan_device", Category::Renderer};
|
SwitchableSetting<int> vulkan_device{linkage, 0, "vulkan_device", Category::Renderer,
|
||||||
|
Specialization::RuntimeList};
|
||||||
|
|
||||||
SwitchableSetting<bool> use_disk_shader_cache{linkage, true, "use_disk_shader_cache",
|
SwitchableSetting<bool> use_disk_shader_cache{linkage, true, "use_disk_shader_cache",
|
||||||
Category::Renderer};
|
Category::Renderer};
|
||||||
|
@ -206,13 +213,9 @@ struct Values {
|
||||||
AstcDecodeMode::CpuAsynchronous,
|
AstcDecodeMode::CpuAsynchronous,
|
||||||
"accelerate_astc",
|
"accelerate_astc",
|
||||||
Category::Renderer};
|
Category::Renderer};
|
||||||
Setting<VSyncMode, true> vsync_mode{linkage,
|
Setting<VSyncMode, true> vsync_mode{
|
||||||
VSyncMode::Fifo,
|
linkage, VSyncMode::Fifo, VSyncMode::Immediate, VSyncMode::FifoRelaxed,
|
||||||
VSyncMode::Immediate,
|
"use_vsync", Category::Renderer, Specialization::RuntimeList, true,
|
||||||
VSyncMode::FifoRelaxed,
|
|
||||||
"use_vsync",
|
|
||||||
Category::Renderer,
|
|
||||||
true,
|
|
||||||
true};
|
true};
|
||||||
SwitchableSetting<NvdecEmulation> nvdec_emulation{linkage, NvdecEmulation::Gpu,
|
SwitchableSetting<NvdecEmulation> nvdec_emulation{linkage, NvdecEmulation::Gpu,
|
||||||
"nvdec_emulation", Category::Renderer};
|
"nvdec_emulation", Category::Renderer};
|
||||||
|
@ -228,6 +231,7 @@ struct Values {
|
||||||
FullscreenMode::Exclusive,
|
FullscreenMode::Exclusive,
|
||||||
"fullscreen_mode",
|
"fullscreen_mode",
|
||||||
Category::Renderer,
|
Category::Renderer,
|
||||||
|
Specialization::Default,
|
||||||
true,
|
true,
|
||||||
true};
|
true};
|
||||||
SwitchableSetting<AspectRatio, true> aspect_ratio{linkage,
|
SwitchableSetting<AspectRatio, true> aspect_ratio{linkage,
|
||||||
|
@ -236,22 +240,37 @@ struct Values {
|
||||||
AspectRatio::Stretch,
|
AspectRatio::Stretch,
|
||||||
"aspect_ratio",
|
"aspect_ratio",
|
||||||
Category::Renderer,
|
Category::Renderer,
|
||||||
|
Specialization::Default,
|
||||||
true,
|
true,
|
||||||
true};
|
true};
|
||||||
|
|
||||||
ResolutionScalingInfo resolution_info{};
|
ResolutionScalingInfo resolution_info{};
|
||||||
SwitchableSetting<ResolutionSetup> resolution_setup{linkage, ResolutionSetup::Res1X,
|
SwitchableSetting<ResolutionSetup> resolution_setup{linkage, ResolutionSetup::Res1X,
|
||||||
"resolution_setup", Category::Renderer};
|
"resolution_setup", Category::Renderer};
|
||||||
SwitchableSetting<ScalingFilter> scaling_filter{
|
SwitchableSetting<ScalingFilter> scaling_filter{linkage,
|
||||||
linkage, ScalingFilter::Bilinear, "scaling_filter", Category::Renderer, true, true};
|
ScalingFilter::Bilinear,
|
||||||
SwitchableSetting<AntiAliasing> anti_aliasing{
|
"scaling_filter",
|
||||||
linkage, AntiAliasing::None, "anti_aliasing", Category::Renderer, true, true};
|
Category::Renderer,
|
||||||
|
Specialization::Default,
|
||||||
|
true,
|
||||||
|
true};
|
||||||
|
SwitchableSetting<AntiAliasing> anti_aliasing{linkage,
|
||||||
|
AntiAliasing::None,
|
||||||
|
"anti_aliasing",
|
||||||
|
Category::Renderer,
|
||||||
|
Specialization::Default,
|
||||||
|
true,
|
||||||
|
true};
|
||||||
SwitchableSetting<int, true> fsr_sharpening_slider{
|
SwitchableSetting<int, true> fsr_sharpening_slider{
|
||||||
linkage, 25, 0, 200, "fsr_sharpening_slider", Category::Renderer, true, true};
|
linkage, 25, 0, 200, "fsr_sharpening_slider", Category::Renderer, Specialization::Scalar,
|
||||||
|
true, true};
|
||||||
|
|
||||||
SwitchableSetting<u8, false> bg_red{linkage, 0, "bg_red", Category::Renderer, true, true};
|
SwitchableSetting<u8, false> bg_red{
|
||||||
SwitchableSetting<u8, false> bg_green{linkage, 0, "bg_green", Category::Renderer, true, true};
|
linkage, 0, "bg_red", Category::Renderer, Specialization::Default, true, true};
|
||||||
SwitchableSetting<u8, false> bg_blue{linkage, 0, "bg_blue", Category::Renderer, true, true};
|
SwitchableSetting<u8, false> bg_green{
|
||||||
|
linkage, 0, "bg_green", Category::Renderer, Specialization::Default, true, true};
|
||||||
|
SwitchableSetting<u8, false> bg_blue{
|
||||||
|
linkage, 0, "bg_blue", Category::Renderer, Specialization::Default, true, true};
|
||||||
|
|
||||||
SwitchableSetting<GpuAccuracy, true> gpu_accuracy{linkage,
|
SwitchableSetting<GpuAccuracy, true> gpu_accuracy{linkage,
|
||||||
GpuAccuracy::High,
|
GpuAccuracy::High,
|
||||||
|
@ -259,6 +278,7 @@ struct Values {
|
||||||
GpuAccuracy::Extreme,
|
GpuAccuracy::Extreme,
|
||||||
"gpu_accuracy",
|
"gpu_accuracy",
|
||||||
Category::RendererAdvanced,
|
Category::RendererAdvanced,
|
||||||
|
Specialization::Default,
|
||||||
true,
|
true,
|
||||||
true};
|
true};
|
||||||
SwitchableSetting<AnisotropyMode, true> max_anisotropy{
|
SwitchableSetting<AnisotropyMode, true> max_anisotropy{
|
||||||
|
@ -279,9 +299,15 @@ struct Values {
|
||||||
SwitchableSetting<bool> use_asynchronous_shaders{linkage, false, "use_asynchronous_shaders",
|
SwitchableSetting<bool> use_asynchronous_shaders{linkage, false, "use_asynchronous_shaders",
|
||||||
Category::RendererAdvanced};
|
Category::RendererAdvanced};
|
||||||
SwitchableSetting<bool> use_fast_gpu_time{
|
SwitchableSetting<bool> use_fast_gpu_time{
|
||||||
linkage, true, "use_fast_gpu_time", Category::RendererAdvanced, true, true};
|
linkage, true, "use_fast_gpu_time", Category::RendererAdvanced, Specialization::Default,
|
||||||
SwitchableSetting<bool> use_vulkan_driver_pipeline_cache{
|
true, true};
|
||||||
linkage, true, "use_vulkan_driver_pipeline_cache", Category::RendererAdvanced, true, true};
|
SwitchableSetting<bool> use_vulkan_driver_pipeline_cache{linkage,
|
||||||
|
true,
|
||||||
|
"use_vulkan_driver_pipeline_cache",
|
||||||
|
Category::RendererAdvanced,
|
||||||
|
Specialization::Default,
|
||||||
|
true,
|
||||||
|
true};
|
||||||
SwitchableSetting<bool> enable_compute_pipelines{linkage, false, "enable_compute_pipelines",
|
SwitchableSetting<bool> enable_compute_pipelines{linkage, false, "enable_compute_pipelines",
|
||||||
Category::RendererAdvanced};
|
Category::RendererAdvanced};
|
||||||
SwitchableSetting<bool> use_video_framerate{linkage, false, "use_video_framerate",
|
SwitchableSetting<bool> use_video_framerate{linkage, false, "use_video_framerate",
|
||||||
|
@ -310,15 +336,18 @@ struct Values {
|
||||||
TimeZone::Auto, TimeZone::Zulu,
|
TimeZone::Auto, TimeZone::Zulu,
|
||||||
"time_zone_index", Category::System};
|
"time_zone_index", Category::System};
|
||||||
// Measured in seconds since epoch
|
// Measured in seconds since epoch
|
||||||
SwitchableSetting<bool> custom_rtc_enabled{linkage, false, "custom_rtc_enabled",
|
SwitchableSetting<bool> custom_rtc_enabled{
|
||||||
Category::System, true, true};
|
linkage, false, "custom_rtc_enabled", Category::System, Specialization::Paired, true, true};
|
||||||
SwitchableSetting<s64> custom_rtc{linkage, 0, "custom_rtc", Category::System, true, true};
|
SwitchableSetting<s64> custom_rtc{
|
||||||
|
linkage, 0, "custom_rtc", Category::System, Specialization::Time, true, true};
|
||||||
// Set on game boot, reset on stop. Seconds difference between current time and `custom_rtc`
|
// Set on game boot, reset on stop. Seconds difference between current time and `custom_rtc`
|
||||||
s64 custom_rtc_differential;
|
s64 custom_rtc_differential;
|
||||||
SwitchableSetting<bool> rng_seed_enabled{linkage, false, "rng_seed_enabled",
|
SwitchableSetting<bool> rng_seed_enabled{
|
||||||
Category::System, true, true};
|
linkage, false, "rng_seed_enabled", Category::System, Specialization::Paired, true, true};
|
||||||
SwitchableSetting<u32> rng_seed{linkage, 0, "rng_seed", Category::System, true, true};
|
SwitchableSetting<u32> rng_seed{linkage, 0, "rng_seed", Category::System, Specialization::Hex,
|
||||||
Setting<std::string> device_name{linkage, "yuzu", "device_name", Category::System, true, true};
|
true, true};
|
||||||
|
Setting<std::string> device_name{
|
||||||
|
linkage, "yuzu", "device_name", Category::System, Specialization::Default, true, true};
|
||||||
|
|
||||||
Setting<s32> current_user{linkage, 0, "current_user", Category::System};
|
Setting<s32> current_user{linkage, 0, "current_user", Category::System};
|
||||||
|
|
||||||
|
@ -327,7 +356,8 @@ struct Values {
|
||||||
// Controls
|
// Controls
|
||||||
InputSetting<std::array<PlayerInput, 10>> players;
|
InputSetting<std::array<PlayerInput, 10>> players;
|
||||||
|
|
||||||
Setting<bool> enable_raw_input{linkage, false, "enable_raw_input", Category::Controls,
|
Setting<bool> enable_raw_input{
|
||||||
|
linkage, false, "enable_raw_input", Category::Controls, Specialization::Default,
|
||||||
// Only read/write enable_raw_input on Windows platforms
|
// Only read/write enable_raw_input on Windows platforms
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
true
|
true
|
||||||
|
@ -354,7 +384,8 @@ struct Values {
|
||||||
Setting<bool> tas_enable{linkage, false, "tas_enable", Category::Controls};
|
Setting<bool> tas_enable{linkage, false, "tas_enable", Category::Controls};
|
||||||
Setting<bool> tas_loop{linkage, false, "tas_loop", Category::Controls};
|
Setting<bool> tas_loop{linkage, false, "tas_loop", Category::Controls};
|
||||||
|
|
||||||
Setting<bool> mouse_panning{linkage, false, "mouse_panning", Category::Controls, false};
|
Setting<bool> mouse_panning{
|
||||||
|
linkage, false, "mouse_panning", Category::Controls, Specialization::Default, false};
|
||||||
Setting<u8, true> mouse_panning_sensitivity{
|
Setting<u8, true> mouse_panning_sensitivity{
|
||||||
linkage, 50, 1, 100, "mouse_panning_sensitivity", Category::Controls};
|
linkage, 50, 1, 100, "mouse_panning_sensitivity", Category::Controls};
|
||||||
Setting<bool> mouse_enabled{linkage, false, "mouse_enabled", Category::Controls};
|
Setting<bool> mouse_enabled{linkage, false, "mouse_enabled", Category::Controls};
|
||||||
|
@ -410,19 +441,24 @@ struct Values {
|
||||||
Setting<std::string> program_args{linkage, std::string(), "program_args", Category::Debugging};
|
Setting<std::string> program_args{linkage, std::string(), "program_args", Category::Debugging};
|
||||||
Setting<bool> dump_exefs{linkage, false, "dump_exefs", Category::Debugging};
|
Setting<bool> dump_exefs{linkage, false, "dump_exefs", Category::Debugging};
|
||||||
Setting<bool> dump_nso{linkage, false, "dump_nso", Category::Debugging};
|
Setting<bool> dump_nso{linkage, false, "dump_nso", Category::Debugging};
|
||||||
Setting<bool> dump_shaders{linkage, false, "dump_shaders", Category::DebuggingGraphics, false};
|
Setting<bool> dump_shaders{
|
||||||
Setting<bool> dump_macros{linkage, false, "dump_macros", Category::DebuggingGraphics, false};
|
linkage, false, "dump_shaders", Category::DebuggingGraphics, Specialization::Default,
|
||||||
Setting<bool> enable_fs_access_log{linkage, false, "enable_fs_access_log", Category::Debugging};
|
|
||||||
Setting<bool> reporting_services{linkage, false, "reporting_services", Category::Debugging,
|
|
||||||
false};
|
false};
|
||||||
|
Setting<bool> dump_macros{
|
||||||
|
linkage, false, "dump_macros", Category::DebuggingGraphics, Specialization::Default, false};
|
||||||
|
Setting<bool> enable_fs_access_log{linkage, false, "enable_fs_access_log", Category::Debugging};
|
||||||
|
Setting<bool> reporting_services{
|
||||||
|
linkage, false, "reporting_services", Category::Debugging, Specialization::Default, false};
|
||||||
Setting<bool> quest_flag{linkage, false, "quest_flag", Category::Debugging};
|
Setting<bool> quest_flag{linkage, false, "quest_flag", Category::Debugging};
|
||||||
Setting<bool> disable_macro_jit{linkage, false, "disable_macro_jit",
|
Setting<bool> disable_macro_jit{linkage, false, "disable_macro_jit",
|
||||||
Category::DebuggingGraphics};
|
Category::DebuggingGraphics};
|
||||||
Setting<bool> disable_macro_hle{linkage, false, "disable_macro_hle",
|
Setting<bool> disable_macro_hle{linkage, false, "disable_macro_hle",
|
||||||
Category::DebuggingGraphics};
|
Category::DebuggingGraphics};
|
||||||
Setting<bool> extended_logging{linkage, false, "extended_logging", Category::Debugging, false};
|
Setting<bool> extended_logging{
|
||||||
|
linkage, false, "extended_logging", Category::Debugging, Specialization::Default, false};
|
||||||
Setting<bool> use_debug_asserts{linkage, false, "use_debug_asserts", Category::Debugging};
|
Setting<bool> use_debug_asserts{linkage, false, "use_debug_asserts", Category::Debugging};
|
||||||
Setting<bool> use_auto_stub{linkage, false, "use_auto_stub", Category::Debugging, false};
|
Setting<bool> use_auto_stub{
|
||||||
|
linkage, false, "use_auto_stub", Category::Debugging, Specialization::Default, false};
|
||||||
Setting<bool> enable_all_controllers{linkage, false, "enable_all_controllers",
|
Setting<bool> enable_all_controllers{linkage, false, "enable_all_controllers",
|
||||||
Category::Debugging};
|
Category::Debugging};
|
||||||
Setting<bool> create_crash_dumps{linkage, false, "create_crash_dumps", Category::Debugging};
|
Setting<bool> create_crash_dumps{linkage, false, "create_crash_dumps", Category::Debugging};
|
||||||
|
|
|
@ -7,9 +7,10 @@
|
||||||
namespace Settings {
|
namespace Settings {
|
||||||
|
|
||||||
BasicSetting::BasicSetting(Linkage& linkage, const std::string& name, enum Category category_,
|
BasicSetting::BasicSetting(Linkage& linkage, const std::string& name, enum Category category_,
|
||||||
bool save_, bool runtime_modifiable_)
|
bool save_, bool runtime_modifiable_,
|
||||||
: label{name}, category{category_}, id{linkage.count}, save{save_}, runtime_modifiable{
|
enum Specialization specialization_)
|
||||||
runtime_modifiable_} {
|
: label{name}, category{category_}, id{linkage.count}, save{save_},
|
||||||
|
runtime_modifiable{runtime_modifiable_}, specialization{specialization_} {
|
||||||
linkage.by_category[category].push_front(this);
|
linkage.by_category[category].push_front(this);
|
||||||
linkage.count++;
|
linkage.count++;
|
||||||
}
|
}
|
||||||
|
@ -38,6 +39,10 @@ Category BasicSetting::Category() const {
|
||||||
return category;
|
return category;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Specialization BasicSetting::Specialization() const {
|
||||||
|
return specialization;
|
||||||
|
}
|
||||||
|
|
||||||
const std::string& BasicSetting::GetLabel() const {
|
const std::string& BasicSetting::GetLabel() const {
|
||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,17 @@ enum class Category : u32 {
|
||||||
MaxEnum,
|
MaxEnum,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum class Specialization : u32 {
|
||||||
|
Default,
|
||||||
|
Time,
|
||||||
|
Hex,
|
||||||
|
List,
|
||||||
|
RuntimeList,
|
||||||
|
Scalar,
|
||||||
|
Countable,
|
||||||
|
Paired,
|
||||||
|
};
|
||||||
|
|
||||||
bool IsConfiguringGlobal();
|
bool IsConfiguringGlobal();
|
||||||
void SetConfiguringGlobal(bool is_global);
|
void SetConfiguringGlobal(bool is_global);
|
||||||
|
|
||||||
|
@ -64,7 +75,7 @@ public:
|
||||||
class BasicSetting {
|
class BasicSetting {
|
||||||
protected:
|
protected:
|
||||||
explicit BasicSetting(Linkage& linkage, const std::string& name, enum Category category_,
|
explicit BasicSetting(Linkage& linkage, const std::string& name, enum Category category_,
|
||||||
bool save_, bool runtime_modifiable_);
|
bool save_, bool runtime_modifiable_, Specialization spec);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual ~BasicSetting();
|
virtual ~BasicSetting();
|
||||||
|
@ -180,6 +191,11 @@ public:
|
||||||
*/
|
*/
|
||||||
[[nodiscard]] enum Category Category() const;
|
[[nodiscard]] enum Category Category() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @returns Extra metadata for data representation in frontend implementations.
|
||||||
|
*/
|
||||||
|
[[nodiscard]] enum Specialization Specialization() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the label this setting was created with.
|
* Returns the label this setting was created with.
|
||||||
*
|
*
|
||||||
|
@ -219,6 +235,8 @@ private:
|
||||||
const bool save; ///< Suggests if the setting should be saved and read to a frontend config
|
const bool save; ///< Suggests if the setting should be saved and read to a frontend config
|
||||||
const bool
|
const bool
|
||||||
runtime_modifiable; ///< Suggests if the setting can be modified while a guest is running
|
runtime_modifiable; ///< Suggests if the setting can be modified while a guest is running
|
||||||
|
const enum Specialization
|
||||||
|
specialization; ///< Extra data to identify representation of a setting
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Settings
|
} // namespace Settings
|
||||||
|
|
|
@ -35,10 +35,12 @@ public:
|
||||||
* @param category_ Category of the setting AKA INI group
|
* @param category_ Category of the setting AKA INI group
|
||||||
*/
|
*/
|
||||||
explicit Setting(Linkage& linkage, const Type& default_val, const std::string& name,
|
explicit Setting(Linkage& linkage, const Type& default_val, const std::string& name,
|
||||||
enum Category category_, bool save_ = true, bool runtime_modifiable_ = false)
|
enum Category category_,
|
||||||
|
enum Specialization specialization = Specialization::Default,
|
||||||
|
bool save_ = true, bool runtime_modifiable_ = false)
|
||||||
requires(!ranged)
|
requires(!ranged)
|
||||||
: BasicSetting(linkage, name, category_, save_, runtime_modifiable_), value{default_val},
|
: BasicSetting(linkage, name, category_, save_, runtime_modifiable_, specialization),
|
||||||
default_value{default_val} {}
|
value{default_val}, default_value{default_val} {}
|
||||||
virtual ~Setting() = default;
|
virtual ~Setting() = default;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -53,10 +55,11 @@ public:
|
||||||
*/
|
*/
|
||||||
explicit Setting(Linkage& linkage, const Type& default_val, const Type& min_val,
|
explicit Setting(Linkage& linkage, const Type& default_val, const Type& min_val,
|
||||||
const Type& max_val, const std::string& name, enum Category category_,
|
const Type& max_val, const std::string& name, enum Category category_,
|
||||||
|
enum Specialization specialization = Specialization::Default,
|
||||||
bool save_ = true, bool runtime_modifiable_ = false)
|
bool save_ = true, bool runtime_modifiable_ = false)
|
||||||
requires(ranged)
|
requires(ranged)
|
||||||
: BasicSetting(linkage, name, category_, save_, runtime_modifiable_), value{default_val},
|
: BasicSetting(linkage, name, category_, save_, runtime_modifiable_, specialization),
|
||||||
default_value{default_val}, maximum{max_val}, minimum{min_val} {}
|
value{default_val}, default_value{default_val}, maximum{max_val}, minimum{min_val} {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a reference to the setting's value.
|
* Returns a reference to the setting's value.
|
||||||
|
@ -230,10 +233,12 @@ public:
|
||||||
* @param category_ Category of the setting AKA INI group
|
* @param category_ Category of the setting AKA INI group
|
||||||
*/
|
*/
|
||||||
explicit SwitchableSetting(Linkage& linkage, const Type& default_val, const std::string& name,
|
explicit SwitchableSetting(Linkage& linkage, const Type& default_val, const std::string& name,
|
||||||
Category category_, bool save_ = true,
|
Category category_,
|
||||||
bool runtime_modifiable_ = false)
|
enum Specialization specialization = Specialization::Default,
|
||||||
|
bool save_ = true, bool runtime_modifiable_ = false)
|
||||||
requires(!ranged)
|
requires(!ranged)
|
||||||
: Setting<Type, false>{linkage, default_val, name, category_, save_, runtime_modifiable_} {
|
: Setting<Type, false>{linkage, default_val, name, category_, specialization,
|
||||||
|
save_, runtime_modifiable_} {
|
||||||
linkage.restore_functions.emplace_back([this]() { this->SetGlobal(true); });
|
linkage.restore_functions.emplace_back([this]() { this->SetGlobal(true); });
|
||||||
}
|
}
|
||||||
virtual ~SwitchableSetting() = default;
|
virtual ~SwitchableSetting() = default;
|
||||||
|
@ -250,10 +255,12 @@ public:
|
||||||
*/
|
*/
|
||||||
explicit SwitchableSetting(Linkage& linkage, const Type& default_val, const Type& min_val,
|
explicit SwitchableSetting(Linkage& linkage, const Type& default_val, const Type& min_val,
|
||||||
const Type& max_val, const std::string& name, Category category_,
|
const Type& max_val, const std::string& name, Category category_,
|
||||||
|
enum Specialization specialization = Specialization::Default,
|
||||||
bool save_ = true, bool runtime_modifiable_ = false)
|
bool save_ = true, bool runtime_modifiable_ = false)
|
||||||
requires(ranged)
|
requires(ranged)
|
||||||
: Setting<Type, true>{linkage, default_val, min_val, max_val,
|
: Setting<Type, true>{linkage, default_val, min_val,
|
||||||
name, category_, save_, runtime_modifiable_} {
|
max_val, name, category_,
|
||||||
|
specialization, save_, runtime_modifiable_} {
|
||||||
linkage.restore_functions.emplace_back([this]() { this->SetGlobal(true); });
|
linkage.restore_functions.emplace_back([this]() { this->SetGlobal(true); });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue