0ad/binaries/data/mods/public/gui/reference/structree/structree.js
phosit 094a7c2268 Return a promise from most page-inits
Adopt the new interface by all pages which close themself. (Not thous
using `Engine.SwitchGuiPage`.)
2025-03-09 10:39:20 +01:00

16 lines
381 B
JavaScript

/**
* Initialize the page.
*
* @param {Object} data - Parameters passed from the code that calls this page into existence.
*/
function init(data)
{
const promise = new Promise(closePageCallback => { g_Page = new StructreePage(closePageCallback); });
if (data?.civ)
g_Page.civSelection.selectCiv(data.civ);
else
g_Page.civSelection.selectFirstCiv();
return promise;
}