StartTimer()
-------------------------------------------------------
-- Resources loading
-------------------------------------------------------
LoadResource("fonts.xml")	-- 0.8
LoadText("text.xml")
--LoadResource("Animations/AnimationResources.xml")
LoadResource("GUI/MainMenu/MainMenuResources.xml")
LoadResource("GUI/Resources.xml")
LoadResource("Music.xml")
LoadResource("Sound.xml")
LoadResource("Game/GameResources.xml")	-- 0.28 all

if not gameInfo:IsScreenSaverMode() then
	LoadResource("Tutorial/TutorialResources.xml")
	LoadResource("GUI/Bonus/BonusResources.xml")
	LoadResource("GUI/PremiumVersion/PremiumVersionResources.xml")
	LoadResource("GUI/MoreGames/MoreGamesResources.xml")
	LoadResource("GUI/CGuide/CGuideResources.xml")
	LoadResource("GUI/Credits/CreditsResoruces.xml")
	LoadResource("GUI/Achievements/AchievementsResources.xml")
	LoadResource("GUI/Statistics/StatisticsResources.xml")
	LoadResource("GUI/LayerLoadFade/LayerLoadFadeResources.xml")
	LoadResource("GUI/GameMap/GameMapResources.xml")
end

LoadResource("GUI/MorphingEditor/MorphingEditorResources.xml")
morphMap:Load("MorphersDB.xml")

-------------------------------------------------------
-- Particle Effects loading
-------------------------------------------------------
StartTimer()
LoadEffectsGroup("GUI/MainMenu/MainMenuEffects.pbi", "Common")
LoadEffectsGroup("Game/CommonEffects.pbi", "Common")
if not gameInfo:IsScreenSaverMode() then
	LoadEffectsGroup("Game/GameEffects.pbi", "Common")
	LoadEffectsGroup("GUI/GameMap/GameMapEffects.pbi", "Common")
	LoadEffectsGroup("Tutorial/TutorialEffects.pbi", "Common")
end
GetTime("Effects ")
-- hack, preventing long load of main menu at first start
UploadResourceGroup("GameWorker")
UploadResourceGroup("GameTaxer")
if not gameInfo:IsScreenSaverMode() then
	UploadResourceGroup("GameTutorial")
end
-- all effects - 2.5 -> 0.9
UploadResourceGroup("Common")
-------------------------------------------------------
-- Layers loading
-------------------------------------------------------
GUI:LoadLayers("GUI/Common.xml")
GUI:LoadLayers("local/GUI/MainMenu/MainMenu.xml")
if not gameInfo:IsScreenSaverMode() then
	GUI:LoadLayers("local/GUI/LayerLoadFade/LayerLoadFade.xml")
	GUI:LoadLayers("GUI/Profiles.xml")
	GUI:LoadLayers("GUI/ExitConfirm.xml")
	GUI:LoadLayers("GUI/Options.xml")
	GUI:LoadLayers("GUI/Intro.xml")
	GUI:LoadLayers("local/GUI/GameMap/GameMap.xml")
	GUI:LoadLayers("GUI/GameMenu.xml")
	GUI:LoadLayers("Game/GameGUI.xml")
	GUI:LoadLayers("Tutorial/Tutorial.xml")
	GUI:LoadLayers("GUI/Statistics/Statistics.xml")
	GUI:LoadLayers("GUI/Achievements/Achievements.xml")
	GUI:LoadLayers("GUI/MoreGames/MoreGames.xml")
	GUI:LoadLayers("GUI/MorphingEditor/MorphEd_GUI.xml")
	GUI:LoadLayers("GUI/PremiumVersion/PremiumVersion.xml")
	GUI:LoadLayers("GUI/Bonus/Bonus.xml")
	GUI:LoadLayers("GUI/CGuide/CGuide.xml")
	GUI:LoadLayers("GUI/Credits/Credits.xml")
	GUI:LoadLayers("GUI/LastVideo/LastVideo.xml")
end
-------------------------------------------------------
-- Layers Initialization
-------------------------------------------------------
local sndVolume = gameInfo:getSoundVolume()
local musVolume = gameInfo:getMusicVolume()
Sound:SetSoundVolume(sndVolume)
Sound:SetMusicVolume(musVolume)

if not gameInfo:IsScreenSaverMode() then
	GUI:getLayer("Game"):getWidget("Game"):AcceptMessage(Message("Init"))
	GUI:getLayer("Credits"):getWidget("Credits"):AcceptMessage(Message("Init"))
	tutorial:init()
end

if not gameInfo:NoPlayers() and not gameInfo:IsScreenSaverMode() then
	local namesWidget = GUI:getLayer("Profiles"):getWidget("A_ListBoxPanel"):getChild("Names")
	local numOfPlayers = gameInfo:getNumberOfPlayers()-1
	for i = 0, numOfPlayers do
		local playerName = gameInfo:getPlayerName(i)
		namesWidget:AcceptMessage(Message("Add", playerName))
	end
	namesWidget:AcceptMessage(Message("Set", gameInfo:getName()))
end

------------------------------------------------------
-- Game begin
-------------------------------------------------------
if not gameInfo:IsScreenSaverMode() then
	GUI:getLayer("GameMap"):getWidget("GameMap"):AcceptMessage(Message("InitAnim"))
end

GetTime("All Start.lua ")