summaryrefslogtreecommitdiffstats
path: root/src/common/settings.h
diff options
context:
space:
mode:
authorlat9nq <22451773+lat9nq@users.noreply.github.com>2023-05-08 23:33:10 +0200
committerlat9nq <22451773+lat9nq@users.noreply.github.com>2023-07-21 16:56:07 +0200
commitd35577d3ed0bfc56ddf85a2e8b163d9d02bec809 (patch)
tree54ab3ccf2ac728a75993c9931a39d4739206e25a /src/common/settings.h
parentconfiguration: Use buttons instead of highlights (diff)
downloadyuzu-d35577d3ed0bfc56ddf85a2e8b163d9d02bec809.tar
yuzu-d35577d3ed0bfc56ddf85a2e8b163d9d02bec809.tar.gz
yuzu-d35577d3ed0bfc56ddf85a2e8b163d9d02bec809.tar.bz2
yuzu-d35577d3ed0bfc56ddf85a2e8b163d9d02bec809.tar.lz
yuzu-d35577d3ed0bfc56ddf85a2e8b163d9d02bec809.tar.xz
yuzu-d35577d3ed0bfc56ddf85a2e8b163d9d02bec809.tar.zst
yuzu-d35577d3ed0bfc56ddf85a2e8b163d9d02bec809.zip
Diffstat (limited to 'src/common/settings.h')
-rw-r--r--src/common/settings.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/common/settings.h b/src/common/settings.h
index 2879237cc..4ca8299b3 100644
--- a/src/common/settings.h
+++ b/src/common/settings.h
@@ -200,6 +200,8 @@ public:
virtual bool RuntimeModfiable() const = 0;
virtual void SetGlobal(bool global) {}
virtual constexpr u32 Id() const = 0;
+ virtual std::string MinVal() const = 0;
+ virtual std::string MaxVal() const = 0;
virtual bool UsingGlobal() const {
return false;
}
@@ -336,7 +338,7 @@ protected:
if constexpr (std::is_same<Type, std::string>()) {
return value_;
} else if constexpr (std::is_same<Type, std::optional<u32>>()) {
- return value_.has_value() ? std::to_string(*value_) : "0";
+ return value_.has_value() ? std::to_string(*value_) : "none";
} else if constexpr (std::is_same<Type, bool>()) {
return value_ ? "true" : "false";
} else {
@@ -401,7 +403,7 @@ public:
if constexpr (std::is_same<Type, std::string>()) {
this->SetValue(input);
} else if constexpr (std::is_same<Type, std::optional<u32>>()) {
- this->SetValue(static_cast<u32>(std::stoll(input)));
+ this->SetValue(static_cast<u32>(std::stoul(input)));
} else if constexpr (std::is_same<Type, bool>()) {
this->SetValue(input == "true");
} else {
@@ -435,6 +437,13 @@ public:
return id;
}
+ virtual std::string MinVal() const override {
+ return this->ToString(minimum);
+ }
+ virtual std::string MaxVal() const override {
+ return this->ToString(maximum);
+ }
+
protected:
Type value{}; ///< The setting
const Type default_value{}; ///< The default value