Skip to content

Commit

Permalink
gauge resprite again
Browse files Browse the repository at this point in the history
remove fluidCapacity for pump
add pressure bar for liquid source
  • Loading branch information
= committed Jan 19, 2025
1 parent 5af549e commit 808bfee
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
Binary file modified assets/sprites/blocks/liquids/liquid-gauge-pointer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/blocks/liquids/liquid-gauge-tiles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/blocks/liquids/liquid-gauge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions src/omaloon/world/blocks/liquid/PressureLiquidPump.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import mindustry.type.*;
import mindustry.world.*;
import mindustry.world.blocks.*;
import mindustry.world.meta.*;
import omaloon.content.*;
import omaloon.utils.*;
import omaloon.world.interfaces.*;
Expand Down Expand Up @@ -121,7 +120,7 @@ public void load() {
public void setStats() {
super.setStats();
pressureConfig.addStats(stats);
stats.remove(Stat.liquidCapacity);
stats.remove(OlStats.fluidCapacity);
stats.add(OlStats.pumpStrength, pumpStrength);
stats.add(OlStats.pressureGradient, pressureDifference, OlStats.pressureUnit);
}
Expand Down
11 changes: 11 additions & 0 deletions src/omaloon/world/blocks/sandbox/PressureLiquidSource.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package omaloon.world.blocks.sandbox;

import arc.*;
import arc.graphics.*;
import arc.graphics.g2d.*;
import arc.math.*;
import arc.scene.style.*;
Expand All @@ -16,6 +17,7 @@
import mindustry.ui.*;
import mindustry.world.*;
import mindustry.world.blocks.liquid.*;
import omaloon.ui.elements.*;
import omaloon.world.interfaces.*;
import omaloon.world.meta.*;
import omaloon.world.modules.*;
Expand Down Expand Up @@ -75,6 +77,15 @@ public void init() {
public void setBars() {
super.setBars();
pressureConfig.addBars(this);
addBar("pressure", entity -> {
HasPressure build = (HasPressure)entity;

return new CenterBar(
() -> Core.bundle.get("bar.pressure") + (build.pressure().getPressure(build.pressure().getMain()) < 0 ? "-" : "+") + Strings.autoFixed(Math.abs(build.pressure().getPressure(build.pressure().getMain())), 2),
() -> Color.white,
() -> Mathf.map(build.pressure().getPressure(build.pressure().getMain()), pressureConfig.minPressure, pressureConfig.maxPressure, -1, 1)
);
});
}

public class PressureLiquidSourceBuild extends Building implements HasPressure {
Expand Down

0 comments on commit 808bfee

Please sign in to comment.