Skip to content

WireButton

namespace Griff.Modules.Contraptions;
public sealed class WireButton : Component

A button to press with Interact (E) with the mouse over it, or while standing on it. Its output “On” is 1 while it’s on: wire it to a lamp, a thruster, a gate.

This is a component: its saved properties are on its component page.

public bool IsOn { get; set; }

True while it’s on.

public Color OnTint { get; set; }

The color its sprite turns while it’s on. Transparent leaves it alone.

public string? Sound { get; set; }

A sound played when it’s pressed.

public bool Toggle { get; set; }

Each press flips it on or off. Untick it for a button that’s only on while it’s held down.

public void Press()

Presses it as a player does: a toggle flips on or off, and one that’s only on while held is on for a moment (a pulse down its wires). A trigger, a card or a note on the beat can press it.