summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMODKILLER10012022-08-27 16:11:18 -0400
committerMODKILLER10012022-08-27 16:11:18 -0400
commit8915660ed6c28d2754aa53ad5e0869234a83e1da (patch)
treef9bf9fbd96c81918d9d33c6c5465469ecc5166d5
parentdffdc3b65f3643192cb08cbfa3d05067ebcd9f30 (diff)
Add lan options and verified server options
-rw-r--r--src/main/java/com/aizistral/nochatreports/config/ModMenuIntegration.java52
-rw-r--r--src/main/resources/assets/nochatreports/lang/en_us.json29
2 files changed, 67 insertions, 14 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..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();
diff --git a/src/main/resources/assets/nochatreports/lang/en_us.json b/src/main/resources/assets/nochatreports/lang/en_us.json
index 195e4ed..d0b57be 100644
--- a/src/main/resources/assets/nochatreports/lang/en_us.json
+++ b/src/main/resources/assets/nochatreports/lang/en_us.json
@@ -15,12 +15,18 @@
"gui.nochatreports.verified_server": "§a§lSafe Server§r\nWe could verify that this server has No Chat Reports installed, or prevents chat reports in some other known way. You can chat there safely.",
"configuration.NoChatReports.config": "No Chat Reports",
+
"configuration.NoChatReports.category.visual": "Visual",
- "configuration.NoChatReports.category.technical": "Technical",
- "configuration.NoChatReports.category.whitelistedServers": "Whitelisted Servers",
+
"option.NoChatReports.showServerSafety": "Show server safety",
"option.NoChatReports.showServerSafety.tooltip": "Allows the client to display server safety status in bottom-right corner of chat screen. The icon is hoverable for additional information.",
"option.NoChatReports.showServerSafety.moreInfo": "§bClick here to read more about server safety levels",
+ "option.NoChatReports.verifiedIconEnabled": "Verified icon enabled",
+ "option.NoChatReports.verifiedIconEnabled.tooltip": "Allows the mod to display special icon in multiplayer menu for servers that have No Chat Reports or some other anti-chat-reporting measures installed.",
+ "option.NoChatReports.verifiedIconOffsetX": "Verified icon offset X",
+ "option.NoChatReports.verifiedIconOffsetX.tooltip": "Defines X-axis offset for rendering of \"Safe Server\" icon.",
+ "option.NoChatReports.verifiedIconOffsetY": "Verified icon offset Y",
+ "option.NoChatReports.verifiedIconOffsetY.tooltip": "Defines Y-axis offset for rendering of \"Safe Server\" icon.",
"option.NoChatReports.hideRedChatIndicators": "Hide red chat indicators",
"option.NoChatReports.hideRedChatIndicators.tooltip": "Prevents the client from displaying \"Not Secure\" indicators, in the form of red bar to the left and §c§l(§r§c!§c§l)§r icon to the right of chat message.",
"option.NoChatReports.hideYellowChatIndicators": "Hide yellow chat indicators",
@@ -31,22 +37,35 @@
"option.NoChatReports.hideWarningToast.tooltip": "Removes a warning toast that is displayed when entering servers with disabled §oenforce-secure-profile§r.",
"option.NoChatReports.alwaysHideReportButton": "Always hide report button",
"option.NoChatReports.alwaysHideReportButton.tooltip": "Prevents the client from ever showing report button in Social Interactions screen. This is disabled by default, and mod simply makes button inactive on servers that have No Chat Reports installed, adding an explanation to the tooltip of the button.",
+
+ "configuration.NoChatReports.category.technical": "Technical",
+
"option.NoChatReports.demandOnServer": "Demand on server",
"option.NoChatReports.demandOnServer.tooltip": "Prevents the client from joining servers that don't have No Chat Reports installed.",
"option.NoChatReports.enableDebugLog": "Enable debug log",
"option.NoChatReports.enableDebugLog.tooltip": "Enables logging of certain debug information. This is generally useless for non-developers.",
- "option.NoChatReports.convertToGameMessage": "Convert to game message",
- "option.NoChatReports.convertToGameMessage.tooltip": "Makes the server convert all player messages into system messages. System messages don't have any signatures attached and cannot be reported; on unmodified clients they will display with gray bar to the left.",
"option.NoChatReports.disableTelemetry": "Disable telemetry",
"option.NoChatReports.disableTelemetry.tooltip": "Allows the mod to disable built-in telemetry, similar to how No Telemetry does.",
"option.NoChatReports.showReloadButton": "Show reload button",
"option.NoChatReports.showReloadButton.tooltip": "Adds a button for config reloading to Multiplayer menu.",
"option.NoChatReports.whitelistAllServers": "Whitelist all servers",
"option.NoChatReports.whitelistAllServers.tooltip": "Makes the mod behave as if all servers were added to §oWhitelisted Servers§r list.",
+
+ "configuration.NoChatReports.category.whitelistedServers": "Whitelisted Servers",
+
"option.NoChatReports.whitelistedServers": "Whitelisted Servers",
"option.NoChatReports.whitelistedServers.tooltip": "Contains servers for which \"Unsafe Server\" warning screen should never display. Servers are added to this list automatically when you check \"Do not show again for this server\" box in that screen.\nEach entry is a string that is formatted as §l<server-ip>:<port>§r.",
"option.NoChatReports.whitelistedServers.addButtonTooltip": "Add server",
"option.NoChatReports.whitelistedServers.removeButtonTooltip": "Remove server",
"option.NoChatReports.whitelistedServers.instructions": "Click the + to add a server. Click the - to remove the selected server.",
- "option.NoChatReports.whitelistedServers.serverAddress": "Click here to edit server address"
+ "option.NoChatReports.whitelistedServers.serverAddress": "Click here to edit server address",
+
+ "configuration.NoChatReports.category.lanOptions": "LAN Options",
+
+ "option.NoChatReports.demandOnClient": "Demand on client",
+ "option.NoChatReports.demandOnClient.tooltip": "Makes the server require all joining clients to have No Chat Reports installed.",
+ "option.NoChatReports.convertToGameMessage": "Convert to game message",
+ "option.NoChatReports.convertToGameMessage.tooltip": "Makes the server convert all player messages into system messages. System messages don't have any signatures attached and cannot be reported; on unmodified clients they will display with gray bar to the left.",
+ "option.NoChatReports.addQueryData": "Add query data",
+ "option.NoChatReports.addQueryData.tooltip": "Allows the server to send additional data to client when handling pings. This is used for displaying \"Safe Server\" icon, as well as some other technical purposes."
} \ No newline at end of file