This commit is contained in:
sharlottes
2021-05-17 20:21:31 +09:00
parent 2606f87db4
commit 0065a436dd
4 changed files with 91 additions and 51 deletions

View File

@@ -3,6 +3,7 @@ package UnitInfo.core;
import UnitInfo.ui.FreeBar;
import arc.Core;
import arc.Events;
import mindustry.Vars;
import mindustry.game.EventType.*;
import mindustry.gen.Groups;
import mindustry.mod.Mod;
@@ -20,7 +21,13 @@ public class Main extends Mod {
hud.addCoreTable();
});
Events.on(ResetEvent.class, e -> {
Events.on(WorldLoadEvent.class, e -> {
hud = new HudUi();
hud.addWaveTable();
});
Events.on(WaveEvent.class, e -> {
Vars.ui.hudGroup.removeChild(hud.waveTable);
hud = new HudUi();
hud.addWaveTable();
});
@@ -28,17 +35,9 @@ public class Main extends Mod {
Events.run(Trigger.draw, () -> {
if(Core.settings.getBool("unithealthui"))
Groups.unit.each(unit -> new FreeBar().draw(unit));
});
/*
unitFade[0] = Mathf.lerpDelta(unitFade[0], Mathf.num( Vars.player.unit() != null), 0.1f);
for(int i = 0; i < 4; i++){
float rot = i * 90f + 45f + (-Time.time) % 360f;
float length = Vars.player.unit().hitSize() * 1.5f + (unitFade[0] * 2.5f);
Draw.color(Tmp.c1.set(Color.orange).lerp(Color.scarlet, Mathf.absin(Time.time, 2f, 1f)));
Draw.rect("select-arrow", Vars.player.unit().x + Angles.trnsx(rot, length), Vars.player.unit().y + Angles.trnsy(rot, length), length / 1.9f, length / 1.9f, rot - 135f);
Draw.reset();
}
*/
}
@Override