From b4648fe70ce0538325ed6df3ad068e9fe9237c0c Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 14 Oct 2023 16:18:03 +0200 Subject: Fixed bug that faction icons in crimson isle are always hidden. Added option to Advanced Player List to hide Crimson Isle faction icons. --- .../skyhanni/config/features/MiscConfig.java | 5 +++++ .../misc/compacttablist/AdvancedPlayerList.kt | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) (limited to 'src/main/java') diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java index 5cd9d1611..081716f3f 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java @@ -632,6 +632,11 @@ public class MiscConfig { @ConfigEditorBoolean public boolean showBingoRankNumber = false; + @Expose + @ConfigOption(name = "Hide Factions", desc = "Hide the icon of the Crimson Isle Faction in the tab list.") + @ConfigEditorBoolean + public boolean hideFactions = false; + @Expose @ConfigOption(name = "Mark Special Persons", desc = "Show speical icons behind the name of guild members, party members, friends, and marked players.") @ConfigEditorBoolean diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/AdvancedPlayerList.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/AdvancedPlayerList.kt index 33bd8c6d4..04107c7e2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/AdvancedPlayerList.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/AdvancedPlayerList.kt @@ -4,11 +4,13 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.BingoAPI import at.hannibal2.skyhanni.data.FriendAPI import at.hannibal2.skyhanni.data.GuildAPI +import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.PartyAPI import at.hannibal2.skyhanni.features.misc.MarkedPlayerManager import at.hannibal2.skyhanni.test.SkyHanniDebugsAndTests import at.hannibal2.skyhanni.utils.KeyboardManager import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.removeColor import com.google.common.cache.CacheBuilder @@ -67,6 +69,15 @@ object AdvancedPlayerList { } else { playerData.bingoLevel = BingoAPI.getRank(line) } + if (IslandType.CRIMSON_ISLE.isInIsland()) { + playerData.faction = if (line.contains("§c⚒")) { + CrimsonIsleFaction.BARBARIAN + } else if (line.contains("§5ቾ")) { + CrimsonIsleFaction.MAGE + } else { + CrimsonIsleFaction.NONE + } + } } else { playerData.nameSuffix = "" } @@ -150,6 +161,10 @@ object AdvancedPlayerList { suffix += " §c:O" } + if (IslandType.CRIMSON_ISLE.isInIsland() && !config.hideFactions) { + suffix += data.faction.icon + } + return "$level $playerName ${suffix.trim()}" } @@ -203,5 +218,12 @@ object AdvancedPlayerList { var levelText: String = "?" var ironman: Boolean = false var bingoLevel: Int? = null + var faction: CrimsonIsleFaction = CrimsonIsleFaction.NONE + } + + enum class CrimsonIsleFaction(val icon: String) { + BARBARIAN(" §c⚒"), + MAGE(" §5ቾ"), + NONE("") } } \ No newline at end of file -- cgit