B2017-237 Fixed logic to find prevvious sup info step. Used IsCautionPart rather than IsCaution, since BGE has mixed cautuions and notes, The logic was runiing into an infiinite loop since the second note part was a caution, and this was causing the code to loop for the parents notes.

This commit is contained in:
Rich 2017-10-20 13:16:05 +00:00
parent 672cdf7ef4
commit 0be8261cc4

View File

@ -3441,14 +3441,15 @@ namespace Volian.Controls.Library
private EditItem FindFirstChildWithSupInfo(ItemInfo itm)
{
// If on a caution, see if there are any notes below me on the screen that have supinfo.
if (itm.IsCaution && (itm.ActiveParent as ItemInfo).Notes != null && (itm.ActiveParent as ItemInfo).Notes.Count > 0)
// B2017-237 Should use isCautionPart rather than IsCaution for BGE Mixed Cautions and Notes
if (itm.IsCautionPart && (itm.ActiveParent as ItemInfo).Notes != null && (itm.ActiveParent as ItemInfo).Notes.Count > 0)
{
foreach (ItemInfo inote in (itm.ActiveParent as ItemInfo).Notes)
{
if (inote.SupInfos != null && inote.SupInfos.Count > 0)
return GetEditItemFromItemID(inote.ItemID);
if (inote.SupInfos != null && inote.SupInfos.Count > 0)
return GetEditItemFromItemID(inote.ItemID);
EditItem chld = FindFirstChildWithSupInfo(inote);
if (chld != null) return CheckForExpanded(chld);
if (chld != null) return CheckForExpanded(chld);
}
}
// if on a caution or note check the step below me, which is really my activeparent (cautions/notes are above their respective parent)