0ad/binaries/data/mods/mod/gui/modmod/modmodio.js
elexis 86c151ebaa PushGuiPage support for passing a function instead of a function name.
Allows coding the GUI without global functions which break
prototype-oriented coding, refs #5322, fixing the concern in 4b1297b328.

Supports stacked message boxes and removes the according workaround.
Change structree / civinfo switch-dialog code from 760a47335d to perform
the callback for page that actually registered the callback.
Ensure the parent that the callbackhandler is always called if the page
is closed.
Merge PopGuiPage and PopGuiPageCB following that choice, incidentally
leaving cleaner code.

Differential Revision: https://code.wildfiregames.com/D1684
Comments by: Yves, Vladislav, wraitii, leper
This was SVN commit r22676.
2019-08-16 18:46:04 +00:00

30 lines
578 B
JavaScript

function downloadModsButton()
{
initTerms({
"Disclaimer": {
"title": translate("Disclaimer"),
"file": "gui/modio/Disclaimer.txt",
"config": "modio.disclaimer",
"accepted": false,
"callback": openModIo,
"urlButtons": [
{
"caption": translate("mod.io Terms"),
"url": "https://mod.io/terms"
},
{
"caption": translate("mod.io Privacy Policy"),
"url": "https://mod.io/privacy"
}
]
}
});
openTerms("Disclaimer");
}
function openModIo(data)
{
if (data.accepted)
Engine.PushGuiPage("page_modio.xml", {}, initMods);
}