mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-13 06:55:02 +00:00
d655455304
Ofthen the `messageBox` is only used for confirmation like: "Do you really want to overwrite the savegame?" With this patch the code paths of "overwrite savegame" and "make new savegame" can be combined. In some cases there is nothing done when one button is pressed. That is changed to an early return. Comments by: @Stan Differential Revision: https://code.wildfiregames.com/D5274 This was SVN commit r28191.
41 lines
810 B
JavaScript
41 lines
810 B
JavaScript
function messageBox(width, height, message, title, buttonCaptions)
|
|
{
|
|
return Engine.PushGuiPage(
|
|
"page_msgbox.xml",
|
|
{
|
|
"width": width,
|
|
"height": height,
|
|
"message": message,
|
|
"title": title,
|
|
"buttonCaptions": buttonCaptions
|
|
});
|
|
}
|
|
|
|
function timedConfirmation(width, height, message, timeParameter, timeout, title, buttonCaptions)
|
|
{
|
|
return Engine.PushGuiPage(
|
|
"page_timedconfirmation.xml",
|
|
{
|
|
"width": width,
|
|
"height": height,
|
|
"message": message,
|
|
"timeParameter": timeParameter,
|
|
"timeout": timeout,
|
|
"title": title,
|
|
"buttonCaptions": buttonCaptions
|
|
});
|
|
}
|
|
|
|
function openURL(url)
|
|
{
|
|
Engine.OpenURL(url);
|
|
|
|
messageBox(
|
|
600, 200,
|
|
sprintf(
|
|
translate("Opening %(url)s\n in default web browser. Please wait…"),
|
|
{ "url": url }
|
|
),
|
|
translate("Opening page"));
|
|
}
|