Skip to content

Commit

Permalink
fix: fabedit: machine displaying
Browse files Browse the repository at this point in the history
  • Loading branch information
kiedtl committed May 20, 2024
1 parent beb927b commit 19d3955
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/fabedit/ui.zig
Original file line number Diff line number Diff line change
Expand Up @@ -221,16 +221,22 @@ pub fn displayAs(st: *fabedit.EdState, ftile: mapgen.Prefab.FabTile) display.Cel
&materials.Basalt
else if (mem.eql(u8, prefix, "LAB") or mem.eql(u8, prefix, "WRK"))
&materials.Dobalene
else if (mem.eql(u8, prefix, "HLD"))
&materials.PlatedDobalene
else if (mem.eql(u8, prefix, "CRY") or mem.eql(u8, prefix, "SIN"))
&materials.Marble
else
&materials.Concrete;
const win_material = if (mem.eql(u8, prefix, "LAB") or mem.eql(u8, prefix, "WRK"))
&materials.LabGlass
else if (mem.eql(u8, prefix, "HLD"))
&materials.LabGlass
else
&materials.Glass;
const door_machine = if (mem.eql(u8, prefix, "LAB") or mem.eql(u8, prefix, "WRK"))
&surfaces.LabDoor
else if (mem.eql(u8, prefix, "HLD"))
&surfaces.LabDoor
else
&surfaces.NormalDoor;
return switch (ftile) {
Expand Down Expand Up @@ -649,6 +655,7 @@ pub fn drawMap(st: *fabedit.EdState) void {

cell.bg = switch (st.fab.content[y][x]) {
.Feature => |f| switch (st.fab.features[f].?) {
.Prop => |pid| surfaces.props.items[utils.findById(surfaces.props.items, pid).?].bg orelse colors.BG,
.Machine => |mid| surfaces.MACHINES[utils.findById(&surfaces.MACHINES, mid.id).?].unpowered_bg orelse colors.BG,
.Poster => colors.GOLD,
else => cell.bg,
Expand Down

0 comments on commit 19d3955

Please sign in to comment.