From b98950b1217d14ea3e81a98a884ddf6083148916 Mon Sep 17 00:00:00 2001 From: Chiss Date: Mon, 26 Jan 2015 11:31:42 +1100 Subject: [PATCH] map parser visual changes --- .../mapparser/command/ListCommand.java | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/ListCommand.java b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/ListCommand.java index 7cd543d11..1eb97129c 100644 --- a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/ListCommand.java +++ b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/ListCommand.java @@ -5,6 +5,7 @@ import java.io.File; import org.bukkit.ChatColor; import org.bukkit.entity.Player; +import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilPlayer; import mineplex.mapparser.GameType; @@ -15,6 +16,8 @@ import mineplex.mapparser.MapParser; */ public class ListCommand extends BaseCommand { + private boolean _colorSwitch = false; + public ListCommand(MapParser plugin) { super(plugin, "list"); @@ -27,9 +30,13 @@ public class ListCommand extends BaseCommand { UtilPlayer.message(player, F.main("Parser", "Listing Maps;")); + boolean colorSwitch = false; + for (GameType gameType : GameType.values()) { - listMaps(player, gameType); + listMaps(player, gameType, colorSwitch); + + colorSwitch = !colorSwitch; } } else if (args.length == 1) @@ -46,16 +53,18 @@ public class ListCommand extends BaseCommand UtilPlayer.message(player, F.main("Parser", "Listing Maps for gametype " + F.elem(gameType.GetName()))); - listMaps(player, gameType); + listMaps(player, gameType, false); } return true; } - private void listMaps(Player player, GameType gameType) + private void listMaps(Player player, GameType gameType, boolean colorSwitch) { String maps = ""; ChatColor color = ChatColor.YELLOW; + if (colorSwitch) + color = ChatColor.AQUA; File mapsFolder = new File("map" + File.separator + gameType.GetName()); if (!mapsFolder.exists()) @@ -70,14 +79,18 @@ public class ListCommand extends BaseCommand if (color == ChatColor.YELLOW) color = ChatColor.GOLD; - else + else if (color == ChatColor.GOLD) color = ChatColor.YELLOW; + else if (color == ChatColor.AQUA) + color = ChatColor.DARK_AQUA; + else if (color == ChatColor.DARK_AQUA) + color = ChatColor.AQUA; } // Print line of maps for specific gametype if (maps.length() > 0) { - maps = F.elem(gameType.name()) + "> " + maps; + maps = F.elem(colorSwitch ? C.cBlue : C.cRed + gameType.name()) + "> " + maps; player.sendMessage(maps); } }