Display variant and style in UI and Discord

Include the configured lunarclient.variantName in the game start Discord embed and expose both the lunar variant and the player's selected playstyle on the lobby/ingame scoreboards. Added placeholders to language file for variant and style. Files changed: GameManager.kt, ScoreboardManager.kt, and en_US.yml.
This commit is contained in:
TDSTOS
2026-04-12 20:38:23 +02:00
parent ed9b95ae7a
commit 753aeb6dc1
3 changed files with 10 additions and 3 deletions

View File

@@ -226,8 +226,10 @@ class GameManager(
player.sendMsg( "game.invincibility-start", "time" to invincibilityTime.toString() )
}
val variantName = plugin.config.getString( "lunarclient.variantName" )
plugin.discordWebhookManager.broadcastEmbed(
title = "🎮 Spiel gestartet!",
title = "🎮 Spiel gestartet! (${variantName})",
description = "Eine neue Runde SpeedHG mit **${Bukkit.getOnlinePlayers().size}** Spielern hat begonnen!",
colorHex = 0x55FF55 // Grün
)

View File

@@ -65,7 +65,10 @@ class ScoreboardManager(
val online = Bukkit.getOnlinePlayers().size.toString()
val max = Bukkit.getMaxPlayers().toString()
val variantName = plugin.config.getString( "lunarclient.variantName" ).toString()
val kitName = plugin.kitManager.getSelectedKit( player )?.displayName ?: Component.text( "None" )
val styleName = plugin.kitManager.getSelectedPlaystyle( player ).displayName
val stats = plugin.statsManager.getCachedStats( player.uniqueId )
val score = stats?.scrimScore ?: 0
@@ -80,7 +83,7 @@ class ScoreboardManager(
lines = plugin.languageManager.getMessageList(
player, "scoreboard.lobby",
mapOf( "online" to online, "max" to max, "time" to timeString ),
mapOf( "online" to online, "max" to max, "time" to timeString, "style" to styleName, "variant" to variantName ),
mapOf( "kit" to kitName, "rank" to rankComponent )
)
}
@@ -93,7 +96,7 @@ class ScoreboardManager(
lines = plugin.languageManager.getMessageList(
player, "scoreboard.ingame",
mapOf( "timer" to timeString, "alive" to alive, "kills" to kills, "border" to border ),
mapOf( "timer" to timeString, "alive" to alive, "kills" to kills, "border" to border, "style" to styleName, "variant" to variantName ),
mapOf( "kit" to kitName, "rank" to rankComponent )
)
}

View File

@@ -176,9 +176,11 @@ commands:
scoreboard:
title: '<gradient:red:gold><bold>SpeedHG</bold></gradient>'
lobby:
- " <variant>"
- "<gray><st> "
- "Players: <green><online>/<max>"
- "Kit: <yellow><kit>"
- "Style: <yellow><style>"
- "Rank: <rank>"
- ""
- "<gray>Waiting for start..."