2017-07-31 05:49:00 -07:00
|
|
|
/**
|
2020-08-24 04:01:25 -07:00
|
|
|
* Initialize the page.
|
2017-07-31 05:49:00 -07:00
|
|
|
*
|
2020-08-24 04:01:25 -07:00
|
|
|
* @param {Object} data - Parameters passed from the code that calls this page into existence.
|
2017-07-31 05:49:00 -07:00
|
|
|
*/
|
2024-09-21 11:24:36 -07:00
|
|
|
function init(data)
|
2017-07-31 05:49:00 -07:00
|
|
|
{
|
2024-09-21 11:24:36 -07:00
|
|
|
const promise = new Promise(closePageCallback => { g_Page = new StructreePage(closePageCallback); });
|
2017-07-31 05:49:00 -07:00
|
|
|
|
2024-09-21 11:24:36 -07:00
|
|
|
if (data?.civ)
|
2020-07-07 12:11:36 -07:00
|
|
|
g_Page.civSelection.selectCiv(data.civ);
|
|
|
|
|
else
|
|
|
|
|
g_Page.civSelection.selectFirstCiv();
|
2024-09-21 11:24:36 -07:00
|
|
|
|
|
|
|
|
return promise;
|
2017-07-31 05:49:00 -07:00
|
|
|
}
|