2023-06-12 17:05:30 -04:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include "common/settings_common.h"
|
|
|
|
|
|
|
|
namespace Settings {
|
|
|
|
|
|
|
|
BasicSetting::BasicSetting(Linkage& linkage, const std::string& name, enum Category category_,
|
2023-06-21 05:04:21 -04:00
|
|
|
bool save_, bool runtime_modifiable_, u32 specialization_,
|
|
|
|
BasicSetting* other_setting_)
|
2023-06-21 03:23:36 -04:00
|
|
|
: label{name}, category{category_}, id{linkage.count}, save{save_},
|
2023-06-21 04:32:13 -04:00
|
|
|
runtime_modifiable{runtime_modifiable_}, specialization{specialization_},
|
|
|
|
other_setting{other_setting_} {
|
2023-06-12 17:05:30 -04:00
|
|
|
linkage.by_category[category].push_front(this);
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
Category BasicSetting::Category() const {
|
|
|
|
return category;
|
|
|
|
}
|
|
|
|
|
2023-06-21 05:04:21 -04:00
|
|
|
u32 BasicSetting::Specialization() const {
|
2023-06-21 03:23:36 -04:00
|
|
|
return specialization;
|
|
|
|
}
|
|
|
|
|
2023-06-21 04:32:13 -04:00
|
|
|
BasicSetting* BasicSetting::PairedSetting() const {
|
|
|
|
return other_setting;
|
|
|
|
}
|
|
|
|
|
2023-06-12 17:05:30 -04:00
|
|
|
const std::string& BasicSetting::GetLabel() const {
|
|
|
|
return label;
|
|
|
|
}
|
|
|
|
|
2023-06-13 19:37:41 -04:00
|
|
|
static bool configuring_global = true;
|
|
|
|
|
|
|
|
bool IsConfiguringGlobal() {
|
|
|
|
return configuring_global;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetConfiguringGlobal(bool is_global) {
|
|
|
|
configuring_global = is_global;
|
|
|
|
}
|
|
|
|
|
2023-06-12 17:05:30 -04:00
|
|
|
} // namespace Settings
|