From 656dc90b336c9409491eecc4fb93a54c70e2adac Mon Sep 17 00:00:00 2001 From: drtshock Date: Fri, 14 Nov 2014 09:46:28 -0600 Subject: [PATCH] Add tooltips and ability to click to warp when you list faction warps. --- src/main/java/com/massivecraft/factions/cmd/CmdFWarp.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdFWarp.java b/src/main/java/com/massivecraft/factions/cmd/CmdFWarp.java index 42ea54b9..ee005acf 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdFWarp.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdFWarp.java @@ -4,6 +4,8 @@ import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.P; import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.struct.Permission; +import mkremins.fanciful.FancyMessage; +import org.bukkit.ChatColor; public class CmdFWarp extends FCommand { @@ -22,11 +24,11 @@ public class CmdFWarp extends FCommand { public void perform() { //TODO: check if in combat. if (args.size() == 0) { - StringBuilder sb = new StringBuilder(); + FancyMessage msg = new FancyMessage("Warps: ").color(ChatColor.GOLD); for (String s : myFaction.getWarps().keySet()) { - sb.append(s + " "); + msg.then(s + " ").tooltip("Click to warp!").command("f warp " + s).color(ChatColor.WHITE); } - fme.msg("Warps: " + sb.toString().trim()); + sendFancyMessage(msg); } else if (args.size() > 1) { fme.msg("/f warp "); } else {