mindustry logic execution, map- and schematic- parsing and rendering
2 tops for all
bendn 2023-08-10
parent 764d636 · commit b745cca
-rw-r--r--Cargo.toml2
-rw-r--r--assets/blocks/power/neoplasia-reactor-top.pngbin428 -> 0 bytes
-rw-r--r--assets/blocks/power/neoplasia-reactor-top1.pngbin0 -> 295 bytes
-rw-r--r--assets/blocks/power/neoplasia-reactor-top2.pngbin0 -> 297 bytes
-rw-r--r--assets/blocks/production/heat-source-top1.pngbin0 -> 130 bytes
-rw-r--r--assets/blocks/production/heat-source-top2.pngbin0 -> 130 bytes
-rw-r--r--assets/blocks/production/heat-source.pngbin411 -> 410 bytes
-rw-r--r--src/block/power.rs9
-rw-r--r--src/block/production.rs23
9 files changed, 15 insertions, 19 deletions
diff --git a/Cargo.toml b/Cargo.toml
index adbb0f9..cd295f3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "mindus"
-version = "3.0.6"
+version = "3.0.7"
edition = "2021"
description = "A library for working with mindustry data formats (eg schematics and maps) (fork of plandustry)"
authors = [
diff --git a/assets/blocks/power/neoplasia-reactor-top.png b/assets/blocks/power/neoplasia-reactor-top.png
deleted file mode 100644
index b2b5833..0000000
--- a/assets/blocks/power/neoplasia-reactor-top.png
+++ /dev/null
Binary files differ
diff --git a/assets/blocks/power/neoplasia-reactor-top1.png b/assets/blocks/power/neoplasia-reactor-top1.png
new file mode 100644
index 0000000..73ecc4d
--- /dev/null
+++ b/assets/blocks/power/neoplasia-reactor-top1.png
Binary files differ
diff --git a/assets/blocks/power/neoplasia-reactor-top2.png b/assets/blocks/power/neoplasia-reactor-top2.png
new file mode 100644
index 0000000..08a24c4
--- /dev/null
+++ b/assets/blocks/power/neoplasia-reactor-top2.png
Binary files differ
diff --git a/assets/blocks/production/heat-source-top1.png b/assets/blocks/production/heat-source-top1.png
new file mode 100644
index 0000000..3f53d54
--- /dev/null
+++ b/assets/blocks/production/heat-source-top1.png
Binary files differ
diff --git a/assets/blocks/production/heat-source-top2.png b/assets/blocks/production/heat-source-top2.png
new file mode 100644
index 0000000..523d20f
--- /dev/null
+++ b/assets/blocks/production/heat-source-top2.png
Binary files differ
diff --git a/assets/blocks/production/heat-source.png b/assets/blocks/production/heat-source.png
index d709977..b4f09d9 100644
--- a/assets/blocks/production/heat-source.png
+++ b/assets/blocks/production/heat-source.png
Binary files differ
diff --git a/src/block/power.rs b/src/block/power.rs
index 2e47956..ea54750 100644
--- a/src/block/power.rs
+++ b/src/block/power.rs
@@ -12,8 +12,13 @@ make_simple!(
Neoplasia,
|_, _, _, _, rot: Rotation, scl| {
let mut base = load!("neoplasia-reactor", scl);
- // TODO 2 tops
- base.overlay(load!("neoplasia-reactor-top", scl).rotate(rot.rotated(false).count()));
+ base.overlay(
+ load!(scl -> match rot {
+ Rotation::Up | Rotation::Right => "neoplasia-reactor-top1",
+ Rotation::Down | Rotation::Left => "neoplasia-reactor-top2",
+ })
+ .rotate(rot.rotated(false).count()),
+ );
base
},
|_, _, _, buff: &mut DataRead| read_heater(buff)
diff --git a/src/block/production.rs b/src/block/production.rs
index 5f2b122..6037427 100644
--- a/src/block/production.rs
+++ b/src/block/production.rs
@@ -40,7 +40,7 @@ make_register! {
"phase-synthesizer" -> ProductionBlock::new(3, true, cost!(Carbide: 90, Silicon: 100, Thorium: 100, Tungsten: 200));
// heat reactor
// sandbox only
- "heat-source" -> HeatCrafter::new(1, false, &[]);
+ "heat-source" => HeatCrafter::new(1, false, &[]);
}
// format: call [`read_production_block`], seed: [`i32`]
@@ -81,21 +81,12 @@ make_simple!(
make_simple!(
HeatCrafter,
|_, n, _, _, r: Rotation, s| {
- match n {
- // TODO i didnt realize the significance of two tops before and kinda deleted them, add them back
- "phase-heater" | "electric-heater" | "oxidation-chamber" | "slag-heater" => {
- let mut base = load!(from n which is ["phase-heater" | "electric-heater" | "oxidation-chamber" | "slag-heater"], s);
- base.overlay(
- match r {
- Rotation::Up | Rotation::Right => load!(concat top1 => n which is ["phase-heater" | "electric-heater" | "oxidation-chamber" | "slag-heater"], s),
- Rotation::Down | Rotation::Left => load!(concat top2 => n which is ["phase-heater" | "electric-heater" | "oxidation-chamber" | "slag-heater"], s)
- }
- .rotate(r.rotated(false).count()),
- );
- base
- }
- n => unimplemented!("{n}"),
- }
+ let mut base = load!(from n which is ["phase-heater" | "electric-heater" | "oxidation-chamber" | "slag-heater" | "heat-source"], s);
+ base.overlay(match r {
+ Rotation::Up | Rotation::Right => load!(concat top1 => n which is ["phase-heater" | "electric-heater" | "oxidation-chamber" | "slag-heater" | "heat-source"], s),
+ Rotation::Down | Rotation::Left => load!(concat top2 => n which is ["phase-heater" | "electric-heater" | "oxidation-chamber" | "slag-heater" | "heat-source"], s)
+ }.rotate(r.rotated(false).count()));
+ base
},
|_, _, _, buff: &mut DataRead| {
// format: