Enchance rotation commands a bit

This commit is contained in:
javipepe 2017-03-26 19:49:14 +02:00
parent 345b6cde42
commit 5ebcc760c9
No known key found for this signature in database
GPG Key ID: 77BDDB7AF7107706
2 changed files with 6 additions and 3 deletions

View File

@ -215,7 +215,7 @@ public class MapCommands {
final RotationState rotation = CommandUtils.getRotation(args.getFlag('n'), sender);
int page = args.getInteger(0, 1);
new PrettyPaginatedResult<PGMMap>(PGMTranslations.get().t("command.map.currentRotation.title", sender)) {
new PrettyPaginatedResult<PGMMap>(PGMTranslations.get().t("command.map.currentRotation.title", sender) + "(" + ChatColor.DARK_AQUA + PGM.getMatchManager().getRotationManager().getCurrentRotationName() + ChatColor.RESET + ")") {
@Override public String format(PGMMap map, int index) {
ChatColor color = index == rotation.getNextId() ? ChatColor.DARK_AQUA : ChatColor.WHITE;
return color.toString() + (index + 1) + ". " + map.getInfo().getShortDescription(sender);
@ -240,7 +240,9 @@ public class MapCommands {
new PrettyPaginatedResult<String>(PGMTranslations.get().t("command.map.rotationList.title", sender)) {
@Override public String format(String rotationName, int index) {
int activation = Config.getConfiguration().getInt("rotation.providers.file." + rotationName + ".count");
return (index % 2 == 0 ? ChatColor.AQUA : ChatColor.DARK_AQUA) + rotationName + (activation > 0 ? ChatColor.GRAY + " " + PGMTranslations.get().t("command.map.rotationList.activatesWith", sender, ChatColor.RED + "" + activation + ChatColor.GRAY) : "");
boolean current = rotationName.equalsIgnoreCase(PGM.getMatchManager().getRotationManager().getCurrentRotationName());
return (current ? ChatColor.GOLD + "\u0187 " : "") + (index % 2 == 0 ? ChatColor.AQUA : ChatColor.DARK_AQUA) + rotationName + (activation > 0 ? ChatColor.GRAY + " " + PGMTranslations.get().t("command.map.rotationList.activatesWith", sender, ChatColor.RED + "" + activation + ChatColor.GRAY) : "");
}
}.display(new BukkitWrappedCommandSender(sender), Lists.newArrayList(rotations.keySet()), page);
}

View File

@ -31,7 +31,8 @@ public class DynamicRotationChangeListener implements Listener {
RotationCategory appr = getAppropriateRotationCategory(playersOnline, rotationManager);
if (appr != null && !rotationManager.getCurrentRotationName().equals(appr.toString().toLowerCase())) {
rotationManager.setRotation(rotationManager.getRotation(appr.toString().toLowerCase()));
rotationManager.setRotation(appr.toString().toLowerCase(), rotationManager.getRotation(appr.toString().toLowerCase()));
rotationManager.setCurrentRotationName(appr.toString().toLowerCase());
CycleMatchModule cmm = event.getMatch().needMatchModule(CycleMatchModule.class);
cmm.startCountdown(cmm.getConfig().countdown());