-- events for main menu

levellongname = ""
majorlevel = ""
minorlevel = ""

T_WEEK = Localize ("Week");
T_DAY = Localize ("Day");

function OnLoad ()

end;


function OnEnter ()
	
    levellongname = GetGameValue ("level_long_name");
    levelshortname = GetGameValue ("level_short_name");

    majorlevel = GetGameValue ("level_major");
    minorlevel = GetGameValue ("level_minor");
    
    SetProperty ("level_number:label.text", levelshortname .. ": " ..levellongname);
    
    -- limit simultaneous sound effect instances for some samples
    
	NX_SetSoundParm ("sfx/icebreak.ogg", "MaxInstances", 1);
	NX_SetSoundParm ("sfx/appear_ice_effect.ogg", "MaxInstances", 1);
	NX_SetSoundParm ("sfx/black-magic-dies.ogg", "MaxInstances", 1);
	NX_SetSoundParm ("sfx/windgust.ogg", "MaxInstances", 1);
	NX_SetSoundParm ("sfx/extinctiondestroys.ogg", "MaxInstances", 5);
	NX_SetSoundParm ("sfx/icebreak.ogg", "MaxInstances", 5);
	
	
	
end;

function OnLeave ()

end;


function OnClick (name)


	if (name == "Menu") then
		PushScreen ("GamePopMenu");
		return;
	end;
	
	if (name == "Pause") then
		PushScreen ("GamePaused");
		return;
	end;
end;


function OnUpdate (tdelta)

	trans = math.sin (0.5*3.1415926535 * GetActiveScreenTransPhase ());
	
	SetProperty ("frames:alpha", trans);

	--SetProperty ("lives:label.text", GetGameValue ("lives"));
	--SetProperty ("tokens:label.text", GetGameValue ("karma_tokens"));
	--SetProperty ("label_bonus_time:label.text", "B Time: " .. GetGameValue ("bonus_level_time_left"));
	--SetProperty ("score:label.text", GetGameValue ("total_score"));
	
end;

function OnDraw ()

end;
