require "scripts/style"

kButtonSpacing = 60;	-- Put our buttons 60 pixels apart
kButtonY = kCenter-60;	-- Three buttons means center 60 pixels above the center

-- When this dialog is popped up, we're entering pause state, so
-- let's just notify TGameState now.
SetState( kPause, true );

local sx = 248
local sy = 39

function SendGameMessage( msg )
	if msg=="quit" then
		QuitToMainMenu();
	end
end

MakeDialog
{
	-- Name the modal dialog
	Bitmap
	{
		name="scorescreen",
		image="ui/ingamemenu/_back",
		x=sx,
		y=sy,
		h=652,
		w=528,
		ScoreScreen
		{
			x=0,
			y=0,
			h=652,
			w=528,
		},
		SetStyle(DialogTitleText),
		Text
		{
			font = {
			standardFont,
			  40,
			  BlackColor
			};
			name = "roomcleared",
			x=kCenter,
			y=75,
			w=200,
			h=75,
			flags = kHAlignCenter + kVAlignCenter,
			label = "roomcleared",
		},
		Text
		{
			font = {
			standardFont,
			  40,
			  BlackColor
			};
			name = "your_score",
			x=125,
			y=195,
			w=200,
			h=75,
			flags = kHAlignLeft,
			label = "score",
		},
		Text
		{
			font = {
			standardFont,
			  40,
			  BlackColor
			};
			name = "time_left",
			x=125,
			y=225,
			w=200,
			h=75,
			flags = kHAlignLeft,
			label = "timeleft",
		},
		Text
		{
			font = {
			standardFont,
			  40,
			  BlackColor
			};
			name = "hints_left",
			x=125,
			y=255,
			w=200,
			h=75,
			flags = kHAlignLeft,
			label = "hintsleft",
		},
		Text
		{
			font = {
			standardFont,
			  40,
			  BlackColor
			};
			name = "total_score",
			x=125,
			y=290,
			w=200,
			h=75,
			flags = kHAlignLeft,
			label = "totalscore",
		},
		Text
		{
			font = {
			standardFont,
			  40,
			  BlackColor
			};
			name = "money_earned",
			x=125,
			y=370,
			w=200,
			h=75,
			flags = kHAlignLeft,
			label = "moneyearned",
		},
		SetStyle(ButtonStyle),
		Button
		{
			--x=412-sx,
			y=486-sy,
			x=kCenter,
			--y=kCenter + 80,
			graphics={"ui/ingamemenu/buttons/mainmenu/mainmenu_in","ui/ingamemenu/buttons/mainmenu/mainmenu_ac","ui/ingamemenu/buttons/mainmenu/mainmenu_ac"},
			label="continue",
			command=
				function()
					--SwapToModal("scripts/mainmenu.lua");
					SetGameState("innview");
					SendGameMessage("quit");
					--QuitToMainMenu();
					--saveRoom();		
					--PopModal('check_in_screen');
					--SwapToModal("scripts/mainmenu.lua");	
					
					SetCurrentGameMode(1);					
					--SetState( kPause, false );
				end
		},
	},
}