mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
32e5520507
Add registerGlobalGuiPageHotkeys() to common/functions_utility.js to selectively register GUI page hotkeys Allow active GUI pages to close using their corresponding hotkey Move page_hotkeys.xml from gui/hotkeys/ to gui/ Update page_hotkeys.xml references in MainMenuItems and MenuButtons Add default tipScrolling fallback in TipsPage when no initData is provided
18 lines
539 B
JavaScript
18 lines
539 B
JavaScript
/**
|
|
* TODO: better global state handling in the GUI.
|
|
*/
|
|
const g_MapTypes = prepareForDropdown(g_Settings && g_Settings.MapTypes);
|
|
|
|
function init()
|
|
{
|
|
const cache = new MapCache();
|
|
const filters = new MapFilters(cache);
|
|
const browser = new MapBrowser(cache, filters);
|
|
browser.openPage(false);
|
|
browser.controls.MapFiltering.select("default", "skirmish");
|
|
Engine.SetGlobalHotkey("mapbrowser", "Press", () => browser.closePage());
|
|
return new Promise(closePageCallback =>
|
|
{
|
|
browser.registerClosePageHandler(closePageCallback);
|
|
});
|
|
} |