mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-19 14:53:56 -07:00
Summary: Single-player is proper English, single player and singleplayer are less correct. (Contrary to multiplayer, which doesn't have a hyphen or space.) Test Plan: Check for mistakes and omissions. Reviewers: Gallaecio Reviewed By: Gallaecio Subscribers: Freagarach, elexis, O8 JS GUI Differential Revision: https://code.wildfiregames.com/D2312 This was SVN commit r23176.
40 lines
840 B
JavaScript
40 lines
840 B
JavaScript
/**
|
|
* This is the same as a regular MessageBox, but it pauses if it is
|
|
* a single-player game, until the player answered the dialog.
|
|
*/
|
|
class SessionMessageBox
|
|
{
|
|
display()
|
|
{
|
|
this.onPageOpening();
|
|
|
|
Engine.PushGuiPage(
|
|
"page_msgbox.xml",
|
|
{
|
|
"width": this.Width,
|
|
"height": this.Height,
|
|
"title": this.Title,
|
|
"message": this.Caption,
|
|
"buttonCaptions": this.Buttons ? this.Buttons.map(button => button.caption) : undefined,
|
|
},
|
|
this.onPageClosed.bind(this));
|
|
}
|
|
|
|
onPageOpening()
|
|
{
|
|
closeOpenDialogs();
|
|
g_PauseControl.implicitPause();
|
|
}
|
|
|
|
onPageClosed(buttonId)
|
|
{
|
|
if (this.Buttons && this.Buttons[buttonId].onPress)
|
|
this.Buttons[buttonId].onPress.call(this);
|
|
|
|
if (Engine.IsGameStarted())
|
|
resumeGame();
|
|
}
|
|
}
|
|
|
|
SessionMessageBox.prototype.Width = 400;
|
|
SessionMessageBox.prototype.Height = 200;
|