From e9bcede973b67f9d8284cf6fa1e6c06b6c1d2c85 Mon Sep 17 00:00:00 2001 From: Amaury Carrade Date: Tue, 12 Jan 2016 01:43:06 +0100 Subject: [PATCH] Added a title when an episode ends. (#110, closes #27) * NEW: when an episode ends, a title is displayed containing the number of the new episode. --- .../carrade/amaury/UHCReloaded/listeners/GameListener.java | 7 +++++++ src/main/resources/config.yml | 3 +++ src/main/resources/i18n/en_US.yml | 6 +++++- src/main/resources/i18n/fr_FR.yml | 3 +++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/carrade/amaury/UHCReloaded/listeners/GameListener.java b/src/main/java/eu/carrade/amaury/UHCReloaded/listeners/GameListener.java index cd5dbc5..f0ce096 100644 --- a/src/main/java/eu/carrade/amaury/UHCReloaded/listeners/GameListener.java +++ b/src/main/java/eu/carrade/amaury/UHCReloaded/listeners/GameListener.java @@ -703,6 +703,13 @@ public void onEpisodeChange(UHEpisodeChangedEvent ev) p.getServer().broadcastMessage(message); + // Broadcasts title + if (p.getConfig().getBoolean("episodes.title")) + { + Titles.broadcastTitle(5, 32, 8, i.t("episodes.title.title", ev.getNewEpisode(), ev.getNewEpisode() - 1), i.t("episodes.title.subtitle", ev.getNewEpisode(), ev.getNewEpisode() - 1)); + } + + // Updates the list headers & footers. p.getPlayerListHeaderFooterManager().updateHeadersFooters(); } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 83eac2b..4807da3 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -29,6 +29,9 @@ episodes: # Don't remove the "quotes" (because of the commas)! length: "20:00" + # A title is displayed when the episode changes. + title: true + map: diff --git a/src/main/resources/i18n/en_US.yml b/src/main/resources/i18n/en_US.yml index 749aa04..5b31d75 100644 --- a/src/main/resources/i18n/en_US.yml +++ b/src/main/resources/i18n/en_US.yml @@ -182,6 +182,7 @@ keys: withTeams: "{darkgreen}{obfuscated}--{green} Congratulations to {0} (team {1}{green}) for their victory! {darkgreen}{obfuscated}--" withoutTeams: "{darkgreen}{obfuscated}--{green} Congratulations to {0} for his victory! {darkgreen}{obfuscated}--" + # In *all* these strings (subtitles included), {0} contains the winner name (team display name of player display name). titles: withTeams: title: "{darkgreen}{0}" @@ -196,7 +197,10 @@ keys: episodes: end: "{aqua}-------- End of episode {0} --------" endForced: "{aqua}-------- End of episode {0} [forced by {1}] --------" - + title: + title: "{darkaqua}Episode {aqua}{0}" # {0} contains the new episode number, {1} the previous one (just ended). + subtitle: "" # Same + scoreboard: episode: "{gray}Episode {white}{0}" players: "{white}{0}{gray} players" diff --git a/src/main/resources/i18n/fr_FR.yml b/src/main/resources/i18n/fr_FR.yml index ce27802..6c664aa 100644 --- a/src/main/resources/i18n/fr_FR.yml +++ b/src/main/resources/i18n/fr_FR.yml @@ -197,6 +197,9 @@ keys: episodes: end: "{aqua}-------- Fin de l'épisode {0} --------" endForced: "{aqua}-------- Fin de l'épisode {0} [forcé par {1}] --------" + title: + title: "{darkaqua}Épisode {aqua}{0}" + subtitle: "" scoreboard: episode: "{gray}Épisode {white}{0}"