From 8915660ed6c28d2754aa53ad5e0869234a83e1da Mon Sep 17 00:00:00 2001 From: MODKILLER1001 Date: Sat, 27 Aug 2022 16:11:18 -0400 Subject: Add lan options and verified server options --- .../nochatreports/config/ModMenuIntegration.java | 52 ++++++++++++++++++---- 1 file changed, 43 insertions(+), 9 deletions(-) (limited to 'src/main/java/com') diff --git a/src/main/java/com/aizistral/nochatreports/config/ModMenuIntegration.java b/src/main/java/com/aizistral/nochatreports/config/ModMenuIntegration.java index d42864f..4e949bc 100644 --- a/src/main/java/com/aizistral/nochatreports/config/ModMenuIntegration.java +++ b/src/main/java/com/aizistral/nochatreports/config/ModMenuIntegration.java @@ -55,6 +55,7 @@ public final class ModMenuIntegration implements ModMenuApi { ConfigCategory visual = builder.getOrCreateCategory(Component.translatable("configuration.NoChatReports.category.visual")); ConfigCategory technical = builder.getOrCreateCategory(Component.translatable("configuration.NoChatReports.category.technical")); ConfigCategory whitelistedServers = builder.getOrCreateCategory(Component.translatable("configuration.NoChatReports.category.whitelistedServers")); + ConfigCategory lanOptions = builder.getOrCreateCategory(Component.translatable("configuration.NoChatReports.category.lanOptions")); ConfigEntryBuilder entryBuilder = builder.entryBuilder(); @@ -71,6 +72,27 @@ public final class ModMenuIntegration implements ModMenuApi { .withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, Component.translatable("https://github.com/Aizistral-Studios/No-Chat-Reports/wiki/Configuration-Files/#option-showserversafety"))).withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://github.com/Aizistral-Studios/No-Chat-Reports/wiki/Configuration-Files/#option-showserversafety")))) .build()); + // Set an option for verifiedIconEnabled + visual.addEntry(entryBuilder.startBooleanToggle(Component.translatable("option.NoChatReports.verifiedIconEnabled"), NCRConfig.getClient().verifiedIconEnabled) + .setDefaultValue(true) + .setTooltip(this.makeTooltip("option.NoChatReports.verifiedIconEnabled.tooltip")) + .setSaveConsumer(newValue -> NCRConfig.getClient().verifiedIconEnabled = newValue) + .build()); + + // Set an option for verifiedIconOffsetX + visual.addEntry(entryBuilder.startIntSlider(Component.translatable("option.NoChatReports.verifiedIconOffsetX"), NCRConfig.getClient().verifiedIconOffsetX, 0, 10) + .setDefaultValue(0) + .setTooltip(this.makeTooltip("option.NoChatReports.verifiedIconOffsetX.tooltip")) + .setSaveConsumer(newValue -> NCRConfig.getClient().verifiedIconOffsetX = newValue) + .build()); + + // Set an option for verifiedIconOffsetY + visual.addEntry(entryBuilder.startIntSlider(Component.translatable("option.NoChatReports.verifiedIconOffsetY"), NCRConfig.getClient().verifiedIconOffsetY, 0, 10) + .setDefaultValue(0) + .setTooltip(this.makeTooltip("option.NoChatReports.verifiedIconOffsetY.tooltip")) + .setSaveConsumer(newValue -> NCRConfig.getClient().verifiedIconOffsetY = newValue) + .build()); + // Set an option for hideRedChatIndicators visual.addEntry(entryBuilder.startBooleanToggle(Component.translatable("option.NoChatReports.hideRedChatIndicators"), NCRConfig.getClient().hideRedChatIndicators) .setDefaultValue(true) @@ -113,8 +135,6 @@ public final class ModMenuIntegration implements ModMenuApi { .setSaveConsumer(newValue -> NCRConfig.getClient().demandOnServer = newValue) .build()); - // TODO Where's the one for demandOnClient? - // Set an option for enableDebugLog technical.addEntry(entryBuilder.startBooleanToggle(Component.translatable("option.NoChatReports.enableDebugLog"), NCRConfig.getCommon().enableDebugLog) .setDefaultValue(false) @@ -122,13 +142,6 @@ public final class ModMenuIntegration implements ModMenuApi { .setSaveConsumer(newValue -> NCRConfig.getCommon().enableDebugLog = newValue) .build()); - // Set an option for convertToGameMessage - technical.addEntry(entryBuilder.startBooleanToggle(Component.translatable("option.NoChatReports.convertToGameMessage"), NCRConfig.getCommon().convertToGameMessage) - .setDefaultValue(false) - .setTooltip(this.makeTooltip("option.NoChatReports.convertToGameMessage.tooltip")) - .setSaveConsumer(newValue -> NCRConfig.getCommon().convertToGameMessage = newValue) - .build()); - // Set an option for disableTelemetry technical.addEntry(entryBuilder.startBooleanToggle(Component.translatable("option.NoChatReports.disableTelemetry"), NCRConfig.getClient().disableTelemetry) .setDefaultValue(true) @@ -166,6 +179,27 @@ public final class ModMenuIntegration implements ModMenuApi { .setCreateNewInstance(baseListEntry -> new StringListListEntry.StringListCell(Language.getInstance().getOrDefault(("option.NoChatReports.whitelistedServers.serverAddress")), baseListEntry)) .build()); + // Set an option for demandOnClient + lanOptions.addEntry(entryBuilder.startBooleanToggle(Component.translatable("option.NoChatReports.demandOnClient"), NCRConfig.getCommon().demandOnClient) + .setDefaultValue(true) + .setTooltip(this.makeTooltip("option.NoChatReports.demandOnClient.tooltip")) + .setSaveConsumer(newValue -> NCRConfig.getCommon().demandOnClient = newValue) + .build()); + + // Set an option for convertToGameMessage + lanOptions.addEntry(entryBuilder.startBooleanToggle(Component.translatable("option.NoChatReports.convertToGameMessage"), NCRConfig.getCommon().convertToGameMessage) + .setDefaultValue(false) + .setTooltip(this.makeTooltip("option.NoChatReports.convertToGameMessage.tooltip")) + .setSaveConsumer(newValue -> NCRConfig.getCommon().convertToGameMessage = newValue) + .build()); + + // Set an option for addQueryData + lanOptions.addEntry(entryBuilder.startBooleanToggle(Component.translatable("option.NoChatReports.addQueryData"), NCRConfig.getCommon().addQueryData) + .setDefaultValue(true) + .setTooltip(this.makeTooltip("option.NoChatReports.addQueryData.tooltip")) + .setSaveConsumer(newValue -> NCRConfig.getCommon().addQueryData = newValue) + .build()); + // Save config builder.setSavingRunnable(NCRConfig::save); return builder.build(); -- cgit v1.2.3