From c44a09fe57cb8388fc1c44a4cdc6a97defe88923 Mon Sep 17 00:00:00 2001 From: songreaver <87545636+Kemmisch@users.noreply.github.com> Date: Fri, 30 May 2025 00:41:35 +0100 Subject: [PATCH 1/8] Update apiTools.kt move color into enum there a better way to do this? --- .../kotlin/gg/skytils/skytilsmod/utils/apiTools.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/kotlin/gg/skytils/skytilsmod/utils/apiTools.kt b/src/main/kotlin/gg/skytils/skytilsmod/utils/apiTools.kt index 4f170a624..6601e64e3 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/utils/apiTools.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/utils/apiTools.kt @@ -21,6 +21,7 @@ package gg.skytils.skytilsmod.utils import gg.skytils.hypixel.types.player.Player import gg.skytils.hypixel.types.skyblock.Profile import gg.skytils.hypixel.types.util.Inventory +import gg.skytils.skytilsmod.features.impl.dungeons.catlas.core.CatlasConfig import kotlinx.serialization.KSerializer import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @@ -61,6 +62,15 @@ enum class DungeonClass { val className = name.toTitleCase() val apiName = name.lowercase() + val color: Color + get() = when (this) { + ARCHER -> CatlasConfig.colorPlayerArcher + BERSERK -> CatlasConfig.colorPlayerBerserk + HEALER -> CatlasConfig.colorPlayerHealer + MAGE -> CatlasConfig.colorPlayerMage + TANK -> CatlasConfig.colorPlayerTank + else -> Color.BLACK + } override fun toString(): String { return this.className From 62f87d38e36d1329a284bf1454bd1c36f9af9dc3 Mon Sep 17 00:00:00 2001 From: songreaver <87545636+Kemmisch@users.noreply.github.com> Date: Fri, 30 May 2025 00:42:00 +0100 Subject: [PATCH 2/8] Update RenderUtils.kt update for colors --- .../features/impl/dungeons/catlas/utils/RenderUtils.kt | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/utils/RenderUtils.kt b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/utils/RenderUtils.kt index 0f87b9ca3..c213dfdfa 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/utils/RenderUtils.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/utils/RenderUtils.kt @@ -175,14 +175,7 @@ object RenderUtils { GlStateManager.rotate(-180f, 0f, 0f, 1f) } else { // Render box behind the player head - val borderColor = when (player.teammate.dungeonClass) { - DungeonClass.ARCHER -> CatlasConfig.colorPlayerArcher - DungeonClass.BERSERK -> CatlasConfig.colorPlayerBerserk - DungeonClass.HEALER -> CatlasConfig.colorPlayerHealer - DungeonClass.MAGE -> CatlasConfig.colorPlayerMage - DungeonClass.TANK -> CatlasConfig.colorPlayerTank - else -> Color.BLACK - } + val borderColor = player.teammate.dungeonClass.color renderRect(-6.0, -6.0, 12.0, 12.0, borderColor) GlStateManager.translate(0f, 0f, 0.1f) From 99194d36722b975c298f90af664c0cc0204717ad Mon Sep 17 00:00:00 2001 From: songreaver <87545636+Kemmisch@users.noreply.github.com> Date: Fri, 30 May 2025 00:42:59 +0100 Subject: [PATCH 3/8] meaningful default colors why is all black the default anyways open to suggestions on colors todo: rename to something other than "border color" --- .../features/impl/dungeons/catlas/core/CatlasConfig.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/core/CatlasConfig.kt b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/core/CatlasConfig.kt index cdb9fad46..e0de17991 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/core/CatlasConfig.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/core/CatlasConfig.kt @@ -413,7 +413,7 @@ object CatlasConfig : Vigilant( i18nCategory = "catlas.config.colors", i18nSubcategory = "catlas.config.colors.players" ) - var colorPlayerArcher = Color(0, 0, 0, 255) + var colorPlayerArcher = Color(247 ,156 ,165 , 255) @Property( name = "Player Border Color (Berserk)", @@ -425,7 +425,7 @@ object CatlasConfig : Vigilant( i18nCategory = "catlas.config.colors", i18nSubcategory = "catlas.config.colors.players" ) - var colorPlayerBerserk = Color(0, 0, 0, 255) + var colorPlayerBerserk = Color(245, 184, 127, 255) @Property( name = "Player Border Color (Healer)", @@ -437,7 +437,7 @@ object CatlasConfig : Vigilant( i18nCategory = "catlas.config.colors", i18nSubcategory = "catlas.config.colors.players" ) - var colorPlayerHealer = Color(0, 0, 0, 255) + var colorPlayerHealer = Color(207, 158, 240, 255) @Property( name = "Player Border Color (Mage)", @@ -449,7 +449,7 @@ object CatlasConfig : Vigilant( i18nCategory = "catlas.config.colors", i18nSubcategory = "catlas.config.colors.players" ) - var colorPlayerMage = Color(0, 0, 0, 255) + var colorPlayerMage = Color(148, 193, 242, 255) @Property( name = "Player Border Color (Tank)", @@ -461,7 +461,7 @@ object CatlasConfig : Vigilant( i18nCategory = "catlas.config.colors", i18nSubcategory = "catlas.config.colors.players" ) - var colorPlayerTank = Color(0, 0, 0, 255) + var colorPlayerTank = Color(148, 242, 151, 255) @Property( name = "Blood Room", From 0ca1032f6308d134d22247b105ba3de691de89dd Mon Sep 17 00:00:00 2001 From: songreaver <87545636+Kemmisch@users.noreply.github.com> Date: Fri, 30 May 2025 00:43:13 +0100 Subject: [PATCH 4/8] new config options --- .../impl/dungeons/catlas/core/CatlasConfig.kt | 24 +++++++++++++++++++ .../resources/assets/catlas/lang/en_US.lang | 2 ++ 2 files changed, 26 insertions(+) diff --git a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/core/CatlasConfig.kt b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/core/CatlasConfig.kt index e0de17991..7a897c45e 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/core/CatlasConfig.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/core/CatlasConfig.kt @@ -126,6 +126,30 @@ object CatlasConfig : Vigilant( ) var mapVanillaMarker = false + @Property( + name = "Show Class Name Instead of Player Names", + type = PropertyType.SWITCH, + description = "Show the class name under player heads instead of the player name", + category = "Map", + subcategory = "Toggle", + i18nName = "catlas.config.map.toggle.player_class_name", + i18nCategory = "catlas.config.map", + i18nSubcategory = "catlas.config.map.toggle" + ) + var useClassForPlayerNames = false + + @Property( + name = "Color Player Names By Class", + type = PropertyType.SWITCH, + description = "Colors player names according to their class", + category = "Map", + subcategory = "Toggle", + i18nName = "catlas.config.map.toggle.name_class_color", + i18nCategory = "catlas.config.map", + i18nSubcategory = "catlas.config.map.toggle" + ) + var colorPlayerNames = false + @Property( name = "Map Text Scale", type = PropertyType.DECIMAL_SLIDER, diff --git a/src/main/resources/assets/catlas/lang/en_US.lang b/src/main/resources/assets/catlas/lang/en_US.lang index b9c7bfd2b..15b7eb622 100644 --- a/src/main/resources/assets/catlas/lang/en_US.lang +++ b/src/main/resources/assets/catlas/lang/en_US.lang @@ -6,6 +6,8 @@ catlas.config.map.toggle.hide_in_boss=Hide In Boss catlas.config.map.toggle.show_before_start=Show Before Start catlas.config.map.toggle.show_player_names=Show Player Names catlas.config.map.toggle.vanilla_head_marker=Vanilla Head Marker +catlas.config.map.toggle.player_class_name=Show Class Name Instead of Player Names +catlas.config.map.toggle.name_class_color=Color Player Names By Class catlas.config.map.size.map_text_scale=Map Text Scale catlas.config.map.size.player_heads_scale=Player Heads Scale catlas.config.map.size.head_border_scale=Head Border Scale From 6709bb6b6f56b265fced9a3959f35aa4d0cb0caa Mon Sep 17 00:00:00 2001 From: songreaver <87545636+Kemmisch@users.noreply.github.com> Date: Fri, 30 May 2025 00:43:36 +0100 Subject: [PATCH 5/8] changed name rendering --- .../features/impl/dungeons/catlas/utils/RenderUtils.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/utils/RenderUtils.kt b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/utils/RenderUtils.kt index c213dfdfa..8b222b837 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/utils/RenderUtils.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/utils/RenderUtils.kt @@ -210,7 +210,11 @@ object RenderUtils { GlStateManager.translate(0f, 10f, 0f) GlStateManager.scale(CatlasConfig.playerNameScale, CatlasConfig.playerNameScale, 1f) mc.fontRendererObj.drawString( - name, -mc.fontRendererObj.getStringWidth(name) / 2f, 0f, 0xffffff, true + if (!CatlasConfig.useClassForPlayerNames) name else player.teammate.dungeonClass.className, + -mc.fontRendererObj.getStringWidth(if (!CatlasConfig.useClassForPlayerNames) name else player.teammate.dungeonClass.className) / 2f, + 0f, + if (CatlasConfig.colorPlayerNames) player.teammate.dungeonClass.color.rgb else 0xffffff, + true ) } GlStateManager.popMatrix() From 89713dd9712e46a4c39b2f5187f933b2ec6ea134 Mon Sep 17 00:00:00 2001 From: songreaver <87545636+Kemmisch@users.noreply.github.com> Date: Fri, 30 May 2025 00:49:39 +0100 Subject: [PATCH 6/8] fix commas i blame intellij Signed-off-by: songreaver <87545636+Kemmisch@users.noreply.github.com> --- .../features/impl/dungeons/catlas/core/CatlasConfig.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/core/CatlasConfig.kt b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/core/CatlasConfig.kt index 7a897c45e..a45330f53 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/core/CatlasConfig.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/core/CatlasConfig.kt @@ -437,7 +437,7 @@ object CatlasConfig : Vigilant( i18nCategory = "catlas.config.colors", i18nSubcategory = "catlas.config.colors.players" ) - var colorPlayerArcher = Color(247 ,156 ,165 , 255) + var colorPlayerArcher = Color(247, 156, 165, 255) @Property( name = "Player Border Color (Berserk)", From 49106bf4ccbad418764fc41b17da2a48d17a0951 Mon Sep 17 00:00:00 2001 From: songreaver <87545636+Kemmisch@users.noreply.github.com> Date: Mon, 2 Jun 2025 20:33:41 +0100 Subject: [PATCH 7/8] Update RenderUtils.kt extract name from function call Signed-off-by: songreaver <87545636+Kemmisch@users.noreply.github.com> --- .../features/impl/dungeons/catlas/utils/RenderUtils.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/utils/RenderUtils.kt b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/utils/RenderUtils.kt index 8b222b837..7945222fc 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/utils/RenderUtils.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/utils/RenderUtils.kt @@ -209,9 +209,10 @@ object RenderUtils { } GlStateManager.translate(0f, 10f, 0f) GlStateManager.scale(CatlasConfig.playerNameScale, CatlasConfig.playerNameScale, 1f) + val renderName = if (!CatlasConfig.useClassForPlayerNames) name else player.teammate.dungeonClass.className mc.fontRendererObj.drawString( - if (!CatlasConfig.useClassForPlayerNames) name else player.teammate.dungeonClass.className, - -mc.fontRendererObj.getStringWidth(if (!CatlasConfig.useClassForPlayerNames) name else player.teammate.dungeonClass.className) / 2f, + renderName, + -mc.fontRendererObj.getStringWidth(renderName) / 2f, 0f, if (CatlasConfig.colorPlayerNames) player.teammate.dungeonClass.color.rgb else 0xffffff, true From 6238a2ced4d9f2e1cb655bf5e0d8d75dbfc1da4e Mon Sep 17 00:00:00 2001 From: My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> Date: Mon, 9 Jun 2025 15:47:14 -0400 Subject: [PATCH 8/8] Apply suggestions from code review Signed-off-by: My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> --- .../impl/dungeons/catlas/core/CatlasConfig.kt | 16 ++++++++-------- .../gg/skytils/skytilsmod/utils/apiTools.kt | 14 +++++++------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/core/CatlasConfig.kt b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/core/CatlasConfig.kt index a45330f53..25d06e764 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/core/CatlasConfig.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/core/CatlasConfig.kt @@ -127,14 +127,14 @@ object CatlasConfig : Vigilant( var mapVanillaMarker = false @Property( - name = "Show Class Name Instead of Player Names", - type = PropertyType.SWITCH, - description = "Show the class name under player heads instead of the player name", - category = "Map", - subcategory = "Toggle", - i18nName = "catlas.config.map.toggle.player_class_name", - i18nCategory = "catlas.config.map", - i18nSubcategory = "catlas.config.map.toggle" + name = "Show Class Name Instead of Player Names", + type = PropertyType.SWITCH, + description = "Show the class name under player heads instead of the player name", + category = "Map", + subcategory = "Toggle", + i18nName = "catlas.config.map.toggle.player_class_name", + i18nCategory = "catlas.config.map", + i18nSubcategory = "catlas.config.map.toggle" ) var useClassForPlayerNames = false diff --git a/src/main/kotlin/gg/skytils/skytilsmod/utils/apiTools.kt b/src/main/kotlin/gg/skytils/skytilsmod/utils/apiTools.kt index 6601e64e3..2b025090a 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/utils/apiTools.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/utils/apiTools.kt @@ -64,13 +64,13 @@ enum class DungeonClass { val apiName = name.lowercase() val color: Color get() = when (this) { - ARCHER -> CatlasConfig.colorPlayerArcher - BERSERK -> CatlasConfig.colorPlayerBerserk - HEALER -> CatlasConfig.colorPlayerHealer - MAGE -> CatlasConfig.colorPlayerMage - TANK -> CatlasConfig.colorPlayerTank - else -> Color.BLACK - } + ARCHER -> CatlasConfig.colorPlayerArcher + BERSERK -> CatlasConfig.colorPlayerBerserk + HEALER -> CatlasConfig.colorPlayerHealer + MAGE -> CatlasConfig.colorPlayerMage + TANK -> CatlasConfig.colorPlayerTank + else -> Color.BLACK + } override fun toString(): String { return this.className