Consistent naming for normal debug mode

This commit is contained in:
Jozufozu 2021-07-26 13:42:38 -07:00
parent d05b105e7e
commit 6786e11795
4 changed files with 15 additions and 15 deletions

View file

@ -36,20 +36,20 @@ public enum BooleanConfig {
if (player == null || state == null) return;
if (state == BooleanDirective.DISPLAY) {
ITextComponent text = new StringTextComponent("Flywheel Renderer is currently: ").append(boolToText(FlwConfig.get().client.enabled.get()));
ITextComponent text = new StringTextComponent("Flywheel renderer is currently: ").append(boolToText(FlwConfig.get().client.enabled.get()));
player.displayClientMessage(text, false);
return;
}
boolean enabled = state.get();
boolean cannotUseER = OptifineHandler.usingShaders() && enabled;
boolean cannotUse = OptifineHandler.usingShaders() && enabled;
FlwConfig.get().client.enabled.set(enabled);
ITextComponent text = boolToText(FlwConfig.get().client.enabled.get()).append(new StringTextComponent(" Flywheel Renderer").withStyle(TextFormatting.WHITE));
ITextComponent error = new StringTextComponent("Flywheel Renderer does not support Optifine Shaders").withStyle(TextFormatting.RED);
ITextComponent text = boolToText(FlwConfig.get().client.enabled.get()).append(new StringTextComponent(" Flywheel renderer").withStyle(TextFormatting.WHITE));
ITextComponent error = new StringTextComponent("Flywheel renderer does not support Optifine Shaders").withStyle(TextFormatting.RED);
player.displayClientMessage(cannotUseER ? error : text, false);
player.displayClientMessage(cannotUse ? error : text, false);
Backend.reloadWorldRenderers();
}
@ -59,14 +59,14 @@ public enum BooleanConfig {
if (player == null || state == null) return;
if (state == BooleanDirective.DISPLAY) {
ITextComponent text = new StringTextComponent("Normal overlay is currently: ").append(boolToText(FlwConfig.get().client.normalDebug.get()));
ITextComponent text = new StringTextComponent("Normal debug mode is currently: ").append(boolToText(FlwConfig.get().client.debugNormals.get()));
player.displayClientMessage(text, false);
return;
}
FlwConfig.get().client.normalDebug.set(state.get());
FlwConfig.get().client.debugNormals.set(state.get());
ITextComponent text = boolToText(FlwConfig.get().client.normalDebug.get()).append(new StringTextComponent(" Normal Overlay").withStyle(TextFormatting.WHITE));
ITextComponent text = boolToText(FlwConfig.get().client.debugNormals.get()).append(new StringTextComponent(" normal debug mode").withStyle(TextFormatting.WHITE));
player.displayClientMessage(text, false);
}

View file

@ -16,6 +16,6 @@ public class FlwCommands {
dispatcher.register(Commands.literal("flywheel")
.then(new BooleanConfigCommand("backend", BooleanConfig.ENGINE).register())
.then(new BooleanConfigCommand("normalOverlay", BooleanConfig.NORMAL_OVERLAY).register()));
.then(new BooleanConfigCommand("debugNormals", BooleanConfig.NORMAL_OVERLAY).register()));
}
}

View file

@ -30,8 +30,8 @@ public class FlwConfig {
return client.enabled.get();
}
public boolean normalOverlayEnabled() {
return client.normalDebug.get();
public boolean debugNormals() {
return client.debugNormals.get();
}
public static void init() {
@ -39,15 +39,15 @@ public class FlwConfig {
public static class ClientConfig {
public final BooleanValue enabled;
public final BooleanValue normalDebug;
public final BooleanValue debugNormals;
public ClientConfig(ForgeConfigSpec.Builder builder) {
enabled = builder.comment("Enable or disable the entire engine")
.define("enabled", true);
normalDebug = builder.comment("Enable or disable a debug overlay that colors pixels by their normal")
.define("normalDebug", false);
debugNormals = builder.comment("Enable or disable a debug overlay that colors pixels by their normal")
.define("debugNormals", false);
}
}
}

View file

@ -18,7 +18,7 @@ public class NormalDebugStateProvider implements IBooleanStateProvider {
@Override
public boolean isTrue() {
return FlwConfig.get()
.normalOverlayEnabled();
.debugNormals();
}
@Override