Add tooltips and commands for f invite command as specified in issue #73.

This commit is contained in:
drtshock
2014-10-13 14:10:18 -05:00
parent 272c35cda6
commit 04fd18f17a
3 changed files with 183 additions and 1 deletions

View File

@@ -3,6 +3,8 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.struct.Permission;
import mkremins.fanciful.FancyMessage;
import org.bukkit.ChatColor;
public class CmdInvite extends FCommand {
@@ -43,7 +45,17 @@ public class CmdInvite extends FCommand {
myFaction.invite(you);
you.msg("%s<i> invited you to %s", fme.describeTo(you, true), myFaction.describeTo(you));
// Tooltips, colors, and commands only apply to the string immediately before it.
FancyMessage message = new FancyMessage(fme.describeTo(you, true))
.tooltip("Click to join!").command("f join " + myFaction.getTag())
.then(" has invited you to join ").color(ChatColor.YELLOW)
.tooltip("Click to join!").command("f join " + myFaction.getTag())
.then(myFaction.describeTo(you))
.tooltip("Click to join!").command("f join " + myFaction.getTag());
message.send(you.getPlayer());
//you.msg("%s<i> invited you to %s", fme.describeTo(you, true), myFaction.describeTo(you));
myFaction.msg("%s<i> invited %s<i> to your faction.", fme.describeTo(myFaction, true), you.describeTo(myFaction));
}