
require "scripts/style"
require "scripts/characters/drd"

ButtonsList = {};


PlanFont = {
  standardFont,
  20,
  WhiteColor
};

-- which handles them in C++.
function SendScriptMessage( msg, data )
	if msg=="back" then
    SwapToModal("scripts/mapmenu.lua");							
	end
	if msg=="planstart" then
				-- Switch to the appropriate screen
        SendModalMessage("startplan",0);	
				SwapToModal("scripts/planmetamenu.lua");												
	end
end

MakeDialog
{
	-- Name the modal dialog
	name="planmenu",
	PlanMenu
	{
    font = StandardButtonFont,    
    partw = 90,
		fit=true,
		textspeed=25, --chars per second
		
			Bitmap
		{
			name="backgroundimage",
			image="planscreen/plan_intro_screen_bg",
			
      Bitmap
      {
        name="projection",        
        x=0, y=0, w=800, h=520,
        Bitmap
        {
          name="rays",
          x=0, y=0, 
          image="planscreen/projection_rays",
        },
			Bitmap
			{
        name="plan",
        image="planscreen/text_box",
        x=0, y=40,
        
        AnimSprite
        {
          name='slide',
          -- NOTE: if you move this down the static doesn't fit correctly.
          --  if you find that images are overlapping the text, edit the image
          --  so the image sits a little lower with white space up top, or use
          --  the "vpos" tag in the slidedata.xml to shift it down.
          x=240,y=220,-- from the center
          w=10, h=10,
          
          animations={
            { key="idle", texture="", animation="", default=1},
            { key="static", texture="planscreen/static", animation="main", next="idle"},
          },
        },  
        Text
        {
          font = PlanFont,
          name = "plantext",
          x=50,y=50,w=370,h=580,
          flags = kHAlignLeft + kVAlignTop,				
        },        
              
			},
			MakeDrD(467, -15),	
			},
			 
			
			
      AnimSprite
      {
          name='maggie',
          -- NOTE: if you move this down the static doesn't fit correctly.
          --  if you find that images are overlapping the text, edit the image
          --  so the image sits a little lower with white space up top, or use
          --  the "vpos" tag in the slidedata.xml to shift it down.
          x=420, y=500,          
          preload=true,
          animations={                                 
            { key="wait", texture="planscreen/maggie/maggie_deed_wait", animation="main", default=1},
            { key="idle1a", texture="planscreen/maggie/maggie_deed_idle_01_a", animation="main", next="idle1b"},
            { key="idle1b", texture="planscreen/maggie/maggie_deed_idle_01_b", animation="main", next="idle1c"},
            { key="idle1c", texture="planscreen/maggie/maggie_deed_idle_01_c", animation="main", next="idle1d"},
            { key="idle1d", texture="planscreen/maggie/maggie_deed_idle_01_d", animation="main"},
            { key="idle2a", texture="planscreen/maggie/maggie_deed_idle_02_a", animation="main", next="idle2b"},
            { key="idle2b", texture="planscreen/maggie/maggie_deed_idle_02_b", animation="main"},     
            { key="idle3a", texture="planscreen/maggie/maggie_deed_idle_03_a", animation="main", next="idle3b"},
            { key="idle3b", texture="planscreen/maggie/maggie_deed_idle_03_b", animation="main"},
            { key="talking1a", texture="planscreen/maggie/maggie_talking_01_a", animation="main", next="talking1b"},
            { key="talking1b", texture="planscreen/maggie/maggie_talking_01_b", animation="main", next="talking1c"},
            { key="talking1c", texture="planscreen/maggie/maggie_talking_01_c", animation="main"},
            { key="talking2a", texture="planscreen/maggie/maggie_talking_02_a", animation="main", next="talking2b"},
            { key="talking2b", texture="planscreen/maggie/maggie_talking_02_b", animation="main"},           
            { key="talking3a", texture="planscreen/maggie/maggie_talking_03_a", animation="main", next="talking3b"},
            { key="talking3b", texture="planscreen/maggie/maggie_talking_03_b", animation="main"},
            { key="talking4a", texture="planscreen/maggie/maggie_talking_04", animation="main"},            
            { key="talking5a", texture="planscreen/maggie/maggie_talking_05", animation="main" },
            { key="talking6a", texture="planscreen/maggie/maggie_talking_06", animation="main"},            
            { key="talking7a", texture="planscreen/maggie/maggie_talking_07", animation="main"},
            { key="talking8a", texture="planscreen/maggie/maggie_talking_08", animation="main"},            
          },
      },  
			
			
				
			SetStyle(LongButtonStyle),			
     
			
			
			
			
			AnimButton
      {
        x=400,
				y=580,
				name="continue",
				label="continue",
				font = {
          standardFont,
          18,
          BlackColor
        },
        animations={
          { key="normal", texture="buttons/long_button_up", animation="main", default=1},        
          { key="down", texture="buttons/long_button_down", animation="main"},
          { key="hover", texture="buttons/long_button_over", animation="main"},
          { key="disabled", texture="buttons/buttondisabled", animation="main"},
        },
        sound=kDefaultButtonSound,
        rolloversound=kDefaultButtonHoverSound,
				command=
				function()
				   SendScriptMessage( "planstart" );	      
				end			
      },
      
			
			SetStyle(ButtonStyle),
			Button
			{
				x=7,
				y=562,
				name="back",
				label="back",
				type = kPush,							
				command=
				function()
				   SendScriptMessage( "back" );	      
				end
				
			},
			
		},
		
	
	}
}