Mindustry

Mindustry

The Mindustry Workshop
Create and share maps and mods for Mindustry.
Edgewalker 8 Aug, 2021 @ 12:11pm
Modding grid visual
I've been having lots of fun working on the source, modding this and that to make the game UI friendlier. One of my top goals was

"Make it much more obvious when power grid connections are live. It should be just blindingly obvious from a distance when the connections exist but are dead".

But I just can't figure out where the grid lines are generated. There is a corresponding sprite, but it's not really that helpful to know, because it's code that's responsible for giving dead lines that barely visible amber tint.

Anybody have a tip?
< >
Showing 1-1 of 1 comments
Panterich 15 Aug, 2021 @ 7:39am 
I`m just passing by and i don`t know java, so don`t throw stones if i miss.

https://github.com/Anuken/Mindustry/blob/master/core/src/mindustry/world/blocks/power/PowerNode.java#L442
setupColor(power.graph.getSatisfaction());
protected void setupColor(float satisfaction){ Draw.color(laserColor1, laserColor2, (1f - satisfaction) * 0.86f + Mathf.absin(3f, 0.1f)); Draw.alpha(Renderer.laserOpacity); }
public float getSatisfaction(){ if(Mathf.zero(lastPowerProduced)){ return 0f; }else if(Mathf.zero(lastPowerNeeded)){ return 1f; } return Mathf.clamp(lastPowerProduced / lastPowerNeeded); }
< >
Showing 1-1 of 1 comments
Per page: 1530 50