From 125d6ef8cd5c43876c0cfa075982f1d63424abf0 Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 24 Jan 2020 11:17:18 -0500 Subject: [PATCH] Cleanup --- core/src/mindustry/core/NetClient.java | 2 +- core/src/mindustry/core/UI.java | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/core/NetClient.java b/core/src/mindustry/core/NetClient.java index b440ef283f..9508ad94e3 100644 --- a/core/src/mindustry/core/NetClient.java +++ b/core/src/mindustry/core/NetClient.java @@ -268,7 +268,7 @@ public class NetClient implements ApplicationListener{ @Remote(variants = Variant.both) public static void onInfoToast(String message, float duration){ - ui.showInfoFadeBg(message, duration); + ui.showInfoToast(message, duration); } @Remote(variants = Variant.both) diff --git a/core/src/mindustry/core/UI.java b/core/src/mindustry/core/UI.java index 3a35f9f4db..70606c55d5 100644 --- a/core/src/mindustry/core/UI.java +++ b/core/src/mindustry/core/UI.java @@ -289,9 +289,14 @@ public class UI implements ApplicationListener, Loadable{ Core.scene.add(table); } - public void showInfoFadeBg(String info, float duration){ + public void showInfoToast(String info, float duration){ Table table = new Table(); table.setFillParent(true); + table.update(() -> { + if(state.is(State.menu)){ + table.remove(); + } + }); table.actions(Actions.delay(duration * 0.9f), Actions.fadeOut(duration * 0.1f, Interpolation.fade), Actions.remove()); table.top().table(Styles.black3, t -> t.margin(4).add(info).style(Styles.outlineLabel)).padTop(10); Core.scene.add(table);