Stormworks: Build and Rescue

Stormworks: Build and Rescue

Not enough ratings
2Way Push Button
   
Award
Favorite
Favorited
Unfavorite
Tags: v1.8.2
File Size
Posted
Updated
83.169 KB
Jun 28, 2023 @ 9:12pm
Jun 29, 2023 @ 12:02am
3 Change Notes ( view )

Subscribe to download
2Way Push Button

Description
【Translated from DeepL】
This is a sample of a push button that can be used 2-way.

A short press on the center push button turns the left light on and off.
Press and hold the push button for 1 second to turn the right light on and off.

Use one button for two-step operation, or use only the long push button to prevent malfunctions, etc.
If you want to change the time for the long press judgment, change the time at the top of the Lua code.

Default: "pushtime = 60 --Long press judgment time(tick)".

The default "60" is the tick value.
On average, 1 tick is 1/60th of a second, so 60 ticks is about 1 second.
For example, if you want to set the long press judgment time to about 2 seconds, use "pushtime = 120 --Long press judgment time(tick)".

If you require only the malfunction prevention button function, please refer to the following
https://steamcommunity.com/sharedfiles/filedetails/?id=2996158668