Add TL for commands. Resolves #162. Supercedes #97.

This commit is contained in:
korikisulda
2014-12-07 23:12:52 +00:00
committed by drtshock
parent bd8f572cbf
commit 1230803cfb
64 changed files with 864 additions and 318 deletions

View File

@@ -3,7 +3,10 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import mkremins.fanciful.FancyMessage;
import org.bukkit.ChatColor;
public class CmdInvite extends FCommand {
@@ -33,13 +36,13 @@ public class CmdInvite extends FCommand {
}
if (you.getFaction() == myFaction) {
msg("%s<i> is already a member of %s", you.getName(), myFaction.getTag());
msg("<i>You might want to: " + p.cmdBase.cmdKick.getUseageTemplate(false));
msg(TL.COMMAND_INVITE_ALREADYMEMBER, you.getName(), myFaction.getTag());
msg(TL.GENERIC_YOUMAYWANT.toString() + p.cmdBase.cmdKick.getUseageTemplate(false));
return;
}
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
if (!payForCommand(Conf.econCostInvite, "to invite someone", "for inviting someone")) {
if (!payForCommand(Conf.econCostInvite, TL.COMMAND_INVITE_TOINVITE.toString(), TL.COMMAND_INVITE_FORINVITE.toString())) {
return;
}
@@ -49,12 +52,12 @@ public class CmdInvite extends FCommand {
}
// 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());
FancyMessage message = new FancyMessage(fme.describeTo(you, true)).tooltip(TL.COMMAND_INVITE_CLICKTOJOIN.toString()).command("f join " + myFaction.getTag()).then(TL.COMMAND_INVITE_INVITEDYOU.toString()).color(ChatColor.YELLOW).tooltip(TL.COMMAND_INVITE_CLICKTOJOIN.toString()).command("f join " + myFaction.getTag()).then(myFaction.describeTo(you)).tooltip(TL.COMMAND_INVITE_CLICKTOJOIN.toString()).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));
myFaction.msg(TL.COMMAND_INVITE_INVITED, fme.describeTo(myFaction, true), you.describeTo(myFaction));
}
}