Switch Button by GalactusX31 updated for 1.0


This mod adds on/off switch button for sending a single circuit network signal. Mod settings allow to either toggle On/Off state by left-click and access inventory via hotkey, or to work like a regular constant combinator.

Content
3 years ago
1.0 - 1.1
8.44K
Circuit network

b [fixed] Button won't work on click

3 years ago

The switch wont turn so it is really just a bad looking constant combinator

3 years ago

for unknow reason switch action bug after unknown action need use shortcut of mod on any of switch for unbug all switch temporary

mk-fg β˜†
3 years ago

I think the problem was because all of the following things were nested in onKey function, and could only happen in this exact sequence:

  • "opened from keybind" state was set.
  • entity-valid + distance checks were made.
  • Combinator opened via player.opened = entity, triggering on_gui_opened event.
  • "opened from keybind" state was reset.

Issue here is on the second step, where if check failed, "opened from keybind" state was never reset back to nil, and all "on_gui_opened" events were skipped.
Fixed by always resetting state when exiting from onKey function, regardless of the check there in 0.1.13, which should address this issue, pretty sure.

New response