2023-06-12 21:05:30 +00:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
2023-08-10 00:58:47 +00:00
|
|
|
#include <functional>
|
2023-06-12 21:05:30 +00:00
|
|
|
#include <string>
|
2023-08-10 00:58:47 +00:00
|
|
|
#include <vector>
|
2023-06-12 21:05:30 +00:00
|
|
|
#include "common/settings_common.h"
|
|
|
|
|
|
|
|
namespace Settings {
|
|
|
|
|
|
|
|
BasicSetting::BasicSetting(Linkage& linkage, const std::string& name, enum Category category_,
|
2023-06-21 09:04:21 +00:00
|
|
|
bool save_, bool runtime_modifiable_, u32 specialization_,
|
|
|
|
BasicSetting* other_setting_)
|
2023-06-21 07:23:36 +00:00
|
|
|
: label{name}, category{category_}, id{linkage.count}, save{save_},
|
2023-06-21 08:32:13 +00:00
|
|
|
runtime_modifiable{runtime_modifiable_}, specialization{specialization_},
|
|
|
|
other_setting{other_setting_} {
|
2023-08-16 06:36:56 +00:00
|
|
|
linkage.by_key.insert({name, this});
|
2023-07-19 17:46:48 +00:00
|
|
|
linkage.by_category[category].push_back(this);
|
2023-06-12 21:05:30 +00:00
|
|
|
linkage.count++;
|
|
|
|
}
|
|
|
|
|
|
|
|
BasicSetting::~BasicSetting() = default;
|
|
|
|
|
|
|
|
std::string BasicSetting::ToStringGlobal() const {
|
|
|
|
return this->ToString();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool BasicSetting::UsingGlobal() const {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void BasicSetting::SetGlobal(bool global) {}
|
|
|
|
|
|
|
|
bool BasicSetting::Save() const {
|
|
|
|
return save;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool BasicSetting::RuntimeModfiable() const {
|
|
|
|
return runtime_modifiable;
|
|
|
|
}
|
|
|
|
|
2023-07-18 19:42:59 +00:00
|
|
|
Category BasicSetting::GetCategory() const {
|
2023-06-12 21:05:30 +00:00
|
|
|
return category;
|
|
|
|
}
|
|
|
|
|
2023-06-21 09:04:21 +00:00
|
|
|
u32 BasicSetting::Specialization() const {
|
2023-06-21 07:23:36 +00:00
|
|
|
return specialization;
|
|
|
|
}
|
|
|
|
|
2023-06-21 08:32:13 +00:00
|
|
|
BasicSetting* BasicSetting::PairedSetting() const {
|
|
|
|
return other_setting;
|
|
|
|
}
|
|
|
|
|
2023-06-12 21:05:30 +00:00
|
|
|
const std::string& BasicSetting::GetLabel() const {
|
|
|
|
return label;
|
|
|
|
}
|
|
|
|
|
2023-07-25 19:57:55 +00:00
|
|
|
Linkage::Linkage(u32 initial_count) : count{initial_count} {}
|
|
|
|
Linkage::~Linkage() = default;
|
|
|
|
|
2023-06-12 21:05:30 +00:00
|
|
|
} // namespace Settings
|