mirror of
https://github.com/yawaflua/Informatis.git
synced 2025-12-10 12:09:27 +02:00
Remove reset on WorldLoadEvent
This actually works, according to playtesting, unlike the last PR
This commit is contained in:
@@ -59,6 +59,19 @@ public class HudUi {
|
|||||||
int maxwave;
|
int maxwave;
|
||||||
int coreamount;
|
int coreamount;
|
||||||
|
|
||||||
|
public void reset(){
|
||||||
|
bars.each(bar -> {
|
||||||
|
weapon = new Table();
|
||||||
|
core = new Table();
|
||||||
|
wave = new Table();
|
||||||
|
waveTable = new Table();
|
||||||
|
|
||||||
|
bar.visible = false;
|
||||||
|
bar.clear();
|
||||||
|
bar.remove();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public Unit getUnit(){
|
public Unit getUnit(){
|
||||||
Seq<Unit> units = Groups.unit.intersect(Core.input.mouseWorldX(), Core.input.mouseWorldY(), 4, 4);
|
Seq<Unit> units = Groups.unit.intersect(Core.input.mouseWorldX(), Core.input.mouseWorldY(), 4, 4);
|
||||||
if(units.size <= 0) return player.unit();
|
if(units.size <= 0) return player.unit();
|
||||||
|
|||||||
@@ -3,29 +3,29 @@ package UnitInfo.core;
|
|||||||
import UnitInfo.ui.FreeBar;
|
import UnitInfo.ui.FreeBar;
|
||||||
import arc.Core;
|
import arc.Core;
|
||||||
import arc.Events;
|
import arc.Events;
|
||||||
import mindustry.Vars;
|
|
||||||
import mindustry.game.EventType.*;
|
import mindustry.game.EventType.*;
|
||||||
import mindustry.gen.Groups;
|
import mindustry.gen.Groups;
|
||||||
import mindustry.mod.Mod;
|
import mindustry.mod.Mod;
|
||||||
|
|
||||||
public class Main extends Mod {
|
public class Main extends Mod {
|
||||||
public static Setting settingAdder = new Setting();
|
public static Setting settingAdder = new Setting();
|
||||||
|
public static HudUi hud = new HudUi();
|
||||||
|
|
||||||
public Main(){
|
@Override
|
||||||
|
public void init(){
|
||||||
Events.on(ClientLoadEvent.class, e -> {
|
Events.on(ClientLoadEvent.class, e -> {
|
||||||
HudUi hud = new HudUi();
|
hud.reset();
|
||||||
|
|
||||||
|
hud = new HudUi();
|
||||||
settingAdder.init();
|
settingAdder.init();
|
||||||
hud.addTable();
|
hud.addTable();
|
||||||
hud.addCoreTable();
|
hud.addCoreTable();
|
||||||
});
|
});
|
||||||
|
|
||||||
Events.on(WorldLoadEvent.class, e -> {
|
|
||||||
HudUi hud = new HudUi();
|
|
||||||
hud.addWaveTable();
|
|
||||||
});
|
|
||||||
|
|
||||||
Events.on(ResetEvent.class, e -> {
|
Events.on(ResetEvent.class, e -> {
|
||||||
HudUi hud = new HudUi();
|
hud.reset();
|
||||||
|
|
||||||
|
hud = new HudUi();
|
||||||
hud.addWaveTable();
|
hud.addWaveTable();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -45,10 +45,6 @@ public class Main extends Mod {
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void init(){
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadContent(){
|
public void loadContent(){
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user