mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 12:44:58 +00:00
Updates to forEach loop sceneIndex to include local sceneIndex context
This commit is contained in:
@@ -99,13 +99,18 @@ namespace PepperDash.Essentials.Core.Lighting
|
|||||||
var sceneIndex = 0;
|
var sceneIndex = 0;
|
||||||
foreach (var scene in lightingDevice.LightingScenes)
|
foreach (var scene in lightingDevice.LightingScenes)
|
||||||
{
|
{
|
||||||
trilist.SetSigTrueAction((uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex), () => lightingDevice.SelectScene(lightingDevice.LightingScenes[sceneIndex]));
|
var index1 = sceneIndex;
|
||||||
|
trilist.SetSigTrueAction((uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex), () =>
|
||||||
|
{
|
||||||
|
var index = index1;
|
||||||
|
Debug.Console(2, this, "LightingDevice: sceneIndex: {0} index: {1} > inside action", index1, index);
|
||||||
|
lightingDevice.SelectScene(lightingDevice.LightingScenes[index]);
|
||||||
|
});
|
||||||
scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex)]);
|
scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex)]);
|
||||||
trilist.StringInput[(uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex)].StringValue = scene.Name;
|
trilist.StringInput[(uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex)].StringValue = scene.Name;
|
||||||
trilist.BooleanInput[(uint)(joinMap.ButtonVisibility.JoinNumber + sceneIndex)].BoolValue = true;
|
trilist.BooleanInput[(uint)(joinMap.ButtonVisibility.JoinNumber + sceneIndex)].BoolValue = true;
|
||||||
sceneIndex++;
|
sceneIndex++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return joinMap;
|
return joinMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user