mirror of
https://github.com/yawaflua/Informatis.git
synced 2025-12-10 12:09:27 +02:00
more core info
This commit is contained in:
@@ -3,7 +3,13 @@ package UnitInfo.core;
|
||||
import UnitInfo.ui.FreeBar;
|
||||
import arc.Core;
|
||||
import arc.Events;
|
||||
import arc.math.geom.Rect;
|
||||
import arc.graphics.Color;
|
||||
import arc.graphics.g2d.Draw;
|
||||
import arc.math.Angles;
|
||||
import arc.math.Mathf;
|
||||
import arc.util.Time;
|
||||
import arc.util.Tmp;
|
||||
import mindustry.Vars;
|
||||
import mindustry.game.EventType.*;
|
||||
import mindustry.gen.Groups;
|
||||
import mindustry.mod.Mod;
|
||||
@@ -12,20 +18,35 @@ public class Main extends Mod {
|
||||
public static Setting settingAdder = new Setting();
|
||||
|
||||
public Main(){
|
||||
float[] unitFade = {0};
|
||||
|
||||
Events.on(ClientLoadEvent.class, e -> {
|
||||
settingAdder.init();
|
||||
HudUi hud = new HudUi();
|
||||
hud.addTable();
|
||||
hud.addCoreTable();
|
||||
});
|
||||
|
||||
Events.on(WorldLoadEvent.class, e -> {
|
||||
HudUi hud = new HudUi();
|
||||
hud.addTable();
|
||||
hud.addCoreTable();
|
||||
});
|
||||
Events.run(Trigger.draw, () -> {
|
||||
if(Core.settings.getBool("unithealthui"))
|
||||
Groups.unit.each(unit -> new FreeBar().draw(unit));
|
||||
});
|
||||
|
||||
Events.run(Trigger.teamCoreDamage, () -> {
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user