
require("menu/rules.lua");
require("scripts/game_style.lua");

rules_common_group =
{
	-- Panel
	Bitmap
	{
		name = rules_win_largeframe_params["name"],
		image = rules_win_largeframe_params["image"],
		x = rules_win_largeframe_params["x"],
		y = rules_win_largeframe_params["y"],
	},
	-- Layout
	Bitmap
	{
		name=rules_ico_layoutru_params["name"],
		image=rules_ico_layoutru_params["image"],
		x=rules_ico_layoutru_params["x"],
		y=rules_ico_layoutru_params["y"],
	},
	
	Bitmap
	{
		name = rules_ico_rules_params["name"],
		image = rules_ico_rules_params["image"],
		x = rules_ico_rules_params["x"],
		y = rules_ico_rules_params["y"],
	},
	
	MonopolyButton
	{
		name = rules_btn_menu_rulesreturn_params["name"],
		graphics = rules_btn_menu_rulesreturn_params["graphics"],
		x = rules_btn_menu_rulesreturn_params["x"],
		y = rules_btn_menu_rulesreturn_params["y"],
		label = "return.btn",
		font = White15Font,
		type = kPush,
		
		command = 
			function()
				Return();
			end;
	},
	
	BeginGroup(),
	
	MonopolyButton
	{
		name = "rules_btn_1",
		graphics = rules_btn_intro_01_params["graphics"],
		x = rules_btn_intro_01_params["x"],
		y = rules_btn_intro_01_params["y"],
		label = "intro.tab",
		font = White18Font,
		type = kRadio,
		sfxEx = "eINTERFACE_CLICK_SLIDER",
		sfxOver = 0,
		
		command=
			function()
				SetLabel( "rules.text", GetString("intro.txt") );
				OnRulesTopicBtn();
			end;
	},
	
	MonopolyButton
	{
		name = "rules_btn_2",
		graphics = rules_btn_specbld_01_params["graphics"],
		x = rules_btn_specbld_01_params["x"],
		y = rules_btn_specbld_01_params["y"],
		label = "specbuild.tab",
		font = White18Font,
		type = kRadio,
		sfxEx = "eINTERFACE_CLICK_SLIDER",
		sfxOver = 0,
		
		command=
			function()
				SetLabel( "rules.text", GetString("specbuild.txt"));
				OnRulesTopicBtn();
			end;
	},
	
	MonopolyButton
	{
		name = "rules_btn_3",
		graphics = rules_btn_around_01_params["graphics"],
		x = rules_btn_around_01_params["x"]-2,
		y = rules_btn_around_01_params["y"],
		label = "aroundboard.tab",
		font = White18Font,
		type = kRadio,
		sfxEx = "eINTERFACE_CLICK_SLIDER",
		sfxOver = 0,
		
		command=
			function()
				SetLabel( "rules.text", GetString("arroundboard.txt") );
				OnRulesTopicBtn();
			end;
	},
	
	MonopolyButton
	{
		name = "rules_btn_4",
		graphics = rules_btn_deals_01_params["graphics"],
		x = rules_btn_deals_01_params["x"]-2,
		y = rules_btn_deals_01_params["y"],
		label = "deal.tab",
		font = White18Font,
		type = kRadio,
		sfxEx = "eINTERFACE_CLICK_SLIDER",
		sfxOver = 0,
		
		command=
			function()
				SetLabel( "rules.text", GetString("deal.txt") );
				OnRulesTopicBtn();
			end;
	},
	
	MonopolyButton
	{
		name = "rules_btn_5",
		graphics = rules_btn_bld_01_params["graphics"],
		x = rules_btn_bld_01_params["x"],
		y = rules_btn_bld_01_params["y"],
		label = "build.tab",
		font = White18Font,
		type = kRadio,
		sfxEx = "eINTERFACE_CLICK_SLIDER",
		sfxOver = 0,
		
		command=
			function()
				SetLabel( "rules.text", GetString("build.txt") );
				OnRulesTopicBtn();
			end;
	},
	
	MonopolyButton
	{
		name = "rules_btn_6",
		graphics = rules_btn_others_01_params["graphics"],
		x = rules_btn_others_01_params["x"],
		y = rules_btn_others_01_params["y"],
		label = "other.tab",
		font = White18Font,
		type = kRadio,
		sfxEx = "eINTERFACE_CLICK_SLIDER",
		sfxOver = 0,
		
		command=
			function()
				SetLabel( "rules.text", GetString("other.txt") );
				OnRulesTopicBtn();
			end;
	},
	
	BeginGroup(),
	
	Text
	{
		name = "rules.text",
		font = Green15Font,
		x = rules_txt_ruletext_params["x"],
		y = rules_txt_ruletext_params["y"],
		w = rules_txt_ruletext_params["w"],
		h = rules_txt_ruletext_params["h"] + 120,
		label = "intro.txt",
	},
	
	Bitmap
	{
		name = "btn_arrowdown_static",
		image = "menu/btn_arrowdown_04",
		x = rules_btn_arrowdown_01_params["x"],
		y = rules_btn_arrowdown_01_params["y"],
	},
	Bitmap
	{
		name = "btn_arrowup_static",
		image = "menu/btn_arrowup_04",
		x = rules_btn_arrowup_01_params["x"],
		y = rules_btn_arrowup_01_params["y"],
	},	
	
	AutoRepeatButton
	{
		name = "btn_arrowdown",
		graphics = rules_btn_arrowdown_01_params["graphics"],
		x = rules_btn_arrowdown_01_params["x"],
		y = rules_btn_arrowdown_01_params["y"],
		type = kPush,
		command = 
			function()
				ScrollDown();
			end;
	},
	
	AutoRepeatButton
	{
		name = "btn_arrowup",
		graphics = rules_btn_arrowup_01_params["graphics"],
		x = rules_btn_arrowup_01_params["x"],
		y = rules_btn_arrowup_01_params["y"],
		type = kPush,
		command = 
			function()
				ScrollUp();
			end;
	},
	
	SetStyle(RulesSliderStyle),
	
	SliderEx
	{
		name = "rules.slider",
		x = rules_btn_slider_02_params["x"],
		y = rules_btn_arrowup_01_params["y"] + rules_btn_arrowup_01_params["h"],
		h = 220,
	},
	
	SetStyle(DefaultStyle),
}

rules_group =
{
	RulesMenu
	{
		name="rulesmenu",
		x = 0,
		y = 0,
		w = kMax,
		h = kMax,
		
		Group(rules_common_group);
	}
}