From e06802c90642b0717a7b9f6e1a5960be3a37cf1f Mon Sep 17 00:00:00 2001 From: Artemis-the-gr8 Date: Mon, 18 Jul 2022 18:03:23 +0200 Subject: [PATCH] Minor fixes, added config options for enter-usage --- .../gr8/playerstats/config/ConfigHandler.java | 90 ++++++++++--------- .../gr8/playerstats/msg/ComponentFactory.java | 1 + .../gr8/playerstats/msg/MessageWriter.java | 2 + src/main/resources/config.yml | 3 + 4 files changed, 54 insertions(+), 42 deletions(-) diff --git a/src/main/java/com/gmail/artemis/the/gr8/playerstats/config/ConfigHandler.java b/src/main/java/com/gmail/artemis/the/gr8/playerstats/config/ConfigHandler.java index ff4ad31..15f16ec 100644 --- a/src/main/java/com/gmail/artemis/the/gr8/playerstats/config/ConfigHandler.java +++ b/src/main/java/com/gmail/artemis/the/gr8/playerstats/config/ConfigHandler.java @@ -123,6 +123,54 @@ public class ConfigHandler { return config.getBoolean("enable-hover-text", true); } + /** Whether to use festive formatting, such as pride colors. +

Default: true

*/ + public boolean enableFestiveFormatting() { + return config.getBoolean("enable-festive-formatting", true); + } + + /** Whether to use rainbow colors for the [PlayerStats] prefix rather than the default gold/purple. +

Default: false

*/ + public boolean enableRainbowMode() { + return config.getBoolean("rainbow-mode", false); + } + + /** Whether to start each stat-result with a line-break before it. +

Default: true

*/ + public boolean useEnters() { + return config.getBoolean("use-enters", true); + } + + /** Returns the config setting for use-dots. +

Default: true

*/ + public boolean useDots() { + return config.getBoolean("use-dots", true); + } + + /** Returns the config setting for top-list-max-size. +

Default: 10

*/ + public int getTopListMaxSize() { + return config.getInt("top-list-max-size", 10); + } + + /** Returns a String that represents the title for a top statistic. +

Default: "Top"

*/ + public String getTopStatsTitle() { + return config.getString("top-list-title", "Top"); + } + + /** Returns a String that represents the title for a server stat. +

Default: "Total on"

*/ + public String getServerTitle() { + return config.getString("total-server-stat-title", "Total on"); + } + + /** Returns the specified server name for a server stat title. +

Default: "this server"

*/ + public String getServerName() { + return config.getString("your-server-name", "this server"); + } + /** Returns the unit that should be used for distance-related statistics.

Default: Blocks for plain text, km for hover-text

*/ public String getDistanceUnit(boolean isHoverText) { @@ -174,48 +222,6 @@ public class ConfigHandler { return getUnitString(isHoverText, "days", "hours", "biggest-time-unit"); } - /** Whether to use festive formatting, such as pride colors. -

Default: true

*/ - public boolean enableFestiveFormatting() { - return config.getBoolean("enable-festive-formatting", true); - } - - /** Whether to use rainbow colors for the [PlayerStats] prefix rather than the default gold/purple. -

Default: false

*/ - public boolean enableRainbowMode() { - return config.getBoolean("rainbow-mode", false); - } - - /** Returns the config setting for use-dots. -

Default: true

*/ - public boolean useDots() { - return config.getBoolean("use-dots", true); - } - - /** Returns the config setting for top-list-max-size. -

Default: 10

*/ - public int getTopListMaxSize() { - return config.getInt("top-list-max-size", 10); - } - - /** Returns a String that represents the title for a top statistic. -

Default: "Top"

*/ - public String getTopStatsTitle() { - return config.getString("top-list-title", "Top"); - } - - /** Returns a String that represents the title for a server stat. -

Default: "Total on"

*/ - public String getServerTitle() { - return config.getString("total-server-stat-title", "Total on"); - } - - /** Returns the specified server name for a server stat title. -

Default: "this server"

*/ - public String getServerName() { - return config.getString("your-server-name", "this server"); - } - /** Returns an integer between 0 and 100 that represents how much lighter a hoverColor should be. So 20 would mean 20% lighter.

Default: 20

*/ diff --git a/src/main/java/com/gmail/artemis/the/gr8/playerstats/msg/ComponentFactory.java b/src/main/java/com/gmail/artemis/the/gr8/playerstats/msg/ComponentFactory.java index 62cde03..44ef554 100644 --- a/src/main/java/com/gmail/artemis/the/gr8/playerstats/msg/ComponentFactory.java +++ b/src/main/java/com/gmail/artemis/the/gr8/playerstats/msg/ComponentFactory.java @@ -65,6 +65,7 @@ public class ComponentFactory { HOVER_ACCENT = PluginColor.LIGHT_GOLD.getColor(); } + //TODO try the share-purple for sharer-names public TextColor getSharerNameColor() { return PluginColor.NAME_5.getColor(); } diff --git a/src/main/java/com/gmail/artemis/the/gr8/playerstats/msg/MessageWriter.java b/src/main/java/com/gmail/artemis/the/gr8/playerstats/msg/MessageWriter.java index 0759c2c..f519bcb 100644 --- a/src/main/java/com/gmail/artemis/the/gr8/playerstats/msg/MessageWriter.java +++ b/src/main/java/com/gmail/artemis/the/gr8/playerstats/msg/MessageWriter.java @@ -190,6 +190,7 @@ public class MessageWriter { TextComponent shortTitle = getTopStatsTitleShort(request, topStats.size()); TextComponent list = getTopStatList(topStats, request); + //TODO make use-enters configurable return (shareCode, sender) -> { TextComponent.Builder topBuilder = text().append(newline()); @@ -225,6 +226,7 @@ public class MessageWriter { return (shareCode, sender) -> { TextComponent.Builder statBuilder = text().append(newline()); + //TODO make use-enters configurable //if we're adding a share-button if (shareCode != null) { statBuilder.append(statResult) diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index d5e9099..26ac7fa 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -51,6 +51,9 @@ enable-festive-formatting: true # Always use rainbow for the [PlayerStats] prefix instead of the default gold/purple rainbow-mode: false +# Start each stat-result with a line-break before it +use-enters: true + # Align the stat-numbers in the top list with dots use-dots: true