More Txt.

This commit is contained in:
Olof Larsson
2013-04-10 10:45:47 +02:00
parent f6aa6f63ac
commit 262ec248f5
13 changed files with 37 additions and 459 deletions

View File

@ -8,7 +8,7 @@ import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Perm;
import com.massivecraft.factions.TerritoryAccess;
import com.massivecraft.factions.integration.SpoutFeatures;
import com.massivecraft.factions.zcore.util.TextUtil;
import com.massivecraft.mcore.util.Txt;
public class CmdAccess extends FCommand
@ -88,14 +88,14 @@ public class CmdAccess extends FCommand
target = "Faction \""+targetFaction.getTag()+"\"";
}
msg("<i>%s has been %s<i> the access list for this territory.", target, TextUtil.parseColor(added ? "<lime>added to" : "<rose>removed from"));
msg("<i>%s has been %s<i> the access list for this territory.", target, Txt.parse(added ? "<lime>added to" : "<rose>removed from"));
SpoutFeatures.updateAccessInfoLoc(loc);
showAccessList(territory, locFaction);
}
private void showAccessList(TerritoryAccess territory, Faction locFaction)
{
msg("<i>Host faction %s has %s<i> in this territory.", locFaction.getTag(), TextUtil.parseColor(territory.isHostFactionAllowed() ? "<lime>normal access" : "<rose>restricted access"));
msg("<i>Host faction %s has %s<i> in this territory.", locFaction.getTag(), Txt.parse(territory.isHostFactionAllowed() ? "<lime>normal access" : "<rose>restricted access"));
String players = territory.fplayerList();
String factions = territory.factionList();

View File

@ -4,7 +4,7 @@ import com.massivecraft.factions.ConfServer;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayerColl;
import com.massivecraft.factions.Perm;
import com.massivecraft.factions.zcore.util.TextUtil;
import com.massivecraft.mcore.util.Txt;
public class CmdDescription extends FCommand
{
@ -32,7 +32,8 @@ public class CmdDescription extends FCommand
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
if ( ! payForCommand(ConfServer.econCostDesc, "to change faction description", "for changing faction description")) return;
myFaction.setDescription(TextUtil.implode(args, " ").replaceAll("(&([a-f0-9]))", "& $2")); // since "&" color tags seem to work even through plain old FPlayer.sendMessage() for some reason, we need to break those up
// TODO: This must be an invalid replace-approach. The call order is wrong somehow?
myFaction.setDescription(Txt.implode(args, " ").replaceAll("(&([a-f0-9]))", "& $2")); // since "&" color tags seem to work even through plain old FPlayer.sendMessage() for some reason, we need to break those up
if ( ! ConfServer.broadcastDescriptionChanges)
{

View File

@ -12,7 +12,6 @@ import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.Perm;
import com.massivecraft.factions.Rel;
import com.massivecraft.factions.zcore.util.TextUtil;
import com.massivecraft.mcore.util.Txt;
public class CmdShow extends FCommand
@ -103,11 +102,11 @@ public class CmdShow extends FCommand
}
else
{
sendMessage(Txt.parse("<a>In Truce with: ") + TextUtil.implode(relationTags.get(Rel.TRUCE), sepparator));
sendMessage(Txt.parse("<a>In Truce with: ") + Txt.implode(relationTags.get(Rel.TRUCE), sepparator));
}
sendMessage(Txt.parse("<a>Allied to: ") + TextUtil.implode(relationTags.get(Rel.ALLY), sepparator));
sendMessage(Txt.parse("<a>Enemies: ") + TextUtil.implode(relationTags.get(Rel.ENEMY), sepparator));
sendMessage(Txt.parse("<a>Allied to: ") + Txt.implode(relationTags.get(Rel.ALLY), sepparator));
sendMessage(Txt.parse("<a>Enemies: ") + Txt.implode(relationTags.get(Rel.ENEMY), sepparator));
// List the members...
List<String> memberOnlineNames = new ArrayList<String>();
@ -160,8 +159,8 @@ public class CmdShow extends FCommand
memberOfflineNames.add(follower.getNameAndTitle(fme));
}
}
sendMessage(Txt.parse("<a>Members online: ") + TextUtil.implode(memberOnlineNames, sepparator));
sendMessage(Txt.parse("<a>Members offline: ") + TextUtil.implode(memberOfflineNames, sepparator));
sendMessage(Txt.parse("<a>Members online: ") + Txt.implode(memberOnlineNames, sepparator));
sendMessage(Txt.parse("<a>Members offline: ") + Txt.implode(memberOfflineNames, sepparator));
}
}

View File

@ -4,7 +4,7 @@ import com.massivecraft.factions.ConfServer;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Perm;
import com.massivecraft.factions.integration.SpoutFeatures;
import com.massivecraft.factions.zcore.util.TextUtil;
import com.massivecraft.mcore.util.Txt;
public class CmdTitle extends FCommand
{
@ -31,7 +31,7 @@ public class CmdTitle extends FCommand
if (you == null) return;
args.remove(0);
String title = TextUtil.implode(args, " ");
String title = Txt.implode(args, " ");
if ( ! canIAdministerYou(fme, you)) return;