Skip to content

Commit a731a32

Browse files
committed
Reimplement the space areas but btter
1 parent da74da8 commit a731a32

File tree

9 files changed

+63
-4
lines changed

9 files changed

+63
-4
lines changed
Loading
Loading
Loading
Loading
Binary file not shown.

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ configure(allprojects){
4040
localBlackhole = new File(rootDir.parent, 'MindustryBlackHoleRenderer').exists()
4141

4242
blackhole = {String module ->
43-
return "com.github.MEEPofFaith$module:$blackHoleRendererVersion"
43+
return "com.github.MEEPofFaith$module:$bhLibraryVersion"
4444
}
4545
}
4646

gradle.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ mindustryVersion = v146
2525
mindustryBEVersion =
2626
# Arc version, should either follow `mindustryVersion` for release or whatever hash bleeding-edge Mindustry uses.
2727
arcVersion = v146
28-
# My black hole renderer. Just use the latest release.
29-
blackHoleRendererVersion = 532142cf4b
28+
# My black holes library. Just use the latest release.
29+
bhLibraryVersion = 532142cf4b
3030

3131
##### Android SDK configuration for building Android artifacts.
3232
# Android platform SDK version.

src/progressed/content/blocks/PMBlocks.java

+19-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import progressed.entities.bullet.*;
2626
import progressed.entities.bullet.energy.*;
2727
import progressed.entities.effect.*;
28+
import progressed.entities.part.*;
2829
import progressed.type.unit.*;
2930
import progressed.util.*;
3031
import progressed.world.blocks.crafting.*;
@@ -786,26 +787,43 @@ public void setStats(){
786787

787788
parts.addAll(
788789
new RegionPart("-bottom"),
790+
new SpacePart("-space"),
789791
new RegionPart("-front"){{
790792
mirror = true;
791793
moves.addAll(
792794
new PartMove(push, 0f, 2.5f, 0f),
793795
new PartMove(pull, 14f / 4f, -2f, 0f)
794796
);
797+
layerOffset = 0.001f;
798+
outlineLayerOffset -= layerOffset;
795799
}},
796800
new RegionPart("-back"){{
797801
mirror = true;
798802
moves.addAll(
799803
new PartMove(push, 0f, -2.5f, 0f),
800804
new PartMove(pull, 14f / 4f, 2f, 0f)
801805
);
806+
layerOffset = 0.001f;
807+
outlineLayerOffset -= layerOffset;
802808
}},
803809
new RegionPart("-cover"){{
804810
mirror = true;
805811
progress = PartProgress.warmup.curve(0.4f, 0.4f).clamp().curve(Interp.smooth);
806812
moveX = 20f / 4f;
813+
layerOffset = 0.001f;
814+
outlineLayerOffset -= layerOffset;
807815
}},
808-
new RegionPart("-top")
816+
new RegionPart("-side-cover"){{
817+
mirror = true;
818+
progress = pull;
819+
moveY = 7f / 4f;
820+
layerOffset = 0.001f;
821+
outlineLayerOffset -= layerOffset;
822+
}},
823+
new RegionPart("-over"){{
824+
layerOffset = 0.002f;
825+
outlineLayerOffset -= layerOffset;
826+
}}
809827
);
810828
}};
811829
}};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package progressed.entities.part;
2+
3+
import arc.*;
4+
import arc.graphics.*;
5+
import arc.graphics.g2d.*;
6+
import arc.util.*;
7+
import mindustry.entities.part.*;
8+
import mindustry.graphics.*;
9+
10+
import static mindustry.Vars.*;
11+
12+
public class SpacePart extends DrawPart{
13+
/** Appended to unit/weapon/block name and drawn. */
14+
public String suffix = "";
15+
/** Overrides suffix if set. */
16+
public @Nullable String name;
17+
public TextureRegion region;
18+
public float layer = -1;
19+
20+
public SpacePart(String suffix){
21+
this.suffix = suffix;
22+
}
23+
24+
@Override
25+
public void draw(PartParams params){
26+
Draw.draw(layer > 0 ? layer : Draw.z(), () -> {
27+
renderer.effectBuffer.begin(Color.clear);
28+
float rot = params.rotation - 90f;
29+
Draw.rect(region, params.x, params.y, rot);
30+
renderer.effectBuffer.end();
31+
renderer.effectBuffer.blit(Shaders.space);
32+
});
33+
}
34+
35+
@Override
36+
public void load(String name){
37+
String realName = this.name == null ? name + suffix : this.name;
38+
39+
region = Core.atlas.find(realName);
40+
}
41+
}

0 commit comments

Comments
 (0)