diff options
Diffstat (limited to 'src/common/settings_common.cpp')
| -rw-r--r-- | src/common/settings_common.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/common/settings_common.cpp b/src/common/settings_common.cpp new file mode 100644 index 000000000..a7ce99515 --- /dev/null +++ b/src/common/settings_common.cpp | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #include <string> | ||
| 5 | #include "common/settings_common.h" | ||
| 6 | |||
| 7 | namespace Settings { | ||
| 8 | |||
| 9 | BasicSetting::BasicSetting(Linkage& linkage, const std::string& name, enum Category category_, | ||
| 10 | bool save_, bool runtime_modifiable_) | ||
| 11 | : label{name}, category{category_}, id{linkage.count}, save{save_}, runtime_modifiable{ | ||
| 12 | runtime_modifiable_} { | ||
| 13 | linkage.by_category[category].push_front(this); | ||
| 14 | linkage.count++; | ||
| 15 | } | ||
| 16 | |||
| 17 | BasicSetting::~BasicSetting() = default; | ||
| 18 | |||
| 19 | std::string BasicSetting::ToStringGlobal() const { | ||
| 20 | return this->ToString(); | ||
| 21 | } | ||
| 22 | |||
| 23 | bool BasicSetting::UsingGlobal() const { | ||
| 24 | return true; | ||
| 25 | } | ||
| 26 | |||
| 27 | void BasicSetting::SetGlobal(bool global) {} | ||
| 28 | |||
| 29 | bool BasicSetting::Save() const { | ||
| 30 | return save; | ||
| 31 | } | ||
| 32 | |||
| 33 | bool BasicSetting::RuntimeModfiable() const { | ||
| 34 | return runtime_modifiable; | ||
| 35 | } | ||
| 36 | |||
| 37 | Category BasicSetting::Category() const { | ||
| 38 | return category; | ||
| 39 | } | ||
| 40 | |||
| 41 | const std::string& BasicSetting::GetLabel() const { | ||
| 42 | return label; | ||
| 43 | } | ||
| 44 | |||
| 45 | } // namespace Settings | ||