Index: binaries/data/mods/public/gui/pregame/MainMenuItems.js =================================================================== --- binaries/data/mods/public/gui/pregame/MainMenuItems.js +++ binaries/data/mods/public/gui/pregame/MainMenuItems.js @@ -61,27 +61,50 @@ ] }, { - "caption": translate("Continue Campaign"), + "caption": translate("Campaigns"), "tooltip": translate("Relive history through historical military campaigns."), - "onPress": () => { - try + "submenu": [ { - Engine.SwitchGuiPage(CampaignRun.getCurrentRun().getMenuPath()); - } - catch(err) + "caption": translate("Continue Campaign"), + "tooltip": translate("Continue an already started campaign run."), + "onPress": () => { + try + { + Engine.SwitchGuiPage(CampaignRun.getCurrentRun().getMenuPath()); + } + catch(err) + { + error(translate("Error opening campaign run:")); + error(err.toString()); + } + }, + "enabled": () => CampaignRun.hasCurrentRun() + }, { - error(translate("Error opening campaign run:")); - error(err.toString()); - } - }, - "enabled": () => CampaignRun.hasCurrentRun() + "caption": translate("New Campaign"), + "tooltip": translate("Start a new campaign run."), + "onPress": () => { + Engine.SwitchGuiPage("campaigns/setup/page.xml"); + } + }, + { + "caption": translate("Load Campaign"), + "tooltip": translate("Relive history through historical military campaigns."), + "onPress": () => { + // Switch instead of push, otherwise the 'continue' + // button might remain enabled. + // TODO: find a better solution. + Engine.SwitchGuiPage("campaigns/load_modal/page.xml"); + } + }, + ] }, { "caption": translate("Single-player"), "tooltip": translate("Start, load, or replay a single-player game."), "submenu": [ { - "caption": translate("Matches"), + "caption": translate("New Game"), "tooltip": translate("Start a new single-player game."), "onPress": () => { Engine.SwitchGuiPage("page_gamesetup.xml"); @@ -116,42 +139,9 @@ }); }) }, - { - "caption": translate("Continue Campaign"), - "tooltip": translate("Relive history through historical military campaigns."), - "onPress": () => { - try - { - Engine.SwitchGuiPage(CampaignRun.getCurrentRun().getMenuPath()); - } - catch(err) - { - error(translate("Error opening campaign run:")); - error(err.toString()); - } - }, - "enabled": () => CampaignRun.hasCurrentRun() - }, - { - "caption": translate("New Campaign"), - "tooltip": translate("Relive history through historical military campaigns."), - "onPress": () => { - Engine.SwitchGuiPage("campaigns/setup/page.xml"); - } - }, - { - "caption": translate("Load Campaign"), - "tooltip": translate("Relive history through historical military campaigns."), - "onPress": () => { - // Switch instead of push, otherwise the 'continue' - // button might remain enabled. - // TODO: find a better solution. - Engine.SwitchGuiPage("campaigns/load_modal/page.xml"); - } - }, { "caption": translate("Replays"), - "tooltip": translate("Playback previous games."), + "tooltip": translate("Playback previous single-player games."), "onPress": () => { Engine.SwitchGuiPage("page_replaymenu.xml", { "replaySelectionData": { @@ -168,6 +158,18 @@ "caption": translate("Multiplayer"), "tooltip": translate("Fight against one or more human players in a multiplayer game."), "submenu": [ + { + "caption": translate("Game Lobby"), + "tooltip": + 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]")), + "enabled": () => !!Engine.StartXmppClient, + "hotkey": "lobby", + "onPress": () => { + if (Engine.StartXmppClient) + Engine.PushGuiPage("page_prelobby_entrance.xml"); + } + }, { // Translation: Join a game by specifying the host's IP address. "caption": translate("Join Game"), @@ -187,21 +189,9 @@ }); } }, - { - "caption": translate("Game Lobby"), - "tooltip": - 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]")), - "enabled": () => !!Engine.StartXmppClient, - "hotkey": "lobby", - "onPress": () => { - if (Engine.StartXmppClient) - Engine.PushGuiPage("page_prelobby_entrance.xml"); - } - }, { "caption": translate("Replays"), - "tooltip": translate("Playback previous games."), + "tooltip": translate("Playback previous multiplayer games."), "onPress": () => { Engine.SwitchGuiPage("page_replaymenu.xml", { "replaySelectionData": {