Completed Environment UI effort. Tested with EssentialsHuddleRoom type

This commit is contained in:
Neil Dorin
2018-05-24 09:44:13 -06:00
parent 80377a41d0
commit 3cf188f820
16 changed files with 467 additions and 96 deletions

View File

@@ -14,11 +14,32 @@ namespace PepperDash.Essentials
{
public uint CurrentJoin { get; private set; }
BasicTriList TriList;
BasicTriList TriList;
public BoolFeedback IsShownFeedback;
bool _IsShown;
public bool IsShown
{
get
{
return _IsShown;
}
private set
{
_IsShown = value;
IsShownFeedback.FireUpdate();
}
}
//public BoolFeedback ShownFeedback { get; private set; }
public JoinedSigInterlock(BasicTriList triList)
{
TriList = triList;
IsShownFeedback = new BoolFeedback(new Func<bool>( () => _IsShown));
}
/// <summary>
@@ -31,7 +52,8 @@ namespace PepperDash.Essentials
if (CurrentJoin == join && TriList.BooleanInput[join].BoolValue)
return;
SetButDontShow(join);
TriList.SetBool(CurrentJoin, true);
TriList.SetBool(CurrentJoin, true);
IsShown = true;
}
/// <summary>
@@ -48,7 +70,8 @@ namespace PepperDash.Essentials
if (CurrentJoin > 0)
TriList.BooleanInput[CurrentJoin].BoolValue = false;
CurrentJoin = join;
TriList.BooleanInput[CurrentJoin].BoolValue = true;
TriList.BooleanInput[CurrentJoin].BoolValue = true;
IsShown = true;
}
}
/// <summary>
@@ -67,9 +90,12 @@ namespace PepperDash.Essentials
/// </summary>
public void Hide()
{
Debug.Console(2, "Trilist {0:X2}, interlock hiding {1}", TriList.ID, CurrentJoin);
if (CurrentJoin > 0)
TriList.BooleanInput[CurrentJoin].BoolValue = false;
Debug.Console(2, "Trilist {0:X2}, interlock hiding {1}", TriList.ID, CurrentJoin);
if (CurrentJoin > 0)
{
TriList.BooleanInput[CurrentJoin].BoolValue = false;
IsShown = false;
}
}
/// <summary>
@@ -77,9 +103,12 @@ namespace PepperDash.Essentials
/// </summary>
public void Show()
{
Debug.Console(2, "Trilist {0:X2}, interlock showing {1}", TriList.ID, CurrentJoin);
if (CurrentJoin > 0)
TriList.BooleanInput[CurrentJoin].BoolValue = true;
Debug.Console(2, "Trilist {0:X2}, interlock showing {1}", TriList.ID, CurrentJoin);
if (CurrentJoin > 0)
{
TriList.BooleanInput[CurrentJoin].BoolValue = true;
IsShown = true;
}
}
/// <summary>
@@ -87,9 +116,12 @@ namespace PepperDash.Essentials
/// </summary>
/// <param name="join"></param>
public void SetButDontShow(uint join)
{
if (CurrentJoin > 0)
TriList.BooleanInput[CurrentJoin].BoolValue = false;
{
if (CurrentJoin > 0)
{
TriList.BooleanInput[CurrentJoin].BoolValue = false;
IsShown = false;
}
CurrentJoin = join;
}