2 using System.Collections.Generic;
5 using System.Xml.Serialization;
7 namespace DirectOutput.FX.TimmedFX
16 private int _DurationActiveMs = 500;
24 public int DurationActiveMs
26 get {
return _DurationActiveMs; }
27 set { _DurationActiveMs = value.Limit(1,
int.MaxValue); }
31 private int _DurationInactiveMs = 500;
39 public int DurationInactiveMs
41 get {
return _DurationInactiveMs; }
42 set { _DurationInactiveMs = value.Limit(1,
int.MaxValue); }
52 public bool Active {
get;
private set; }
55 private bool BlinkEnabled =
false;
56 private bool BlinkState =
false;
57 private int BlinkOrgTableElementDataValue = 1;
58 private Table.TableElementData BlinkTableElementData;
60 private void StartBlinking(Table.TableElementData TableElementData)
64 BlinkTableElementData = TableElementData.Clone();
65 BlinkOrgTableElementDataValue = BlinkTableElementData.Value;
72 private void StopBlinking()
77 private void DoBlink()
79 BlinkState = !BlinkState;
82 BlinkTableElementData.Value = BlinkOrgTableElementDataValue;
83 Table.Pinball.Alarms.RegisterAlarm(DurationActiveMs, DoBlink);
87 BlinkTableElementData.Value = 0;
90 Table.Pinball.Alarms.RegisterAlarm(DurationInactiveMs, DoBlink);
93 TargetEffect.Trigger(BlinkTableElementData);
104 public override void Trigger(Table.TableElementData TableElementData)
106 if (TargetEffect != null)
108 if (TableElementData.Value != 0)
110 StartBlinking(TableElementData);
125 public override void Finish()
129 Table.Pinball.Alarms.UnregisterAlarm(DoBlink);