Skip to content

Commit

Permalink
Release v3.8+fabric
Browse files Browse the repository at this point in the history
Next up, testing. If everything goes right, this commit will be the main release.
  • Loading branch information
TheCSDev committed Feb 2, 2024
1 parent e90d7a2 commit 0287570
Show file tree
Hide file tree
Showing 12 changed files with 114 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ public BetterStatsConfigScreen(@Nullable Screen parent)
panel.addChild(panel_action, false);

final var config = BetterStats.getInstance().getConfig();
final var configBuilder = TConfigPanelBuilder.builder(panel_config)
.addCheckbox(
final var config_builder = TConfigPanelBuilder.builder(panel_config);
config_builder.addLabelB(translatable("tcdcommons.client_side")).setTextColor(0xFFFFFF00);
config_builder.addCheckbox(
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.debug_mode"),
BetterStatsConfig.DEBUG_MODE,
checkbox -> BetterStatsConfig.DEBUG_MODE = checkbox.getChecked())
Expand All @@ -111,9 +112,18 @@ public BetterStatsConfigScreen(@Nullable Screen parent)
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.trust_all_servers_bss_net"),
config.trustAllServersBssNet,
checkbox -> config.trustAllServersBssNet = checkbox.getChecked());
configBuilder.getLastAddedElement().setTooltip(
config_builder.getLastAddedElement().setTooltip(
Tooltip.of(translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.trust_all_servers_bss_net.tooltip")));
configBuilder.build(() -> config.trySaveToFile(true));
config_builder.addLabelB(translatable("tcdcommons.server_side")).setTextColor(0xFFFFFF00);
config_builder.addCheckbox(
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.register_commands"),
config.registerCommands,
checkbox -> config.registerCommands = checkbox.getChecked())
.addCheckbox(
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.enable_sas"),
config.enableServerSAS,
checkbox -> config.enableServerSAS = checkbox.getChecked())
.build(() -> config.trySaveToFile(true));

final var btn_actionCancel = new TButtonWidget(
5, 5, (panelW / 2) - 7, 20,
Expand All @@ -123,7 +133,7 @@ public BetterStatsConfigScreen(@Nullable Screen parent)
panel_action.getEndX() - btn_actionCancel.getWidth() - 5, panel_action.getY() + 5,
btn_actionCancel.getWidth(), 20,
translatable("gui.done"),
__ -> { configBuilder.saveChanges(); close(); });
__ -> { config_builder.saveChanges(); close(); });
panel_action.addChild(btn_actionCancel, true);
panel_action.addChild(btn_actionDone, false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ public final class BSConfigTab extends StatsTab

//init config gui
final var config = BetterStats.getInstance().getConfig();
this.config_builder = TConfigPanelBuilder.builder(panel)
.addCheckbox(
this.config_builder = TConfigPanelBuilder.builder(panel);
this.config_builder.addLabelB(translatable("tcdcommons.client_side")).setTextColor(0xFFFFFF00);
this.config_builder.addCheckbox(
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.debug_mode"),
BetterStatsConfig.DEBUG_MODE,
checkbox -> BetterStatsConfig.DEBUG_MODE = checkbox.getChecked())
Expand All @@ -46,7 +47,16 @@ public final class BSConfigTab extends StatsTab
checkbox -> config.trustAllServersBssNet = checkbox.getChecked());
this.config_builder.getLastAddedElement().setTooltip(
Tooltip.of(translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.trust_all_servers_bss_net.tooltip")));
this.config_builder.build(() -> config.trySaveToFile(true));
this.config_builder.addLabelB(translatable("tcdcommons.server_side")).setTextColor(0xFFFFFF00);
this.config_builder.addCheckbox(
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.register_commands"),
config.registerCommands,
checkbox -> config.registerCommands = checkbox.getChecked())
.addCheckbox(
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.enable_sas"),
config.enableServerSAS,
checkbox -> config.enableServerSAS = checkbox.getChecked())
.build(() -> config.trySaveToFile(true));
}
// --------------------------------------------------
public final @Override void initFilters(FiltersInitContext initContext)
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
"betterstats.api.client.gui.screen.betterstatsconfigscreen.gui_mob_follow_cursor": "GUI mobs follow curfollow cursor",
"betterstats.api.client.gui.screen.betterstatsconfigscreen.trust_all_servers_bss_net": "Auto-toggle 'betterstats' network",
"betterstats.api.client.gui.screen.betterstatsconfigscreen.trust_all_servers_bss_net.tooltip": "When this mod is installed on a server, it offers more features. The 'betterstats' network protocol is how a 'betterstats' server communicates with the 'betterstats' client. With this enabled, the client will automatically tell the server it has 'betterstats' installed when applicable. With this disabled, you will have do it manually yourself each time you join a server.",
"betterstats.api.client.gui.screen.betterstatsconfigscreen.register_commands": "Register commands",
"betterstats.api.client.gui.screen.betterstatsconfigscreen.enable_sas": "Enable stat announcement system",

"betterstats.api.client.registry.bsclientplayerbadges.dedication.title": "Dedication",
"betterstats.api.client.registry.bsclientplayerbadges.dedication.description": "You've shown true dedication! You have played on this world for at least 12 days (288 hours).",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,32 @@ public BetterStatsConfigScreen(@Nullable Screen parent)
panel.addChild(panel_action, false);

final var config = BetterStats.getInstance().getConfig();
final var configBuilder = TConfigPanelBuilder.builder(panel_config)
.addCheckbox(
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.debug_mode"),
BetterStatsConfig.DEBUG_MODE,
checkbox -> BetterStatsConfig.DEBUG_MODE = checkbox.getChecked())
.addCheckbox(
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.gui_mob_follow_cursor"),
config.guiMobsFollowCursor,
checkbox -> config.guiMobsFollowCursor = checkbox.getChecked())
.addCheckbox(
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.trust_all_servers_bss_net"),
config.trustAllServersBssNet,
checkbox -> config.trustAllServersBssNet = checkbox.getChecked());
configBuilder.getLastAddedElement().setTooltip(
Tooltip.of(translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.trust_all_servers_bss_net.tooltip")));
configBuilder.build(() -> config.trySaveToFile(true));
final var config_builder = TConfigPanelBuilder.builder(panel_config);
config_builder.addLabelB(translatable("tcdcommons.client_side")).setTextColor(0xFFFFFF00);
config_builder.addCheckbox(
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.debug_mode"),
BetterStatsConfig.DEBUG_MODE,
checkbox -> BetterStatsConfig.DEBUG_MODE = checkbox.getChecked())
.addCheckbox(
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.gui_mob_follow_cursor"),
config.guiMobsFollowCursor,
checkbox -> config.guiMobsFollowCursor = checkbox.getChecked())
.addCheckbox(
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.trust_all_servers_bss_net"),
config.trustAllServersBssNet,
checkbox -> config.trustAllServersBssNet = checkbox.getChecked());
config_builder.getLastAddedElement().setTooltip(
Tooltip.of(translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.trust_all_servers_bss_net.tooltip")));
config_builder.addLabelB(translatable("tcdcommons.server_side")).setTextColor(0xFFFFFF00);
config_builder.addCheckbox(
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.register_commands"),
config.registerCommands,
checkbox -> config.registerCommands = checkbox.getChecked())
.addCheckbox(
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.enable_sas"),
config.enableServerSAS,
checkbox -> config.enableServerSAS = checkbox.getChecked())
.build(() -> config.trySaveToFile(true));

final var btn_actionCancel = new TButtonWidget(
5, 5, (panelW / 2) - 7, 20,
Expand All @@ -123,7 +133,7 @@ public BetterStatsConfigScreen(@Nullable Screen parent)
panel_action.getEndX() - btn_actionCancel.getWidth() - 5, panel_action.getY() + 5,
btn_actionCancel.getWidth(), 20,
translatable("gui.done"),
__ -> { configBuilder.saveChanges(); close(); });
__ -> { config_builder.saveChanges(); close(); });
panel_action.addChild(btn_actionCancel, true);
panel_action.addChild(btn_actionDone, false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ public final class BSConfigTab extends StatsTab

//init config gui
final var config = BetterStats.getInstance().getConfig();
this.config_builder = TConfigPanelBuilder.builder(panel)
.addCheckbox(
this.config_builder = TConfigPanelBuilder.builder(panel);
this.config_builder.addLabelB(translatable("tcdcommons.client_side")).setTextColor(0xFFFFFF00);
this.config_builder.addCheckbox(
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.debug_mode"),
BetterStatsConfig.DEBUG_MODE,
checkbox -> BetterStatsConfig.DEBUG_MODE = checkbox.getChecked())
Expand All @@ -46,7 +47,16 @@ public final class BSConfigTab extends StatsTab
checkbox -> config.trustAllServersBssNet = checkbox.getChecked());
this.config_builder.getLastAddedElement().setTooltip(
Tooltip.of(translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.trust_all_servers_bss_net.tooltip")));
this.config_builder.build(() -> config.trySaveToFile(true));
this.config_builder.addLabelB(translatable("tcdcommons.server_side")).setTextColor(0xFFFFFF00);
this.config_builder.addCheckbox(
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.register_commands"),
config.registerCommands,
checkbox -> config.registerCommands = checkbox.getChecked())
.addCheckbox(
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.enable_sas"),
config.enableServerSAS,
checkbox -> config.enableServerSAS = checkbox.getChecked())
.build(() -> config.trySaveToFile(true));
}
// --------------------------------------------------
public final @Override void initFilters(FiltersInitContext initContext)
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
"betterstats.api.client.gui.screen.betterstatsconfigscreen.gui_mob_follow_cursor": "GUI mobs follow cursor",
"betterstats.api.client.gui.screen.betterstatsconfigscreen.trust_all_servers_bss_net": "Auto-toggle 'betterstats' network",
"betterstats.api.client.gui.screen.betterstatsconfigscreen.trust_all_servers_bss_net.tooltip": "When this mod is installed on a server, it offers more features. The 'betterstats' network protocol is how a 'betterstats' server communicates with the 'betterstats' client. With this enabled, the client will automatically tell the server it has 'betterstats' installed when applicable. With this disabled, you will have do it manually yourself each time you join a server.",
"betterstats.api.client.gui.screen.betterstatsconfigscreen.register_commands": "Register commands",
"betterstats.api.client.gui.screen.betterstatsconfigscreen.enable_sas": "Enable stat announcement system",

"betterstats.api.client.registry.bsclientplayerbadges.dedication.title": "Dedication",
"betterstats.api.client.registry.bsclientplayerbadges.dedication.description": "You've shown true dedication! You have played on this world for at least 12 days (288 hours).",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,32 @@ public BetterStatsConfigScreen(@Nullable Screen parent)
panel.addChild(panel_action, false);

final var config = BetterStats.getInstance().getConfig();
final var configBuilder = TConfigPanelBuilder.builder(panel_config)
.addCheckbox(
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.debug_mode"),
BetterStatsConfig.DEBUG_MODE,
checkbox -> BetterStatsConfig.DEBUG_MODE = checkbox.getChecked())
.addCheckbox(
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.gui_mob_follow_cursor"),
config.guiMobsFollowCursor,
checkbox -> config.guiMobsFollowCursor = checkbox.getChecked())
.addCheckbox(
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.trust_all_servers_bss_net"),
config.trustAllServersBssNet,
checkbox -> config.trustAllServersBssNet = checkbox.getChecked());
configBuilder.getLastAddedElement().setTooltip(
Tooltip.of(translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.trust_all_servers_bss_net.tooltip")));
configBuilder.build(() -> config.trySaveToFile(true));
final var config_builder = TConfigPanelBuilder.builder(panel_config);
config_builder.addLabelB(translatable("tcdcommons.client_side")).setTextColor(0xFFFFFF00);
config_builder.addCheckbox(
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.debug_mode"),
BetterStatsConfig.DEBUG_MODE,
checkbox -> BetterStatsConfig.DEBUG_MODE = checkbox.getChecked())
.addCheckbox(
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.gui_mob_follow_cursor"),
config.guiMobsFollowCursor,
checkbox -> config.guiMobsFollowCursor = checkbox.getChecked())
.addCheckbox(
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.trust_all_servers_bss_net"),
config.trustAllServersBssNet,
checkbox -> config.trustAllServersBssNet = checkbox.getChecked());
config_builder.getLastAddedElement().setTooltip(
Tooltip.of(translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.trust_all_servers_bss_net.tooltip")));
config_builder.addLabelB(translatable("tcdcommons.server_side")).setTextColor(0xFFFFFF00);
config_builder.addCheckbox(
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.register_commands"),
config.registerCommands,
checkbox -> config.registerCommands = checkbox.getChecked())
.addCheckbox(
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.enable_sas"),
config.enableServerSAS,
checkbox -> config.enableServerSAS = checkbox.getChecked())
.build(() -> config.trySaveToFile(true));

final var btn_actionCancel = new TButtonWidget(
5, 5, (panelW / 2) - 7, 20,
Expand All @@ -123,7 +133,7 @@ public BetterStatsConfigScreen(@Nullable Screen parent)
panel_action.getEndX() - btn_actionCancel.getWidth() - 5, panel_action.getY() + 5,
btn_actionCancel.getWidth(), 20,
translatable("gui.done"),
__ -> { configBuilder.saveChanges(); close(); });
__ -> { config_builder.saveChanges(); close(); });
panel_action.addChild(btn_actionCancel, true);
panel_action.addChild(btn_actionDone, false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ public final class BSConfigTab extends StatsTab

//init config gui
final var config = BetterStats.getInstance().getConfig();
this.config_builder = TConfigPanelBuilder.builder(panel)
.addCheckbox(
this.config_builder = TConfigPanelBuilder.builder(panel);
this.config_builder.addLabelB(translatable("tcdcommons.client_side")).setTextColor(0xFFFFFF00);
this.config_builder.addCheckbox(
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.debug_mode"),
BetterStatsConfig.DEBUG_MODE,
checkbox -> BetterStatsConfig.DEBUG_MODE = checkbox.getChecked())
Expand All @@ -46,7 +47,16 @@ public final class BSConfigTab extends StatsTab
checkbox -> config.trustAllServersBssNet = checkbox.getChecked());
this.config_builder.getLastAddedElement().setTooltip(
Tooltip.of(translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.trust_all_servers_bss_net.tooltip")));
this.config_builder.build(() -> config.trySaveToFile(true));
this.config_builder.addLabelB(translatable("tcdcommons.server_side")).setTextColor(0xFFFFFF00);
this.config_builder.addCheckbox(
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.register_commands"),
config.registerCommands,
checkbox -> config.registerCommands = checkbox.getChecked())
.addCheckbox(
translatable("betterstats.api.client.gui.screen.betterstatsconfigscreen.enable_sas"),
config.enableServerSAS,
checkbox -> config.enableServerSAS = checkbox.getChecked())
.build(() -> config.trySaveToFile(true));
}
// --------------------------------------------------
public final @Override void initFilters(FiltersInitContext initContext)
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
"betterstats.api.client.gui.screen.betterstatsconfigscreen.gui_mob_follow_cursor": "GUI mobs follow cursor",
"betterstats.api.client.gui.screen.betterstatsconfigscreen.trust_all_servers_bss_net": "Auto-toggle 'betterstats' network",
"betterstats.api.client.gui.screen.betterstatsconfigscreen.trust_all_servers_bss_net.tooltip": "When this mod is installed on a server, it offers more features. The 'betterstats' network protocol is how a 'betterstats' server communicates with the 'betterstats' client. With this enabled, the client will automatically tell the server it has 'betterstats' installed when applicable. With this disabled, you will have do it manually yourself each time you join a server.",
"betterstats.api.client.gui.screen.betterstatsconfigscreen.register_commands": "Register commands",
"betterstats.api.client.gui.screen.betterstatsconfigscreen.enable_sas": "Enable stat announcement system",

"betterstats.api.client.registry.bsclientplayerbadges.dedication.title": "Dedication",
"betterstats.api.client.registry.bsclientplayerbadges.dedication.description": "You've shown true dedication! You have played on this world for at least 12 days (288 hours).",
Expand Down

0 comments on commit 0287570

Please sign in to comment.