Skip to content

Commit

Permalink
refactor: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharlottes committed Aug 26, 2023
1 parent 12b40d4 commit 0dd7bd8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/informatis/draws/InfoRingDraw.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package informatis.draws;

import arc.Events;
import arc.graphics.g2d.Draw;
import arc.graphics.g2d.Lines;
import arc.math.Mathf;
import arc.util.Time;
Expand All @@ -25,7 +26,6 @@ public InfoRingDraw() {

@Override
public void draw() {
super.draw();
float sin = Mathf.absin(Time.time, 6f, 1f);
float leng = (player.unit() != null && player.unit().hitSize > 4 * 8f ? player.unit().hitSize * 1.5f : 4 * 8f) + sin;
Tmp.v1.set(camera.position);
Expand Down
1 change: 0 additions & 1 deletion src/informatis/draws/OverDrawCategory.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public enum OverDrawCategory {

public final String name;
public final Drawable icon;
public boolean enabled = false;

OverDrawCategory(String name, Drawable icon) {
this.name = name;
Expand Down
11 changes: 5 additions & 6 deletions src/informatis/draws/OverDraws.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import arc.Core;
import arc.Events;
import arc.func.Cons;
import arc.graphics.Color;
import arc.graphics.g2d.Draw;
import arc.graphics.gl.FrameBuffer;
Expand All @@ -16,9 +15,6 @@
import mindustry.gen.Unit;
import mindustry.world.Tile;

import java.util.Arrays;
import java.util.Iterator;

import static arc.Core.graphics;
import static informatis.SVars.turretRange;

Expand Down Expand Up @@ -58,18 +54,21 @@ public static void init() {

for(Building building : Groups.build) {
draw.onBuilding(building);
Draw.reset();
}

for(Unit unit : Groups.unit) {
draw.onUnit(unit);
Draw.reset();
}

for(Tile tile : Vars.world.tiles) {
draw.onTile(tile);
Draw.reset();
}
draw.draw();
};
Draw.reset();
Draw.reset();
}
});
}

Expand Down
2 changes: 0 additions & 2 deletions src/informatis/ui/fragments/sidebar/TroopingFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,12 @@ public TroopingFragment() {

tab.add(String.valueOf(i)).fontScale(0.75f).width(15).padRight(30);
tab.image(() -> {
Log.info("still updating");
if(troop.isEmpty()) return Icon.cancel.getRegion();
Unit unit = Groups.unit.getByID(troop.peek());
if(unit == null) return Icon.cancel.getRegion();
return unit.type.fullIcon;
}).size(10).padRight(10);
tab.label(() -> {
Log.info("still updating");
int amount = 0;
for(int id : troop.toArray()) {
Unit unit = Groups.unit.getByID(id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public class ToolWindow extends Window {

public ToolWindow() {
super(Icon.edit, "tool");
Events.run(EventType.Trigger.update, this::updateShooting);
}

@Override
Expand Down

0 comments on commit 0dd7bd8

Please sign in to comment.