Reduce buttons by two.

This commit is contained in:
ulumulu1510 2015-09-02 16:19:16 +02:00 committed by Olof Larsson
parent 67d6e47e60
commit c8a7e9401f

View File

@ -515,7 +515,7 @@ public class Txt
if (command == null) return mson(titleize(str + parse("<a>") + " " + pageHumanBased + "/" + pagecount)); if (command == null) return mson(titleize(str + parse("<a>") + " " + pageHumanBased + "/" + pagecount));
// Math // Math
String title = str + " " + "[<<] [<]" + pageHumanBased + "/" + pagecount + "[>] [>>]"; String title = str + " " + "[<]" + pageHumanBased + "/" + pagecount + "[>]";
String center = ".[ " + title + " ]."; String center = ".[ " + title + " ].";
int centerlen = center.length(); int centerlen = center.length();
int pivot = titleizeLine.length() / 2; int pivot = titleizeLine.length() / 2;
@ -549,31 +549,31 @@ public class Txt
private static Mson getFlipSection(int pagecount, int pageHumanBased, List<String> args, MassiveCommand command) private static Mson getFlipSection(int pagecount, int pageHumanBased, List<String> args, MassiveCommand command)
{ {
// Construct Mson // Construct Mson
Mson start = mson("[<<] ").color(ChatColor.GRAY); Mson start = mson(String.valueOf(pageHumanBased)).color(ChatColor.GOLD);
Mson backward = mson("[<] ").color(ChatColor.GRAY); Mson backward = mson("[<] ").color(ChatColor.GRAY);
Mson forward = mson(" [>]").color(ChatColor.GRAY); Mson forward = mson(" [>]").color(ChatColor.GRAY);
Mson end = mson(" [>>]").color(ChatColor.GRAY); Mson end = mson(String.valueOf(pagecount)).color(ChatColor.GOLD);
// Set flip page backward commands // Set flip page backward commands
if (pageHumanBased > 1) if (pageHumanBased > 1)
{ {
start = setFlipPageCommand(start, pageHumanBased, 1, args, command); start = setFlipPageCommand(start, pageHumanBased, 1, args, command);
backward = setFlipPageCommand(backward, pageHumanBased, pageHumanBased - 1, args, command); backward = setFlipPageCommand(backward, pageHumanBased, pageHumanBased - 1, args, command).color(ChatColor.AQUA);
} }
// Set flip page forward commands // Set flip page forward commands
if (pagecount > pageHumanBased) if (pagecount > pageHumanBased)
{ {
forward = setFlipPageCommand(forward, pageHumanBased, pageHumanBased + 1, args, command); forward = setFlipPageCommand(forward, pageHumanBased, pageHumanBased + 1, args, command).color(ChatColor.AQUA);
end = setFlipPageCommand(end, pageHumanBased, pagecount, args, command); end = setFlipPageCommand(end, pageHumanBased, pagecount, args, command);
} }
Mson flipMson = mson( Mson flipMson = mson(
start,
backward, backward,
mson(pageHumanBased + "/" + pagecount).color(ChatColor.YELLOW), start,
forward, mson("/").color(ChatColor.GOLD),
end end,
forward
); );
return flipMson; return flipMson;
@ -586,8 +586,6 @@ public class Txt
String tooltip = "<i>Click to <c>%s<i>."; String tooltip = "<i>Click to <c>%s<i>.";
String commandLine; String commandLine;
mson = mson.color(ChatColor.AQUA);
if (args != null && args.contains(oldNumber)) if (args != null && args.contains(oldNumber))
{ {
List<String> arguments = new ArrayList<String>(args); List<String> arguments = new ArrayList<String>(args);