Skip to content

Commit

Permalink
tweak: pressure plates
Browse files Browse the repository at this point in the history
- Show on HUD
- Name as "lamp pressure plate" instead of just "pressure plate"
  • Loading branch information
kiedtl committed May 10, 2024
1 parent 01bfb57 commit 93a0c51
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/surfaces.zig
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ pub const SirenTrap = Machine{

pub const LightPressurePlate = Machine{
.id = "trap_light_plate",
.name = "pressure plate",
.name = "lamp pressure plate",
.powered_tile = '^',
.unpowered_tile = '^',
.powered_fg = colors.GOLD,
Expand All @@ -570,6 +570,7 @@ pub const LightPressurePlate = Machine{
.detect_with_heat = false, // Efficient LED bulbs!
.powered_luminescence = 60,
.unpowered_luminescence = 0,
.show_on_hud = true,
.on_power = struct {
pub fn f(machine: *Machine) void {
for (&DIRECTIONS) |d| if (machine.coord.move(d, state.mapgeometry)) |neighbor| {
Expand Down
1 change: 1 addition & 0 deletions src/types.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4559,6 +4559,7 @@ pub const Machine = struct {
disabled: bool = false,

player_interact: ?MachInteract = null,
show_on_hud: bool = false, // Show on HUD even if no player interaction

// If the player tries to trigger the machine, should we prompt for a
// confirmation?
Expand Down
2 changes: 1 addition & 1 deletion src/ui.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1564,7 +1564,7 @@ fn drawHUD(moblist: []const *Mob) void {
priority = 2;
focus = .Surface;
name.appendSlice(switch (surf) {
.Machine => |m| if (m.player_interact != null) m.name else "",
.Machine => |m| if (m.player_interact != null or m.show_on_hud) m.name else "",
.Prop => "",
.Corpse => "corpse",
.Container => |c| c.name,
Expand Down

0 comments on commit 93a0c51

Please sign in to comment.