| 88 | } |
| 89 | |
| 90 | void ScriptConfig::SetSetting(std::string_view name, int value) |
| 91 | { |
| 92 | /* You can only set Script specific settings if an Script is selected. */ |
| 93 | if (this->info == nullptr) return; |
| 94 | |
| 95 | const ScriptConfigItem *config_item = this->info->GetConfigItem(name); |
| 96 | if (config_item == nullptr) return; |
| 97 | |
| 98 | value = Clamp(value, config_item->min_value, config_item->max_value); |
| 99 | |
| 100 | this->settings[std::string{name}] = value; |
| 101 | } |
| 102 | |
| 103 | void ScriptConfig::ResetSettings() |
| 104 | { |
no test coverage detected