Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
New Chat Tab Preset and updated Guild Tab Preset (#476)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomR24 authored Mar 31, 2022
1 parent 0aaf010 commit 2c56932
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class ChatConfig extends SettingsClass {
@Setting
public List<ChatTab> available_tabs = new ArrayList<>();

@Setting(displayName = "Alter Chat Tab by Presets", description = "Which premade selection of chat tabs should be used?\n\na - Global, Guild, Party\n\nb - Global, Shouts, Guild/Party, PMs\n\nvanilla - All", order = 0)
@Setting(displayName = "Alter Chat Tab by Presets", description = "Which premade selection of chat tabs should be used?\n\na - Global, Guild, Party\n\nb - Global, Shouts, Guild/Party, PMs\n\nc - All, Guild, Party, Bombs, Global, Local, Private, Shouts\n\nvanilla - All", order = 0)
public Presets preset = Presets.vanilla;

@Setting(displayName = "Wynnic Translation Condition", description = "When should Wynnic and Gavellian be translated?\n\nDiscovery: The discovery for the transcriber has been discovered.\n\nBook: The transcriber is in your inventory.", order = 12)
Expand All @@ -101,6 +101,7 @@ public class ChatConfig extends SettingsClass {
public enum Presets {
a,
b,
c,
vanilla
}

Expand Down
12 changes: 11 additions & 1 deletion src/main/java/com/wynntils/modules/chat/managers/TabManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

public class TabManager {

public static final String DEFAULT_GUILD_REGEX = "(^&3\\[(&b★{0,5})?(&3)?(&o)?[\\w ]*?(&3)?\\])(?<!&3\\[Parkour\\])|(^&3You were not in the territory)";
public static final String DEFAULT_GUILD_REGEX = "(^&3\\[((&b★{0,5})|(&b.*))?(&3)?(&o)?[\\w ]*?(&3)?\\])(?<!&3\\[Parkour\\])|(^&3You were not in the territory)";
public static final String DEFAULT_PARTY_REGEX = "(^&7\\[&r&e(&o)?[a-zA-Z0-9_ ]+?&r&7\\])|(^&eYou are not in a party!)";

private static List<ChatTab> availableTabs;
Expand Down Expand Up @@ -63,6 +63,16 @@ public static void registerPresets() {
availableTabs.add(new ChatTab("G/P", DEFAULT_GUILD_REGEX + "|" + DEFAULT_PARTY_REGEX, null, "/g", false, 2));
availableTabs.add(new ChatTab("Private", "&7\\[.*\u27A4.*&7\\]", null, "/r", false, 3));
break;
case c:
availableTabs.add(new ChatTab("All", ".*", null, "", true, 0));
availableTabs.add(new ChatTab("Guild", DEFAULT_GUILD_REGEX, null, "/g", true, 1));
availableTabs.add(new ChatTab("Party", DEFAULT_PARTY_REGEX, null, "/p", true, 2));
availableTabs.add(new ChatTab("Bombs", "&e\\[Bomb Bell\\]", null, "/switch", true, 3));
availableTabs.add(new ChatTab("Global", "^&[a78]\\[.+\\*?\\/\\w{2}", null, "", true, 4));
availableTabs.add(new ChatTab("Local", "^&[a7]\\[.+\\*?\\/\\w{2}", null, "", true, 5));
availableTabs.add(new ChatTab("Private", "&7\\[.*\u27A4.*&7\\]", null, "/r", true, 6));
availableTabs.add(new ChatTab("Shouts", "(^&3.*shouts:)", null, "", true, 7));
break;
case vanilla:
availableTabs.add(new ChatTab("All", ".*", null, "", false, 0));
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ private String regexCreator() {
if ((v && !allIsPresent) || (allIsPresent && !v)) {
switch (k) {
case "Local":
result.add("^&7\\[\\d+\\*?\\/\\w{2}");
result.add("^&[a7]\\[\\d+\\*?\\/\\w{2}");
break;
case "Guild":
result.add(TabManager.DEFAULT_GUILD_REGEX);
Expand Down

0 comments on commit 2c56932

Please sign in to comment.