require "scripts/style"

--SetState( kPause, true );

MakeDialog
{
	-- Name the modal dialog
	name="restartVerifyWindow",

	Bitmap
	{
		image="backgrounds/dialog",
		x = kCenter,
		y = kCenter,
		
        SetStyle( DialogTitleText ),
        Text
        {
            font = StandardButtonFontHuge,
            name = "restartTitle",
            x=40,y=35,w=335,h=30,
            flags = kHAlignCenter + kVAlignCenter,
            label = "restart"
        };
        SetStyle( DialogBodyText ),
        Text
        {
            name = "restartDescription",
            x=40,y=80,w=335,h=110,
            flags = kHAlignCenter,
            label = "restartDescription"
        };
        
        SetStyle(LargeEmptyRoundButtonStyle),
        Button
        {
            x = kCenter-70,
            y = kMax-115,
            name="restart",
            label="restart",
            close=true,
			command=
				function()
                    SetState( kPause, false );
                    if(gGameRunning == true) then
                        PopModal("pausemenu");
                        restartButtonPressed(0);
                    end
				end;
        },
        Button
        {
            x = kCenter+70,
            y = kMax-115,
            name="restartAndQuitToMapMenu",
            label="restartToMapMenu",
            --close=true,
			command=
				function()
                    SetState( kPause, false );
                    if(gGameRunning == true) then
                        PopModal("restartVerifyWindow");
                        PopModal("pausemenu");
                        
                        --SetState( kPause, false );
                        restartButtonPressed(1);
                        --SwapToModal('scripts/worldMap.lua');

                        --SendGameMessage( "restart_to_map" );
                    end
	                
                    --SwapToModal('scripts/worldMap.lua');
                    --PopModal("restartVerifyWindow");
                    --PopModal("gamePlayground");
                    --SwapToModal("scripts/worldMap.lua");
                    --SwapToModal("scripts/worldMap.lua");                    
				end;
        },
        SetStyle(SmallEmptyRoundButtonStyle),        
        Button
        {
            x = kCenter,
            y = kMax-75,
            name="Cancel",
            label="cancel",
            --close=true,
            cancel=true,
            --default=true,
			command=
				function()
	                SetState( kPause, false );
                    if(gGameRunning == true) then
                        PopModal("restartVerifyWindow");
                        restartButtonPressed(2);
                    end
				end;
        },        
	},
}


