diff options
author | J10a1n15 <45315647+j10a1n15@users.noreply.github.com> | 2024-03-12 19:59:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-12 19:59:55 +0100 |
commit | 4352ffb08d4bfffc06adad2a068f375ab9874333 (patch) | |
tree | b8ce745fca8ab82ffa04f6ab87334139a6b7192b /src/main/java/at/hannibal2/skyhanni/mixins/hooks | |
parent | eb863d60e82b5541a9f42d2608f61cb97ada209b (diff) | |
download | skyhanni-4352ffb08d4bfffc06adad2a068f375ab9874333.tar.gz skyhanni-4352ffb08d4bfffc06adad2a068f375ab9874333.tar.bz2 skyhanni-4352ffb08d4bfffc06adad2a068f375ab9874333.zip |
Feature: CustomScoreboard (#893)
Co-authored-by: Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com>
Co-authored-by: Thunderblade73 <gaidermarkus@gmail.com>
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/mixins/hooks')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt index 9d1e7ab87..0bf44d0a0 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt +++ b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiIngameHook.kt @@ -15,11 +15,16 @@ fun drawString( x: Int, y: Int, color: Int, -) = replaceString(text)?.let { +) = tryToReplaceScoreboardLine(text)?.let { instance.drawString(it, x, y, color) } ?: 0 -private fun replaceString(text: String): String? { +/** + * Tries to replace a scoreboard line with a modified one + * @param text The line to check and possibly replace + * @return The replaced line, or null if it should be hidden + */ +fun tryToReplaceScoreboardLine(text: String): String? { if (SkyHanniMod.feature.misc.hideScoreboardNumbers && text.startsWith("§c") && text.length <= 4) { return null } |