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:
@@ -226,8 +226,10 @@ class GameManager(
|
|||||||
player.sendMsg( "game.invincibility-start", "time" to invincibilityTime.toString() )
|
player.sendMsg( "game.invincibility-start", "time" to invincibilityTime.toString() )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val variantName = plugin.config.getString( "lunarclient.variantName" )
|
||||||
|
|
||||||
plugin.discordWebhookManager.broadcastEmbed(
|
plugin.discordWebhookManager.broadcastEmbed(
|
||||||
title = "🎮 Spiel gestartet!",
|
title = "🎮 Spiel gestartet! (${variantName})",
|
||||||
description = "Eine neue Runde SpeedHG mit **${Bukkit.getOnlinePlayers().size}** Spielern hat begonnen!",
|
description = "Eine neue Runde SpeedHG mit **${Bukkit.getOnlinePlayers().size}** Spielern hat begonnen!",
|
||||||
colorHex = 0x55FF55 // Grün
|
colorHex = 0x55FF55 // Grün
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -65,7 +65,10 @@ class ScoreboardManager(
|
|||||||
|
|
||||||
val online = Bukkit.getOnlinePlayers().size.toString()
|
val online = Bukkit.getOnlinePlayers().size.toString()
|
||||||
val max = Bukkit.getMaxPlayers().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 kitName = plugin.kitManager.getSelectedKit( player )?.displayName ?: Component.text( "None" )
|
||||||
|
val styleName = plugin.kitManager.getSelectedPlaystyle( player ).displayName
|
||||||
|
|
||||||
val stats = plugin.statsManager.getCachedStats( player.uniqueId )
|
val stats = plugin.statsManager.getCachedStats( player.uniqueId )
|
||||||
val score = stats?.scrimScore ?: 0
|
val score = stats?.scrimScore ?: 0
|
||||||
@@ -80,7 +83,7 @@ class ScoreboardManager(
|
|||||||
|
|
||||||
lines = plugin.languageManager.getMessageList(
|
lines = plugin.languageManager.getMessageList(
|
||||||
player, "scoreboard.lobby",
|
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 )
|
mapOf( "kit" to kitName, "rank" to rankComponent )
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -93,7 +96,7 @@ class ScoreboardManager(
|
|||||||
|
|
||||||
lines = plugin.languageManager.getMessageList(
|
lines = plugin.languageManager.getMessageList(
|
||||||
player, "scoreboard.ingame",
|
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 )
|
mapOf( "kit" to kitName, "rank" to rankComponent )
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -176,9 +176,11 @@ commands:
|
|||||||
scoreboard:
|
scoreboard:
|
||||||
title: '<gradient:red:gold><bold>SpeedHG</bold></gradient>'
|
title: '<gradient:red:gold><bold>SpeedHG</bold></gradient>'
|
||||||
lobby:
|
lobby:
|
||||||
|
- " <variant>"
|
||||||
- "<gray><st> "
|
- "<gray><st> "
|
||||||
- "Players: <green><online>/<max>"
|
- "Players: <green><online>/<max>"
|
||||||
- "Kit: <yellow><kit>"
|
- "Kit: <yellow><kit>"
|
||||||
|
- "Style: <yellow><style>"
|
||||||
- "Rank: <rank>"
|
- "Rank: <rank>"
|
||||||
- ""
|
- ""
|
||||||
- "<gray>Waiting for start..."
|
- "<gray>Waiting for start..."
|
||||||
|
|||||||
Reference in New Issue
Block a user