From 07893eee9c3d779caec38f47c535170012892a97 Mon Sep 17 00:00:00 2001 From: Patrick 'Quezler' Mounier Date: Thu, 19 Nov 2020 19:50:30 +0100 Subject: [PATCH 1/7] Allow for plugins to trigger the same alerts as sectors and guardians --- core/src/mindustry/core/NetClient.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/src/mindustry/core/NetClient.java b/core/src/mindustry/core/NetClient.java index f2cc3d6353..316fca9e80 100644 --- a/core/src/mindustry/core/NetClient.java +++ b/core/src/mindustry/core/NetClient.java @@ -339,6 +339,13 @@ public class NetClient implements ApplicationListener{ ui.showInfoToast(message, duration); } + + @Remote(variants = Variant.both) + public static void warningToast(int unicode, String text){ + if(text == null || mindustry.ui.Fonts.def.getData().getGlyph((char)unicode) == null) return; + + ui.hudfrag.showToast(mindustry.ui.Fonts.getGlyph(mindustry.ui.Fonts.def, (char)unicode), text); + } @Remote(variants = Variant.both) public static void setRules(Rules rules){ From 61582fed3a3a8136ac592e21aa5185d64de6abcd Mon Sep 17 00:00:00 2001 From: DeltaNedas Date: Thu, 19 Nov 2020 19:15:23 +0000 Subject: [PATCH 2/7] upload pr jar --- .github/workflows/gradle.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index a35d7efe60..3e6f88c15f 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -14,6 +14,11 @@ jobs: java-version: 14 - name: Run unit tests with gradle and Java 14 run: ./gradlew compileJava + - name: Upload desktop jar for testing + uses: actions/upload-artifact@v2 + with: + name: Desktop jar (zipped) + path: desktop/build/libs/Mindustry.jar buildJava15: runs-on: ubuntu-latest From 647911725b8e52ac6150346d1321ce991102dac1 Mon Sep 17 00:00:00 2001 From: DeltaNedas Date: Thu, 19 Nov 2020 19:34:16 +0000 Subject: [PATCH 3/7] compile the jar first --- .github/workflows/gradle.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 3e6f88c15f..38cfeeee4e 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -14,6 +14,8 @@ jobs: java-version: 14 - name: Run unit tests with gradle and Java 14 run: ./gradlew compileJava + - name: Compile desktop jar + run: ./gradlew desktop:dist - name: Upload desktop jar for testing uses: actions/upload-artifact@v2 with: From ce045a470a72667644a777d949a9fef5c471bcda Mon Sep 17 00:00:00 2001 From: Patrick 'Quezler' Mounier Date: Thu, 19 Nov 2020 20:34:49 +0100 Subject: [PATCH 4/7] Update NetClient.java --- core/src/mindustry/core/NetClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/core/NetClient.java b/core/src/mindustry/core/NetClient.java index 316fca9e80..1104e4dd3e 100644 --- a/core/src/mindustry/core/NetClient.java +++ b/core/src/mindustry/core/NetClient.java @@ -342,9 +342,9 @@ public class NetClient implements ApplicationListener{ @Remote(variants = Variant.both) public static void warningToast(int unicode, String text){ - if(text == null || mindustry.ui.Fonts.def.getData().getGlyph((char)unicode) == null) return; + if(text == null || Fonts.def.getData().getGlyph((char)unicode) == null) return; - ui.hudfrag.showToast(mindustry.ui.Fonts.getGlyph(mindustry.ui.Fonts.def, (char)unicode), text); + ui.hudfrag.showToast(Fonts.getGlyph(ui.Fonts.def, (char)unicode), text); } @Remote(variants = Variant.both) From 72136ebea3b824127333c57bde6cc2413cb33360 Mon Sep 17 00:00:00 2001 From: Patrick 'Quezler' Mounier Date: Thu, 19 Nov 2020 20:36:58 +0100 Subject: [PATCH 5/7] Or is it? --- core/src/mindustry/core/NetClient.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/mindustry/core/NetClient.java b/core/src/mindustry/core/NetClient.java index 1104e4dd3e..363d7f5050 100644 --- a/core/src/mindustry/core/NetClient.java +++ b/core/src/mindustry/core/NetClient.java @@ -21,6 +21,7 @@ import mindustry.net.Administration.*; import mindustry.net.Net.*; import mindustry.net.*; import mindustry.net.Packets.*; +import mindustry.ui.*; import mindustry.world.*; import mindustry.world.modules.*; From 637cca2e66d6df4e29e018b0e1dcf46ff0976c9d Mon Sep 17 00:00:00 2001 From: Patrick 'Quezler' Mounier Date: Thu, 19 Nov 2020 20:50:14 +0100 Subject: [PATCH 6/7] Probably one more --- core/src/mindustry/core/NetClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/mindustry/core/NetClient.java b/core/src/mindustry/core/NetClient.java index 363d7f5050..b6b2a6deb9 100644 --- a/core/src/mindustry/core/NetClient.java +++ b/core/src/mindustry/core/NetClient.java @@ -345,7 +345,7 @@ public class NetClient implements ApplicationListener{ public static void warningToast(int unicode, String text){ if(text == null || Fonts.def.getData().getGlyph((char)unicode) == null) return; - ui.hudfrag.showToast(Fonts.getGlyph(ui.Fonts.def, (char)unicode), text); + ui.hudfrag.showToast(Fonts.getGlyph(Fonts.def, (char)unicode), text); } @Remote(variants = Variant.both) From a6d1ac0b86d8382fec3af1c355054a5fa57c58ad Mon Sep 17 00:00:00 2001 From: Patrick 'Quezler' Mounier Date: Thu, 19 Nov 2020 21:08:07 +0100 Subject: [PATCH 7/7] Use icon font in favor of def --- core/src/mindustry/core/NetClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/core/NetClient.java b/core/src/mindustry/core/NetClient.java index b6b2a6deb9..841e7e42a7 100644 --- a/core/src/mindustry/core/NetClient.java +++ b/core/src/mindustry/core/NetClient.java @@ -343,9 +343,9 @@ public class NetClient implements ApplicationListener{ @Remote(variants = Variant.both) public static void warningToast(int unicode, String text){ - if(text == null || Fonts.def.getData().getGlyph((char)unicode) == null) return; + if(text == null || Fonts.icon.getData().getGlyph((char)unicode) == null) return; - ui.hudfrag.showToast(Fonts.getGlyph(Fonts.def, (char)unicode), text); + ui.hudfrag.showToast(Fonts.getGlyph(Fonts.icon, (char)unicode), text); } @Remote(variants = Variant.both)