-- Main game loop
require ( "scripts/game_sector_loading.lua" );

kQuitConfirmShowed = true;
kPauseDlgShowAllowed = true;
kSwapToGame=false;
kCutScene1Showed=false;
kFaceBookOverrides = false;

kSkipTutorialShowed = false;

kOptionsShowed = false;

--[[ kQuitConfirmShowed = false;
 global variable to control displaying of quit confirmation dialog
 used in quitverify.lua
--]]
--[[ kPauseDlgShowAllowed = true;
 global variable to control displaying of pause dialog
 used in garden_X.lua, sell_screen.lua
--]]

function Main()

	DisplaySplash(
		"splash/playfirst_animated_logo.swf",
		"splash/playfirst_logo",4000
		);
    DisplaySplash("", "splash/aliasworlds_logo",4000);
	DisplaySplash("", "splash/distributor_logo",4000);

    LoadMainMenuSilent();

	-- Push the game selection screen
	while true do
        kQuitConfirmShowed = false;
        DoMainWindow("scripts/mainmenu.lua");
		-- DoMainWindow will exit only if there are NO windows pushed on the stack, so
		-- a PopModal()/PushModal() combination will not cause this to loop.
	end
end

-- Return a function to be executed in a thread
return Main