Make mod overrides higher priority than user configuration
Prevents players inadvertently enabling incompatible options
This commit is contained in:
parent
4c484f5125
commit
816346e919
|
|
@ -285,7 +285,10 @@ public class ModernFixEarlyConfig {
|
|||
continue;
|
||||
}
|
||||
|
||||
option.setEnabled(enabled, true);
|
||||
if(!option.isModDefined())
|
||||
option.setEnabled(enabled, true);
|
||||
else
|
||||
LOGGER.warn("Option '{}' already disabled by a mod. Ignoring user configuration", key);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -128,7 +128,20 @@ public class OptionList extends ContainerObjectSelectionList<OptionList.Entry> {
|
|||
this.option.setEnabled(!this.option.isEnabled(), !this.option.isUserDefined());
|
||||
ModernFix.LOGGER.error("Unable to save config", e);
|
||||
}
|
||||
}, (btn, gfx, x, y) -> {
|
||||
if(this.option.isModDefined()) {
|
||||
String disablingMods = String.join(", ", this.option.getDefiningMods());
|
||||
OptionList.this.mainScreen.renderTooltip(
|
||||
gfx,
|
||||
new TranslatableComponent("modernfix.option." + (this.option.isEnabled() ? "enabled" : "disabled"))
|
||||
.append(new TranslatableComponent("modernfix.option.mod_override", disablingMods)),
|
||||
x,
|
||||
y
|
||||
);
|
||||
}
|
||||
});
|
||||
if(this.option.isModDefined())
|
||||
this.toggleButton.active = false;
|
||||
this.helpButton = new Button(75, 0, 20, 20, new TextComponent("?"), (arg) -> {
|
||||
Minecraft.getInstance().setScreen(new ModernFixOptionInfoScreen(mainScreen, optionName));
|
||||
});
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@
|
|||
"modernfix.config.done_restart": "Done (restart required)",
|
||||
"modernfix.option.on": "on",
|
||||
"modernfix.option.off": "off",
|
||||
"modernfix.option.disabled": "disabled",
|
||||
"modernfix.option.enabled": "enabled",
|
||||
"modernfix.option.mod_override": " by mods [%s]",
|
||||
"modernfix.config.not_default": " (modified)",
|
||||
"asynclocator.map.locating": "Map (Locating...)",
|
||||
"asynclocator.map.none": "Map (No nearby feature found)",
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user