Hi Mattn,
Ah yes, sorry. I should have thought about that. The code below is from the file ui_actions.cpp.
/*
expected usage in .ufo scripts:
forchildin ( panel ) {
}
*/
case EA_FORCHILDIN:
{
uiNode_t* root;
root = UI_GetNodeFromExpression(action->d.nonTerminal.left, context, nullptr);
uiNode_t* node = root->firstChild;
int loop = 0;
while (node != root->lastChild) {
UI_ExecuteActions(action->d.nonTerminal.right, context);
if (context->breakLoop) {
context->breakLoop = false;
break;
}
if (loop > 1000) {
Com_Printf("UI_ExecuteAction: Infinite loop. Force breaking 'forchildin'\n");
break;
}
node = node->next;
loop++;
}
break;
}
Somewhere in the while loop, before UI_ExecuteActions(..) I have to create a variable that can be accessed from within the script that references the current value of node
. The attached 7z contains the modified files.
Regards,
xray