require( "xsellstyle.lua" );


Game1Graphics = {
	"xsell/game1",
	"xsell/game1_a",
	"xsell/game1_a"
};

Game2Graphics = {
	"xsell/game2",
	"xsell/game2_a",
	"xsell/game2_a"
};

Game3Graphics = {
	"xsell/game3",
	"xsell/game3_a",
	"xsell/game3_a"
};

Game4Graphics = {
	"xsell/game4",
	"xsell/game4_a",
	"xsell/game4_a"
};

Game5Graphics = {
	"xsell/game5",
	"xsell/game5_a",
	"xsell/game5_a"
};

Game6Graphics = {
	"xsell/game6",
	"xsell/game6_a",
	"xsell/game6_a"
};

Game7Graphics = {
	"xsell/game7",
	"xsell/game7_a",
	"xsell/game7_a"
};

SiteGraphics = {
	"xsell/sitebutton",
	"xsell/sitebutton_a",
	"xsell/sitebutton_a"
};

BackButtonGraphics = {
	"xsell/back_button_a",
	"xsell/back_button_b",
	"xsell/back_button_c"
};

DescriptionFont = {
  xsellFontFile,
  xsellSmallFontSize,
  Color(0,0,0,255)
};

CenterFont = {
  xsellFontFile,
  xsellBigFontSize,
  Color(255,255,255,255)
};

xsellBackFont = {
  xsellFontFile,
  xsellBackFontSize,
  Color(101,0,0,255)
};


kWindowWidth = 256;
kWindowHeight = 128;


kDescriptionW = 140;
kDescriptionH = 100;

DescriptionStyle = {
	parent = xsellDescriptionStyle,
	w = kDescriptionW, h = kDescriptionH, 
	flags = kHAlignLeft + kVAlignTop,
	font = DescriptionFont,
};



MakeDialog
{
	name='xselldialog',
	XSellWindow
	{
		x=0,y=0,w=kMax,h=kMax,
		autoexpand=true,
		Bitmap
		{
			name="backgroundimage",
			image="xsell/background",
			x=0,y=0,w=kMax,h=kMax,
			autoscale=true,
			
			Window
			{
				x = kCenter, y = kCenter,
				w = 800, h = 600,
				
				SetStyle(xsellDefaultStyle);
				
				
				Text
				{
					name="centertext1",
					x=150,y=30,
					w = 200, h = 100,
					flags = kHAlignCenter + kVAlignCenter,
					label="",
					font = CenterFont
				},
				
				Text
				{
					name="centertext2",
					x=445,y=30,
					w = 210, h = 100,
					flags = kHAlignCenter + kVAlignCenter,
					label="",
					font = CenterFont
				},
				
				Bitmap
				{
					image = "xsell/playfirstlogo",
					name = "playfirstlogo",
					x=410,y=75
				},
				
				Bitmap
				{
					image = "xsell/sitelogo",
					name = "sitelogo",
					x=610,y=75
				},
				
				
				
				
					
				Button
				{
					x = 220,
					y = 210,
					name = "xsellbutton1",
					graphics = Game1Graphics,
					command = 
						function()
							LaunchGameLink(1);
						end
				};
				
				
				Button
				{
					x = 595,
					y = 210,
					name = "xsellbutton2",
					graphics = Game2Graphics,
					command = 
						function()
							LaunchGameLink(2);
						end
				};
				
					
				Button
				{
					x = 410,
					y = 310,
					name = "xsellbutton3",
					graphics = Game3Graphics,
					command = 
						function()
							LaunchGameLink(3);
						end
				};
				
					
					
				Button
				{
					x = 220,
					y = 450,
					name = "xsellbutton4",
					graphics = Game4Graphics,
					command = 
						function()
							LaunchGameLink(4);
						end
				};
				
				Button
				{
					x = 595,
					y = 450,
					name = "xsellbutton5",
					graphics = Game5Graphics,
					command = 
						function()
							LaunchGameLink(5);
						end
				};
				
				Button
				{
					x = 170,
					y = 426,
					name = "xsellbutton6",
					graphics = Game6Graphics,
					command = 
						function()
							LaunchGameLink(6);
						end
				};
				
					
				Button
				{
					x = 640,
					y = 420,
					name = "xsellbutton7",
					graphics = Game7Graphics,
					command = 
						function()
							LaunchGameLink(7);
						end
				};
				
				Button
				{
					x = 425,
					y = 550,
					name = "gamesite",
					graphics = SiteGraphics,
					command = 
						function()
							LaunchGameLink(0);
						end
				};
				
				SetStyle(DescriptionStyle);
				
				Text
				{
					name="descrip1",
					label="abcdefg",
					x = 160,
					y = 220,
				};

				Text
				{
					name="descrip2",
					label="abcdefg",
					x = 537,
					y = 220,
				};
				
				Text
				{
					name="descrip3",
					label="abcdefg",
					x = 350,
					y = 320,
				};
				
				Text
				{
					name="descrip4",
					label="abcdefg",
					x = 160,
					y = 460,
				};
				
				Text
				{
					name="descrip5",
					label="abcdefg",
					x = 538,
					y = 460,
				};
				
				Text
				{
					name="descrip6",
					label="abcdefg",
					x = 133,
					y = 800,
				};
				
				Text
				{
					name="descrip7",
					label="abcdefg",
					x = 593,
					y = 800,
				};
				
				SetStyle(xsellDefaultStyle);
				
				

				
				Button
				{
					x=20,
					y=545,
					graphics = BackButtonGraphics,
					name="back",
					type = kPush,
					command=
						function()
							PopModal("xselldialog");
						end,
					SelectLayer( kAllLayers ),
					Text
					{
						label = 'back',
						x = 0, y = 0, w = kMax, h = kMax,
						flags = kHAlignCenter + kVAlignCenter,
						font = xsellBackFont,
						
					};
				},
			},
			
				
		},
	},
	
};

SetupXSell();