config: override preset options with config options

Any options in the config will override anything in a preset.
This allows users to make small changes to a preset
pull/1093/head
FlightlessMango 2 months ago
parent d2b9458a46
commit 46b6fa7fed

@ -99,8 +99,6 @@ static void enumerate_config_files(std::vector<std::string>& paths) {
}
void parseConfigFile(overlay_params& params) {
HUDElements.options.clear();
params.options.clear();
std::vector<std::string> paths;
const char *cfg_file = getenv("MANGOHUD_CONFIGFILE");

@ -775,7 +775,7 @@ parse_overlay_config(struct overlay_params *params,
bool read_cfg = params->enabled[OVERLAY_PARAM_ENABLED_read_cfg];
if (!env || read_cfg) {
// Get config options
// this pass is just to get preset option
parseConfigFile(*params);
if (!use_existing_preset) {
@ -787,7 +787,13 @@ parse_overlay_config(struct overlay_params *params,
current_preset = params->preset[0];
}
// clear options since we don't want config options to appear first
params->options.clear();
HUDElements.options.clear();
// add preset options
presets(current_preset, params);
// potentially override preset options with config options
parseConfigFile(*params);
if (params->options.find("full") != params->options.end() && params->options.find("full")->second != "0") {
#define OVERLAY_PARAM_BOOL(name) \

Loading…
Cancel
Save