mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-12 03:57:27 +00:00
Various tech page framework items
This commit is contained in:
parent
58d22abd5a
commit
b57582feea
14 changed files with 286 additions and 18 deletions
|
|
@ -33,6 +33,12 @@ namespace PepperDash.Essentials.Core.SmartObjects
|
|||
/// </summary>
|
||||
public int MaxCount { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Wrapper for smart object
|
||||
/// </summary>
|
||||
/// <param name="so"></param>
|
||||
/// <param name="useUserObjectHandler">True if the standard user object action handler will be used</param>
|
||||
/// <param name="nameSigOffset">The starting join of the string sigs for the button labels</param>
|
||||
public SmartObjectDynamicList(SmartObject so, bool useUserObjectHandler, uint nameSigOffset) : base(so, useUserObjectHandler)
|
||||
{
|
||||
try
|
||||
|
|
|
|||
|
|
@ -81,21 +81,25 @@ namespace PepperDash.Essentials.Core
|
|||
public static BoolOutputSig SetSigHeldAction(this BasicTriList tl, uint sigNum, uint heldMs, Action heldAction, Action releaseAction)
|
||||
{
|
||||
CTimer heldTimer = null;
|
||||
bool wasHeld = false;
|
||||
return tl.SetBoolSigAction(sigNum, press =>
|
||||
{
|
||||
if (press)
|
||||
{
|
||||
|
||||
wasHeld = false;
|
||||
// Could insert a pressed action here
|
||||
heldTimer = new CTimer(o =>
|
||||
{
|
||||
// if still held and there's an action
|
||||
if (tl.BooleanOutput[sigNum].BoolValue && heldAction != null)
|
||||
{
|
||||
wasHeld = true;
|
||||
// Hold action here
|
||||
heldAction();
|
||||
}
|
||||
}, heldMs);
|
||||
}
|
||||
else if (heldTimer != null) // released
|
||||
else if(!wasHeld) // released
|
||||
{
|
||||
heldTimer.Stop();
|
||||
if (releaseAction != null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue