Skip to content

Commit

Permalink
Added a startup title (ping #110, #27).
Browse files Browse the repository at this point in the history
* NEW: added a /title displayed when the game starts (enabled by default).
  • Loading branch information
AmauryCarrade committed Jan 11, 2016
1 parent 72d6d1c commit 21c882d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import eu.carrade.amaury.UHCReloaded.misc.RuntimeCommandsExecutor;
import eu.carrade.amaury.UHCReloaded.teams.UHTeam;
import eu.carrade.amaury.UHCReloaded.utils.UHSound;
import fr.zcraft.zlib.tools.text.Titles;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
Expand Down Expand Up @@ -701,6 +702,12 @@ public void onGameStarts(UHGameStartsEvent ev)
// Broadcast
Bukkit.getServer().broadcastMessage(i.t("start.go"));

// Title
if (p.getConfig().getBoolean("start.displayTitle"))
{
Titles.broadcastTitle(5, 40, 8, i.t("start.title.title"), i.t("start.title.subtitle"));
}

// Commands
p.getRuntimeCommandsExecutor().registerCommandsInScheduler(RuntimeCommandsExecutor.AFTER_GAME_START);

Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ start:
volume: 1
pitch: 1

# Display a title to everyone when the game begins
displayTitle: true



death:
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/i18n/en_US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ keys:
startSlowAllTeamsTPCmd: "{gray}Use {cc}/uh start slow go{gray} to start the game."

go: "{green}--- GO ---"
title:
title: "{darkgreen}Let's go!"
subtitle: "{green}Good luck, and have fun"

finish:
notStarted: "{ce}The game is not started!"
Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/i18n/fr_FR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ keys:
teleportationInProgress: "{lightpurple}Téléportation en cours... Merci de patienter."
teleportationInProgressInActionBar: "{lightpurple}Téléportation... {gray}({0}/{1})"
teleportationFinishedInActionBar: "{lightpurple}Téléportation terminée. {gray}Ça ne devrait pas tarder..."


startSlowBeforeStartSlowGo: "{ce}Veuillez exécuter {cc}/uh start slow{ce} avant."
startSlowWaitBeforeGo: "{ce}Veuillez patienter, les équipes sont en train d'être téléportées."
Expand All @@ -169,6 +168,9 @@ keys:
startSlowAllTeamsTPCmd: "{gray}Utilisez {cc}/uh start slow go{gray} pour démarrer le jeu."

go: "{green}--- GO ---"
title:
title: "{darkgreen}C'est parti !"
subtitle: "{green}Bonne chance et bon jeu à tous"

finish:
notStarted: "{ce}Le jeu n'est pas encore démarré !"
Expand Down

0 comments on commit 21c882d

Please sign in to comment.