Skip to content

Commit 101a090

Browse files
committed
feat: add notice
1 parent 5ddd4be commit 101a090

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

dev.skidfuscator.client.standalone/src/main/java/dev/skidfuscator/obfuscator/SkidfuscatorMain.java

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@
1616
import picocli.CommandLine;
1717

1818
import javax.swing.*;
19+
import java.awt.*;
1920
import java.io.File;
21+
import java.io.IOException;
22+
import java.net.URI;
23+
import java.net.URISyntaxException;
24+
import java.util.concurrent.CompletableFuture;
25+
import java.util.concurrent.TimeUnit;
2026

2127
public class SkidfuscatorMain {
2228

@@ -33,7 +39,41 @@ public static void main(String[] args) {
3339
} catch (Exception e) {
3440
e.printStackTrace();
3541
}
36-
new MainFrame().setVisible(true);
42+
43+
final int option = JOptionPane.showOptionDialog(
44+
null,
45+
"You are running Skidfuscator Community! Whilst this project is free and open-source, " +
46+
"we heavily encourage commercial usage to support the project by licensing via the enterprise" +
47+
" edition available on our website",
48+
"Notice!",
49+
JOptionPane.DEFAULT_OPTION,
50+
JOptionPane.INFORMATION_MESSAGE,
51+
UIManager.getIcon("OptionPane.informationIcon"),
52+
new Object[]{"OK", "Buy Enterprise", "Join the Discord"},
53+
"OK"
54+
);
55+
56+
if (option == 0) {
57+
new MainFrame().setVisible(true);
58+
return;
59+
}
60+
61+
final String url = switch (option) {
62+
case 1 -> "https://skidfuscator.dev/pricing";
63+
case 2 -> "https://discord.gg/QJC9g8fBU9";
64+
default -> throw new IllegalStateException("Impossible");
65+
};
66+
67+
CompletableFuture.delayedExecutor(1, TimeUnit.SECONDS).execute(() -> {
68+
try {
69+
Desktop.getDesktop().browse(new URI(url));
70+
} catch (IOException | URISyntaxException e) {
71+
throw new RuntimeException(e);
72+
}
73+
});
74+
main(args);
75+
return;
76+
3777
});
3878
return;
3979
}

docs/header.png

138 KB
Loading

docs/header.psd

3.16 MB
Binary file not shown.

0 commit comments

Comments
 (0)