Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/pregame/MainMenuItems.js
var g_MainMenuItems = [ | var g_MainMenuItems = [ | ||||
{ | { | ||||
"caption": translate("Learn to Play"), | "caption": translate("Learn to Play"), | ||||
"tooltip": translate("Learn how to play, start the tutorial, discover the technology trees, and the history behind the civilizations."), | "tooltip": translate("Learn how to play, start the tutorial, discover the technology trees, and the history behind the civilizations."), | ||||
"submenu": [ | "submenu": [ | ||||
{ | { | ||||
"caption": translate("Manual"), | "caption": translate("Manual"), | ||||
"tooltip": translate("Open the 0 A.D. Game Manual."), | "tooltip": translate("Open the 0 A.D. Game Manual."), | ||||
"onPress": () => { | "onPress": () => { | ||||
Engine.PushGuiPage("page_manual.xml"); | g_OverlayCounterManager.hide(true); | ||||
Engine.PushGuiPage("page_manual.xml", {}, () => g_OverlayCounterManager.hide(false)); | |||||
} | } | ||||
}, | }, | ||||
{ | { | ||||
"caption": translate("Tutorial"), | "caption": translate("Tutorial"), | ||||
"tooltip": translate("Start the economic tutorial."), | "tooltip": translate("Start the economic tutorial."), | ||||
"onPress": () => { | "onPress": () => { | ||||
Engine.SwitchGuiPage("page_autostart.xml", { | Engine.SwitchGuiPage("page_autostart.xml", { | ||||
"mapType": "scenario", | "mapType": "scenario", | ||||
▲ Show 20 Lines • Show All 152 Lines • ▼ Show 20 Lines | "submenu": [ | ||||
{ | { | ||||
"caption": translate("Game Lobby"), | "caption": translate("Game Lobby"), | ||||
"tooltip": | "tooltip": | ||||
colorizeHotkey(translate("%(hotkey)s: Launch the multiplayer lobby to join and host publicly visible games and chat with other players."), "lobby") + | colorizeHotkey(translate("%(hotkey)s: Launch the multiplayer lobby to join and host publicly visible games and chat with other players."), "lobby") + | ||||
(Engine.StartXmppClient ? "" : translate("Launch the multiplayer lobby. \\[DISABLED BY BUILD]")), | (Engine.StartXmppClient ? "" : translate("Launch the multiplayer lobby. \\[DISABLED BY BUILD]")), | ||||
"enabled": () => !!Engine.StartXmppClient, | "enabled": () => !!Engine.StartXmppClient, | ||||
"hotkey": "lobby", | "hotkey": "lobby", | ||||
"onPress": () => { | "onPress": () => { | ||||
g_OverlayCounterManager.hide(true); | |||||
if (Engine.StartXmppClient) | if (Engine.StartXmppClient) | ||||
Engine.PushGuiPage("page_prelobby_entrance.xml"); | Engine.PushGuiPage("page_prelobby_entrance.xml", {}, () => g_OverlayCounterManager.hide(false)); | ||||
} | } | ||||
}, | }, | ||||
{ | { | ||||
"caption": translate("Replays"), | "caption": translate("Replays"), | ||||
"tooltip": translate("Playback previous games."), | "tooltip": translate("Playback previous games."), | ||||
"onPress": () => { | "onPress": () => { | ||||
Engine.SwitchGuiPage("page_replaymenu.xml", { | Engine.SwitchGuiPage("page_replaymenu.xml", { | ||||
"replaySelectionData": { | "replaySelectionData": { | ||||
Show All 9 Lines | var g_MainMenuItems = [ | ||||
{ | { | ||||
"caption": translate("Settings"), | "caption": translate("Settings"), | ||||
"tooltip": translate("Change game options."), | "tooltip": translate("Change game options."), | ||||
"submenu": [ | "submenu": [ | ||||
{ | { | ||||
"caption": translate("Options"), | "caption": translate("Options"), | ||||
"tooltip": translate("Adjust game settings."), | "tooltip": translate("Adjust game settings."), | ||||
"onPress": () => { | "onPress": () => { | ||||
Engine.PushGuiPage( | g_OverlayCounterManager.hide(true); | ||||
"page_options.xml", | let callback = (...args) => { | ||||
Lint: prefer-const: 'callback' is never reassigned. Use 'const' instead. | |||||
{}, | fireConfigChangeHandlers(...args); | ||||
fireConfigChangeHandlers); | g_OverlayCounterManager.hide(false); | ||||
}; | |||||
Engine.PushGuiPage( "page_options.xml", {}, callback); | |||||
Lint: space-in-parens There should be no space after this paren. Lint: space-in-parens: There should be no space after this paren. | |||||
} | } | ||||
}, | }, | ||||
{ | { | ||||
"caption": translate("Hotkeys"), | "caption": translate("Hotkeys"), | ||||
"tooltip": translate("Adjust hotkeys."), | "tooltip": translate("Adjust hotkeys."), | ||||
"onPress": () => { | "onPress": () => { | ||||
Engine.PushGuiPage("hotkeys/page_hotkeys.xml"); | g_OverlayCounterManager.hide(true); | ||||
Engine.PushGuiPage("hotkeys/page_hotkeys.xml", {}, () => g_OverlayCounterManager.hide(false)); | |||||
} | } | ||||
}, | }, | ||||
{ | { | ||||
"caption": translate("Language"), | "caption": translate("Language"), | ||||
"tooltip": translate("Choose the language of the game."), | "tooltip": translate("Choose the language of the game."), | ||||
"onPress": () => { | "onPress": () => { | ||||
Engine.PushGuiPage("page_locale.xml"); | g_OverlayCounterManager.hide(true); | ||||
Engine.PushGuiPage("page_locale.xml", {}, () => g_OverlayCounterManager.hide(false)); | |||||
} | } | ||||
}, | }, | ||||
{ | { | ||||
"caption": translate("Mod Selection"), | "caption": translate("Mod Selection"), | ||||
"tooltip": translate("Select and download mods for the game."), | "tooltip": translate("Select and download mods for the game."), | ||||
"onPress": () => { | "onPress": () => { | ||||
Engine.SwitchGuiPage("page_modmod.xml"); | Engine.SwitchGuiPage("page_modmod.xml"); | ||||
} | } | ||||
}, | }, | ||||
{ | { | ||||
"caption": translate("Welcome Screen"), | "caption": translate("Welcome Screen"), | ||||
"tooltip": translate("Show the Welcome Screen again. Useful if you hid it by mistake."), | "tooltip": translate("Show the Welcome Screen again. Useful if you hid it by mistake."), | ||||
"onPress": () => { | "onPress": () => { | ||||
Engine.PushGuiPage("page_splashscreen.xml"); | g_OverlayCounterManager.hide(true); | ||||
Engine.PushGuiPage("page_splashscreen.xml", {}, () => g_OverlayCounterManager.hide(false)); | |||||
} | } | ||||
} | } | ||||
] | ] | ||||
}, | }, | ||||
{ | { | ||||
"caption": translate("Scenario Editor"), | "caption": translate("Scenario Editor"), | ||||
"tooltip": translate('Open the Atlas Scenario Editor in a new window. You can run this more reliably by starting the game with the command-line argument "-editor".'), | "tooltip": translate('Open the Atlas Scenario Editor in a new window. You can run this more reliably by starting the game with the command-line argument "-editor".'), | ||||
"onPress": () => { | "onPress": () => { | ||||
Show All 10 Lines | "onPress": () => { | ||||
translate("The scenario editor is not available or failed to load. See the game logs for additional information."), | translate("The scenario editor is not available or failed to load. See the game logs for additional information."), | ||||
translate("Error")); | translate("Error")); | ||||
} | } | ||||
}, | }, | ||||
{ | { | ||||
"caption": translate("Credits"), | "caption": translate("Credits"), | ||||
"tooltip": translate("Show the 0 A.D. credits."), | "tooltip": translate("Show the 0 A.D. credits."), | ||||
"onPress": () => { | "onPress": () => { | ||||
Engine.PushGuiPage("page_credits.xml"); | g_OverlayCounterManager.hide(true); | ||||
Engine.PushGuiPage("page_credits.xml", {}, () => g_OverlayCounterManager.hide(false)); | |||||
} | } | ||||
}, | }, | ||||
{ | { | ||||
"caption": translate("Exit"), | "caption": translate("Exit"), | ||||
"tooltip": translate("Exit the game."), | "tooltip": translate("Exit the game."), | ||||
"onPress": () => { | "onPress": () => { | ||||
messageBox( | messageBox( | ||||
400, 200, | 400, 200, | ||||
translate("Are you sure you want to quit 0 A.D.?"), | translate("Are you sure you want to quit 0 A.D.?"), | ||||
translate("Confirmation"), | translate("Confirmation"), | ||||
[translate("No"), translate("Yes")], | [translate("No"), translate("Yes")], | ||||
[null, Engine.Exit]); | [null, Engine.Exit]); | ||||
} | } | ||||
} | } | ||||
]; | ]; |
Wildfire Games · Phabricator
'callback' is never reassigned. Use 'const' instead.