diff options
| author | Aizistral | 2022-08-30 12:23:01 +0200 |
|---|---|---|
| committer | GitHub | 2022-08-30 12:23:01 +0200 |
| commit | 86cd952ab6db39afe72da8154a00c2fa52746f66 (patch) | |
| tree | 170b41ed88614372ebe179f4e1364b9cf3429197 /src/main/java/com | |
| parent | 57d211773ccf143aa2fcd4b428de8101c59bde98 (diff) | |
| parent | 14de66a328c9f88058b1adcb1111cba40e8dc2f1 (diff) | |
Merge pull request #175 from MODKILLER1001/1.19.2-Fabric
Update and add ModMenu things
Diffstat (limited to 'src/main/java/com')
| -rw-r--r-- | src/main/java/com/aizistral/nochatreports/config/ModMenuIntegration.java | 54 |
1 files changed, 44 insertions, 10 deletions
diff --git a/src/main/java/com/aizistral/nochatreports/config/ModMenuIntegration.java b/src/main/java/com/aizistral/nochatreports/config/ModMenuIntegration.java index d42864f..8a18f3d 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.startIntField(Component.translatable("option.NoChatReports.verifiedIconOffsetX"), NCRConfig.getClient().verifiedIconOffsetX) + .setDefaultValue(0) + .setTooltip(this.makeTooltip("option.NoChatReports.verifiedIconOffsetX.tooltip")) + .setSaveConsumer(newValue -> NCRConfig.getClient().verifiedIconOffsetX = newValue) + .build()); + + // Set an option for verifiedIconOffsetY + visual.addEntry(entryBuilder.startIntField(Component.translatable("option.NoChatReports.verifiedIconOffsetY"), NCRConfig.getClient().verifiedIconOffsetY) + .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,10 +179,31 @@ 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(); }; } -} +}
\ No newline at end of file |
