aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/config
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2024-04-19 11:24:36 +0200
committerGitHub <noreply@github.com>2024-04-19 11:24:36 +0200
commitf8efe9effd27bee18bced64385fc1ad9b05b68bd (patch)
tree1429920226fc79af8bae814bb7596b9e65e0cf7e /src/main/java/at/hannibal2/skyhanni/config
parent7feb5c67fbc1c9f63118952f1bea649ada1dccd6 (diff)
downloadskyhanni-f8efe9effd27bee18bced64385fc1ad9b05b68bd.tar.gz
skyhanni-f8efe9effd27bee18bced64385fc1ad9b05b68bd.tar.bz2
skyhanni-f8efe9effd27bee18bced64385fc1ad9b05b68bd.zip
Feature + Fix: Player Chat Rework (#1483)
Co-authored-by: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/config')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/chat/ChatConfig.java7
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/chat/ChatSymbols.java54
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/chat/PlayerMessagesConfig.java65
4 files changed, 68 insertions, 60 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt b/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt
index 9f0b281ff..1e8a576e2 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt
+++ b/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt
@@ -12,7 +12,7 @@ import com.google.gson.JsonPrimitive
object ConfigUpdaterMigrator {
val logger = LorenzLogger("ConfigMigration")
- const val CONFIG_VERSION = 40
+ const val CONFIG_VERSION = 41
fun JsonElement.at(chain: List<String>, init: Boolean): JsonElement? {
if (chain.isEmpty()) return this
if (this !is JsonObject) return null
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/chat/ChatConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/chat/ChatConfig.java
index 72b21411b..f2d187687 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/chat/ChatConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/chat/ChatConfig.java
@@ -22,20 +22,17 @@ public class ChatConfig {
@Expose
@ConfigOption(name = "Chat Filter Types", desc = "")
@Accordion
+ // TODO move into own sub category
public FilterTypesConfig filterType = new FilterTypesConfig();
@Expose
@ConfigOption(name = "Player Messages", desc = "")
@Accordion
+ // TODO move into own sub category
public PlayerMessagesConfig playerMessage = new PlayerMessagesConfig();
@Expose
- @ConfigOption(name = "Player Chat Symbols", desc = "")
- @Accordion
- public ChatSymbols chatSymbols = new ChatSymbols();
-
- @Expose
@ConfigOption(name = "Dungeon Filter", desc = "Hide specific message types in Dungeons.")
@ConfigEditorDraggableList
public List<DungeonMessageTypes> dungeonFilteredMessageTypes = new ArrayList<>();
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/chat/ChatSymbols.java b/src/main/java/at/hannibal2/skyhanni/config/features/chat/ChatSymbols.java
deleted file mode 100644
index ccead7f7b..000000000
--- a/src/main/java/at/hannibal2/skyhanni/config/features/chat/ChatSymbols.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package at.hannibal2.skyhanni.config.features.chat;
-
-import at.hannibal2.skyhanni.config.FeatureToggle;
-import at.hannibal2.skyhanni.config.HasLegacyId;
-import com.google.gson.annotations.Expose;
-import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean;
-import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDropdown;
-import io.github.notenoughupdates.moulconfig.annotations.ConfigOption;
-
-public class ChatSymbols {
-
- @Expose
- @ConfigOption(name = "Enabled", desc = "Adds extra symbols to the chat such as those from ironman, " +
- "stranded, bingo or nether factions and places them next to your regular player emblems. " +
- "§cDoes not work with hide rank hider!")
- @ConfigEditorBoolean
- @FeatureToggle
- public boolean enabled = true;
-
- @Expose
- @ConfigOption(name = "Chat Symbol Location", desc = "Determines where the symbols should go in chat in relation to the " +
- "player's name. Hidden will hide all emblems from the chat. §eRequires above setting to be on to hide the symbols.")
- @ConfigEditorDropdown
- public SymbolLocationEntry symbolLocation = SymbolLocationEntry.LEFT;
-
- public enum SymbolLocationEntry implements HasLegacyId {
- LEFT("Left", 0),
- RIGHT("Right", 1),
- HIDDEN("Hidden", 2);
-
- private final String str;
- private final int legacyId;
-
- SymbolLocationEntry(String str, int legacyId) {
- this.str = str;
- this.legacyId = legacyId;
- }
-
- // Constructor if new enum elements are added post-migration
- SymbolLocationEntry(String str) {
- this(str, -1);
- }
-
- @Override
- public int getLegacyId() {
- return legacyId;
- }
-
- @Override
- public String toString() {
- return str;
- }
- }
-}
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/chat/PlayerMessagesConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/chat/PlayerMessagesConfig.java
index 5ebad3d0c..a8903f4f1 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/chat/PlayerMessagesConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/chat/PlayerMessagesConfig.java
@@ -3,19 +3,84 @@ package at.hannibal2.skyhanni.config.features.chat;
import at.hannibal2.skyhanni.config.FeatureToggle;
import com.google.gson.annotations.Expose;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean;
+import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDraggableList;
import io.github.notenoughupdates.moulconfig.annotations.ConfigOption;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
public class PlayerMessagesConfig {
@Expose
+ @ConfigOption(
+ name = "Part Order",
+ desc = "Drag text to change the chat message format order for chat messages."
+ )
+ @ConfigEditorDraggableList
+ public List<MessagePart> partsOrder = new ArrayList<>(Arrays.asList(
+ MessagePart.SKYBLOCK_LEVEL,
+ MessagePart.PRIVATE_ISLAND_RANK,
+ MessagePart.PRIVATE_ISLAND_GUEST,
+ MessagePart.PLAYER_NAME,
+ MessagePart.GUILD_RANK,
+ MessagePart.EMBLEM
+ ));
+
+ public enum MessagePart {
+ SKYBLOCK_LEVEL("SkyBlock Level"),
+ EMBLEM("Emblem"),
+ PLAYER_NAME("§bPlayer Name"),
+ GUILD_RANK("Guild Rank"),
+ PRIVATE_ISLAND_RANK("Private Island Rank"),
+ PRIVATE_ISLAND_GUEST("Private Island Guest"),
+ CRIMSON_FACTION("Crimson Faction"),
+ MODE_IRONMAN("Ironman Mode"),
+ BINGO_LEVEL("Bingo Level"),
+ ;
+
+ private final String str;
+
+ MessagePart(String str) {
+ this.str = str;
+ }
+
+ @Override
+ public String toString() {
+ return str;
+ }
+ }
+
+ @Expose
+ @ConfigOption(name = "Hide Level Brackets", desc = "Hide the gray brackets in front of and behind the level numbers.")
+ @ConfigEditorBoolean
+ public boolean hideLevelBrackets = false;
+
+ @Expose
+ @ConfigOption(name = "Level Color As Name", desc = "Use the color of the SkyBlock level for the player color.")
+ @ConfigEditorBoolean
+ public boolean useLevelColorForName = false;
+
+ @Expose
@ConfigOption(name = "Player Rank Hider", desc = "Hide player ranks in all chat messages.")
@ConfigEditorBoolean
@FeatureToggle
public boolean playerRankHider = false;
@Expose
+ @ConfigOption(name = "Ignore YouTube", desc = "Do not remove the rank for YouTubers in chat.")
+ @ConfigEditorBoolean
+ public boolean ignoreYouTube = false;
+
+ @Expose
@ConfigOption(name = "Chat Filter", desc = "Scan messages sent by players for blacklisted words and gray out the message if any are found.")
@ConfigEditorBoolean
@FeatureToggle
public boolean chatFilter = false;
+
+ @Expose
+ @ConfigOption(name = "Same Chat Color", desc = "All players, also those with ranks, write with the same, white chat color.")
+ @ConfigEditorBoolean
+ @FeatureToggle
+ public boolean sameChatColor = true;
}