Skip to content

Commit dedb605

Browse files
committed
Popup Alerts
New API for showing a Popup Window.
1 parent b51b53e commit dedb605

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.ztrolix.zlibs.api.client;
2+
3+
import com.ztrolix.zlibs.config.ZLibsConfig;
4+
import me.shedaniel.autoconfig.AutoConfig;
5+
6+
import javax.swing.*;
7+
8+
public class popupAlert {
9+
public static void show(String Title, String Text) {
10+
ZLibsConfig config = AutoConfig.getConfigHolder(ZLibsConfig.class).getConfig();
11+
12+
if (config.features.popup) {
13+
JOptionPane.showMessageDialog(null, Text, Title, JOptionPane.INFORMATION_MESSAGE);
14+
}
15+
}
16+
}

src/client/java/com/ztrolix/zlibs/config/features.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@ public class features implements ConfigData {
1818
public boolean worldGen = true;
1919
@Comment("Custom Modmenu Badges")
2020
public boolean modmenuCustomBadges = true;
21+
@Comment("Shows a Window Popup")
22+
public boolean popup = true;
2123
}

src/main/resources/assets/ztrolix-libs/lang/en_us.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"text.autoconfig.ztrolix-libs.option.main.contributeToPlayerCount": "Contribute To Player Count",
55
"text.autoconfig.ztrolix-libs.option.compatibility.discordRPC": "Discord RPC",
66
"text.autoconfig.ztrolix-libs.option.compatibility.sodiumIntegration": "Integrate with Sodium",
7+
"text.autoconfig.ztrolix-libs.option.features.popup": "Popup Window",
78
"text.autoconfig.ztrolix-libs.option.features.customBlocks": "Custom Blocks/Items",
89
"text.autoconfig.ztrolix-libs.option.features.worldGen": "World Generation",
910
"text.autoconfig.ztrolix-libs.option.features.uiFramework": "UI Framework",

0 commit comments

Comments
 (0)