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] Reach

3 years ago

When I was far away from the button and cannot reach it with the left-mouse click, I still can switch the state of the button with the 'F' key!

Thanks.

3 years ago

is feature add for long distance activation with inventory shortcut in map mod

mk-fg β˜†
3 years ago
(updated 3 years ago)

There are two separate issues here:

  • One - "cannot reach it with the left-mouse click, I still can switch the state of the button with the 'F' key"

    This seem to be an intentional extra check for longer reach to toggle buttons with the mod keybind - 15 tiles.
    Probably a good idea for such a simple control element, but should probably have an option for range, and be documented as not-a-bug.

  • Another one - "long distance activation with inventory shortcut in map mode".

    This looks like a bug, where on_gui_opened doesn't check which gui it is, and replaces inventory with a button flip.
    I do like this behavior though, as indeed flipping buttons from the map is really nice, even if looks a bit cheaty.

I think easy fix for both is to simply add "switch button range" mod setting and check that in both cases.
I.e. if you prefer buttons to be accessible from anywhere, just put that up to 9999, and if it feels like a cheat, then set it to 0 and let range check fallback to default player.character.can_reach_entity().
Plus mention all this in a mod description, so it won't be a surprise. Will implement that in 0.1.14, I guess.

mk-fg β˜†
3 years ago

Should be fixed.
Default range is "anywhere on the map" 99999 value, to be compatible with earlier behavior, but can be easily changed in mod settings.

New response