diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-10-07 19:48:57 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-10-07 19:48:57 +0200 |
commit | 9b238c5ae3943c08e2f55286e8822a1a633399b0 (patch) | |
tree | 4b7143b92675421b55a9c1782b987ec6489afe14 /src | |
parent | 83f83be24b98518b9c34581958253ec423277174 (diff) | |
download | skyhanni-9b238c5ae3943c08e2f55286e8822a1a633399b0.tar.gz skyhanni-9b238c5ae3943c08e2f55286e8822a1a633399b0.tar.bz2 skyhanni-9b238c5ae3943c08e2f55286e8822a1a633399b0.zip |
add special icons behind friends or guild members
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java | 5 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/AdvancedPlayerList.kt | 31 |
2 files changed, 30 insertions, 6 deletions
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 51c11c082..fcdc3ef38 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java @@ -606,6 +606,11 @@ public class MiscConfig { @ConfigOption(name = "Bingo Rank Number", desc = "Show the number of the bingo rank next to the icon. Useful if you are not so familar with bingo.") @ConfigEditorBoolean public boolean showBingoRankNumber = false; + + @Expose + @ConfigOption(name = "Mark Special Persons", desc = "Show speical icons behind the name of guild members, party members, friends, and marked players.") + @ConfigEditorBoolean + public boolean markSpecialPersons = false; } } 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 114acae06..030591558 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 @@ -125,11 +125,19 @@ object AdvancedPlayerList { if (config.hideLevelBrackets) data.levelText else "§8[${data.levelText}§8]" } else "" - val suffix = if (config.hideEmblem) { + var suffix = if (config.hideEmblem) { if (data.ironman) "§7♲" else getBingoIcon(data.bingoLevel) } else data.nameSuffix - return "$level $playerName $suffix" + if (config.markSpecialPersons) { + val score = socialScore(data.name) + if (score != 1) { + LorenzUtils.debug(data.name + " score = $score") + } + suffix += " " + getSocialScoreIcon(score) + } + + return "$level $playerName ${suffix.trim()}" } private var randomOrderCache = @@ -146,15 +154,26 @@ object AdvancedPlayerList { } private fun socialScore(name: String) = when { - LorenzUtils.getPlayerName() == name -> 5 - MarkedPlayerManager.isMarkedPlayer(name) -> 4 - PartyAPI.partyMembers.contains(name) -> 3 - FriendAPI.getAllFriends().any { it.name == name } -> 2 + LorenzUtils.getPlayerName() == name -> 10 + MarkedPlayerManager.isMarkedPlayer(name) -> 8 + PartyAPI.partyMembers.contains(name) -> 5 + FriendAPI.getAllFriends().any { it.name.contains(name) } -> 4 // TODO add guild else -> 1 } + private fun getSocialScoreIcon(score: Int) = when (score) { + 10 -> "§cTHIS IS ME" + 8 -> "§eMARKED" + 5 -> "§7§lP" + 4 -> "§9§lF" + 3 -> "§aG" + // TODO add guild + + else -> "" + } + private fun getBingoRank(text: String) = when { text.contains("§7Ⓑ") -> 0 //No Rank text.contains("§aⒷ") -> 1 //Rank 1 |