mirror of
https://github.com/N64Recomp/N64ModernRuntime.git
synced 2026-02-03 04:06:08 +00:00
Add function to check if option is present in config
This commit is contained in:
parent
ae5e92303f
commit
49e9add3bb
2 changed files with 5 additions and 0 deletions
|
|
@ -249,6 +249,7 @@ namespace recomp {
|
|||
return std::get<T>(get_option(option_index).variant);
|
||||
};
|
||||
|
||||
bool has_option(const std::string& option_id) const;
|
||||
const ConfigValueVariant get_option_value(const std::string& option_id) const;
|
||||
const ConfigValueVariant get_temp_option_value(const std::string& option_id) const;
|
||||
// This should only be used internally to recompui. Other changes to values should be done through update_option_value
|
||||
|
|
|
|||
|
|
@ -276,6 +276,10 @@ const ConfigOption &Config::get_option(const std::string& option_id) const {
|
|||
return schema.options[option_by_id_it->second];
|
||||
}
|
||||
|
||||
bool Config::has_option(const std::string& option_id) const {
|
||||
return schema.options_by_id.contains(option_id);
|
||||
}
|
||||
|
||||
const ConfigValueVariant Config::get_option_value_from_storage(const std::string& option_id, const ConfigStorage& src) const {
|
||||
auto it = src.value_map.find(option_id);
|
||||
if (it != src.value_map.end()) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue