Fix EmoteList formatting issues and improve navigation command handling
This commit is contained in:
@@ -547,8 +547,7 @@ public final class Config {
|
||||
|
||||
public static String EMOTELIST_HEADER = "<bold>Available Chat Emotes</bold><newline>";
|
||||
public static String EMOTELIST_ITEM = "<insert:\"<regex>\"><gold><regex></gold> : <emote></insert><newline>";
|
||||
public static String EMOTELIST_FOOTER =
|
||||
"<green>----<< <gray>Prev</gray> <page> <gray>/</gray> <pages> <gray>Next</gray> >>----";
|
||||
public static String EMOTELIST_FOOTER = "<green>----<< <click:run_command:''/emoteslist prev''><gray>Prev</gray></click> <page> <gray>/</gray> <pages> <click:run_command:''/emoteslist next''><gray>Next</gray></click> >>----";
|
||||
|
||||
private static void emoteListCommand() {
|
||||
EMOTELIST_HEADER = getString("commands.emotelist.header", EMOTELIST_HEADER);
|
||||
|
||||
@@ -33,7 +33,7 @@ public class EmoteList {
|
||||
TagResolver placeholders = TagResolver.resolver(
|
||||
Placeholder.unparsed("page", String.valueOf(page)),
|
||||
Placeholder.unparsed("pages", String.valueOf(pages))
|
||||
);
|
||||
);
|
||||
Component list = Utility.parseMiniMessage(Config.EMOTELIST_HEADER, placeholders).asComponent();
|
||||
|
||||
for (int i = startIndex; i < endIndex; i++) {
|
||||
@@ -41,7 +41,7 @@ public class EmoteList {
|
||||
TagResolver emotes = TagResolver.resolver(
|
||||
Placeholder.parsed("regex", emote.getRegex()),
|
||||
Placeholder.parsed("emote", emote.getReplacement())
|
||||
);
|
||||
);
|
||||
list = list.append(Utility.parseMiniMessage(Config.EMOTELIST_ITEM, emotes));
|
||||
}
|
||||
list = list.append(Utility.parseMiniMessage(Config.EMOTELIST_FOOTER, placeholders));
|
||||
@@ -57,7 +57,6 @@ public class EmoteList {
|
||||
}
|
||||
|
||||
public void prevPage() {
|
||||
this.page -= 1;
|
||||
this.page = Math.max(page - 1, 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user