aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/gui
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2022-04-28 02:22:49 -0400
committerbowser0000 <bowser0000@gmail.com>2022-04-28 02:22:49 -0400
commitb7a2bc13f61a60c99ce460d08d7c89d06ee72a34 (patch)
tree72d2927c61ee8daabd9eba50eac95e681190e1c3 /src/main/java/me/Danker/gui
parent852777345060b09ab34945cff65a095aa8cb1aa9 (diff)
downloadSkyblockMod-b7a2bc13f61a60c99ce460d08d7c89d06ee72a34.tar.gz
SkyblockMod-b7a2bc13f61a60c99ce460d08d7c89d06ee72a34.tar.bz2
SkyblockMod-b7a2bc13f61a60c99ce460d08d7c89d06ee72a34.zip
Add regex for alerts
Capture support using $$x$$ where x is a group number Make util function for desktop notifications
Diffstat (limited to 'src/main/java/me/Danker/gui')
-rw-r--r--src/main/java/me/Danker/gui/alerts/AlertActionGui.java4
-rw-r--r--src/main/java/me/Danker/gui/alerts/AlertAddGui.java15
2 files changed, 13 insertions, 6 deletions
diff --git a/src/main/java/me/Danker/gui/alerts/AlertActionGui.java b/src/main/java/me/Danker/gui/alerts/AlertActionGui.java
index 7a73f5a..3d0eb90 100644
--- a/src/main/java/me/Danker/gui/alerts/AlertActionGui.java
+++ b/src/main/java/me/Danker/gui/alerts/AlertActionGui.java
@@ -80,12 +80,12 @@ public class AlertActionGui extends GuiScreen {
mc.displayGuiScreen(new AlertAddGui(alert, id));
} else if (button == delete) {
Alerts.alerts.remove(id);
- Alerts.saveToFile();
+ Alerts.save();
mc.displayGuiScreen(new AlertsGui(1));
return;
}
Alerts.alerts.set(id, alert);
- Alerts.saveToFile();
+ Alerts.save();
}
}
diff --git a/src/main/java/me/Danker/gui/alerts/AlertAddGui.java b/src/main/java/me/Danker/gui/alerts/AlertAddGui.java
index 5f01d6d..304c77a 100644
--- a/src/main/java/me/Danker/gui/alerts/AlertAddGui.java
+++ b/src/main/java/me/Danker/gui/alerts/AlertAddGui.java
@@ -25,6 +25,7 @@ public class AlertAddGui extends GuiScreen {
private GuiButton startsWith;
private GuiButton contains;
private GuiButton endsWith;
+ private GuiButton regex;
private GuiButton everywhere;
private GuiButton skyblock;
private GuiButton dungeons;
@@ -57,9 +58,10 @@ public class AlertAddGui extends GuiScreen {
cancel = new GuiButton(0, 2, height - 30, 100, 20, "Cancel");
- startsWith = new GuiButton(0, width / 2 - 200, (int) (height * 0.2), 120, 20, "Starts With");
- contains = new GuiButton(0, width / 2 - 60, (int) (height * 0.2), 120, 20, "Contains");
- endsWith = new GuiButton(0, width / 2 + 80, (int) (height * 0.2), 120, 20, "Ends With");
+ startsWith = new GuiButton(0, width / 2 - 260, (int) (height * 0.2), 120, 20, "Starts With");
+ contains = new GuiButton(0, width / 2 - 130, (int) (height * 0.2), 120, 20, "Contains");
+ endsWith = new GuiButton(0, width / 2 + 10, (int) (height * 0.2), 120, 20, "Ends With");
+ regex = new GuiButton(0, width / 2 + 140, (int) (height * 0.2), 120, 20, "Regex");
everywhere = new GuiButton(0, width / 2 - 200, (int) (height * 0.3), 120, 20, "Everywhere");
skyblock = new GuiButton(0, width / 2 - 60, (int) (height * 0.3), 120, 20, "Skyblock");
dungeons = new GuiButton(0, width / 2 + 80, (int) (height * 0.3), 120, 20, "Dungeons");
@@ -80,13 +82,16 @@ public class AlertAddGui extends GuiScreen {
message.setVisible(true);
message.setEnabled(true);
+ message.setMaxStringLength(100);
alert.setVisible(true);
alert.setEnabled(true);
+ alert.setMaxStringLength(100);
this.buttonList.add(cancel);
this.buttonList.add(startsWith);
this.buttonList.add(contains);
this.buttonList.add(endsWith);
+ this.buttonList.add(regex);
this.buttonList.add(everywhere);
this.buttonList.add(skyblock);
this.buttonList.add(dungeons);
@@ -119,6 +124,8 @@ public class AlertAddGui extends GuiScreen {
mode = "Contains";
} else if (button == endsWith) {
mode = "Ends With";
+ } else if (button == regex) {
+ mode = "Regex";
} else if (button == everywhere) {
location = "Everywhere";
} else if (button == skyblock) {
@@ -132,7 +139,7 @@ public class AlertAddGui extends GuiScreen {
} else {
Alerts.alerts.add(newAlert);
}
- Alerts.saveToFile();
+ Alerts.save();
mc.displayGuiScreen(new AlertsGui(1));
}
}