Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/pregame/mainmenu.js
Show All 29 Lines | function init(initData, hotloadData) | ||||
var layerset = g_BackgroundLayerData[g_BackgroundCode]; | var layerset = g_BackgroundLayerData[g_BackgroundCode]; | ||||
for (var i = 0; i < layerset.length; ++i) | for (var i = 0; i < layerset.length; ++i) | ||||
{ | { | ||||
var guiObj = Engine.GetGUIObjectByName("background["+i+"]"); | var guiObj = Engine.GetGUIObjectByName("background["+i+"]"); | ||||
guiObj.hidden = false; | guiObj.hidden = false; | ||||
guiObj.sprite = layerset[i].sprite; | guiObj.sprite = layerset[i].sprite; | ||||
guiObj.z = i; | guiObj.z = i; | ||||
} | } | ||||
// Enable campaign button if we have campaigns available | |||||
if (Object.keys(LoadAvailableCampaigns()).length !== 0) | |||||
{ | |||||
Engine.GetGUIObjectByName("subMenuNewCampaignButton").enabled = true; | |||||
// TODO | |||||
// Engine.GetGUIObjectByName("subMenuLoadCampaignButton").enabled = true; | |||||
elexis: (I didn't leave one of these "I have a patch since 2 years that rewrites this entire file"… | |||||
// Continue if it seems we would be able to. | |||||
Not Done Inline Actionsjust delete these comments please elexis: just delete these comments please | |||||
if (canLoadCurrentCampaign()) | |||||
Done Inline Actionsbutton1.enabled = loadAvailableCampaignTemplates()).length; Ideally the function cannot return true if there aren't campaigns, otherwise we can still add button2.enabled = button1.enabled && canLoad. elexis: button1.enabled = loadAvailableCampaignTemplates()).length;
button2.enabled =… | |||||
Engine.GetGUIObjectByName("subMenuContinueCampaignButton").enabled = true; | |||||
} | |||||
} | } | ||||
function getHotloadData() | function getHotloadData() | ||||
{ | { | ||||
return { "showSplashScreens": g_ShowSplashScreens }; | return { "showSplashScreens": g_ShowSplashScreens }; | ||||
} | } | ||||
function scrollBackgrounds() | function scrollBackgrounds() | ||||
▲ Show 20 Lines • Show All 243 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
(I didn't leave one of these "I have a patch since 2 years that rewrites this entire file" comments yet)