From fd96ab4ad0acc0ec78108b65898bc4fa9b031cac Mon Sep 17 00:00:00 2001 From: Taskeren Date: Sun, 4 Aug 2019 00:59:15 +0800 Subject: [PATCH] =?UTF-8?q?[+]=20=E5=8F=8C=E5=87=BB=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=EF=BC=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 添加了双击启动 2. 移除了一些没用的方法 --- build.gradle | 3 ++ src/main/java/ren/taske/nativebot/Main.java | 31 +++++++++++++++++++ .../ren/taske/nativebot/core/NativeBot.java | 14 --------- 3 files changed, 34 insertions(+), 14 deletions(-) create mode 100644 src/main/java/ren/taske/nativebot/Main.java diff --git a/build.gradle b/build.gradle index c5fc3e6..b23ce15 100644 --- a/build.gradle +++ b/build.gradle @@ -45,5 +45,8 @@ shadowJar { from("./") { include 'build.gradle' } + manifest { + attributes "Main-Class":"ren.taske.nativebot.Main" + } } diff --git a/src/main/java/ren/taske/nativebot/Main.java b/src/main/java/ren/taske/nativebot/Main.java new file mode 100644 index 0000000..e768b0e --- /dev/null +++ b/src/main/java/ren/taske/nativebot/Main.java @@ -0,0 +1,31 @@ +package ren.taske.nativebot; + +import java.awt.Font; +import java.util.Random; + +import javax.swing.ImageIcon; +import javax.swing.JOptionPane; +import javax.swing.UIManager; +import javax.swing.plaf.FontUIResource; + +public class Main { + + public static final String[] TITLES = {"𝘕𝘈𝘛𝘐𝘝𝘌𝘉𝘖𝘛 𝘌𝘙𝘙𝘖𝘙", "𝙽𝙰𝚃𝙸𝚅𝙴𝙱𝙾𝚃 𝙴𝚁𝚁𝙾𝚁", "𝐍𝐀𝐓𝐈𝐕𝐄𝐁𝐎𝐓 𝐄𝐑𝐑𝐎𝐑", "𝐍𝐀𝐓𝐈𝐕𝐄𝐁𝐎𝐓 𝐄𝐑𝐑𝐎𝐑"}; + public static final String[] CONTENTS = { + "𝐔𝐧𝐬𝐮𝐩𝐩𝐨𝐫𝐭𝐞𝐝", + "𝑼𝒏𝒔𝒖𝒑𝒑𝒐𝒓𝒕𝒆𝒅", + "𝕌𝕟𝕤𝕦𝕡𝕡𝕠𝕣𝕥𝕖𝕕" + }; + public static final String MORE = "https://nb.taske.ren"; + + public static void main(String[] args) { + UIManager.put("OptionPane.messageFont", new FontUIResource(new Font(Font.SANS_SERIF, Font.PLAIN, 15))); + UIManager.put("OptionPane.buttonFont", new FontUIResource(new Font("Microsoft YaHei", Font.PLAIN, 12))); + + String title = TITLES[new Random().nextInt(TITLES.length)]; + String content = CONTENTS[new Random().nextInt(CONTENTS.length)]; + ImageIcon ii = new ImageIcon(Thread.currentThread().getContextClassLoader().getResource("error.png")); + JOptionPane.showMessageDialog(null, content+"\n"+MORE, title, JOptionPane.ERROR_MESSAGE, ii); + } + +} diff --git a/src/main/java/ren/taske/nativebot/core/NativeBot.java b/src/main/java/ren/taske/nativebot/core/NativeBot.java index 5eaec2e..35e54d0 100644 --- a/src/main/java/ren/taske/nativebot/core/NativeBot.java +++ b/src/main/java/ren/taske/nativebot/core/NativeBot.java @@ -78,18 +78,4 @@ public class NativeBot { bot.startBot(); } - public static void bigWarning(String str, Object...format) { - logger.warning("***********************************************"); - logger.warning(String.format(str, format)); - logger.warning("***********************************************"); - } - - public static void bigWarning(String[] strs, Object...format) { - String s = ""; - for(String str : strs) { - s += str + "\n"; - } - bigWarning(s, format); - } - }