
dofile ( "hud/auction.lua" );
dofile ( "hud/auctiondistrict.lua" );
dofile ( "hud/bidpopup.lua" );
dofile ( "hud/auctionwin.lua" );

OFFSET_MOVERS_X = 3;
OFFSET_MOVERS_Y = 3;

auctiondialog_group = 
{
	AuctionDialog
	{
		name = "auctiondialog",
		x = 0,
		y = 0,
		w = kMax,
		h = kMax,
		
		card_x = auction_ico_largecard_params["x"],
		card_y = auction_ico_largecard_params["y"],

		-- Panel
		Bitmap	
		{
			name = "auction_panel",	
			image=auction_win_medframeau_params["image"],
			x=auction_win_medframeau_params["x"],
			y=auction_win_medframeau_params["y"],
		},		
		
		Text
		{
			name = "auction_title",
			font = Green15Font,
			x = auction_txt_auction_params["x"]-10,
			y = auction_txt_auction_params["y"]-10,
			w = auction_txt_auction_params["w"]+20,
			h = auction_txt_auction_params["h"]+20,
			flags = kHAlignCenter + kVAlignCenter,
			label = "auctiontitle"
		},

--[[			
		-- Timer
		Text
		{
			name = "time_text",
			font = Green12Font,
			x = auction_txt_timerem_params["x"]-10,
			y = auction_txt_timerem_params["y"]-10,
			w = auction_txt_timerem_params["w"]+20,
			h = auction_txt_timerem_params["h"]+20,
			flags = kHAlignCenter + kVAlignCenter,
			label = "timeremaining"
		},
		Text
		{
			name = "time_value",
			font = Green12Font,
			x = auction_txt_time_params["x"]-10,
			y = auction_txt_time_params["y"]-10,
			w = auction_txt_time_params["w"]+20,
			h = auction_txt_time_params["h"]+20,
			flags = kHAlignCenter + kVAlignCenter,
			label = ""
		},
--]]		

		-- Highest bid
		Bitmap
		{
			name = "highestbid_frame",
			image="hud/ico_bidframe_01",
			x = auction_ico_bidframe_01_params["x"],
			y = auction_ico_bidframe_01_params["y"],
		},
		
		
		-- Next bid
		Text
		{
			name = "nextbid_text",
			font = Green12Font,
			x = auction_txt_nextbid_params["x"],
			y = auction_txt_nextbid_params["y"]-10,
			w = auction_txt_nextbid_params["w"]+20,
			h = auction_txt_nextbid_params["h"]+20,
			flags = kHAlignLeft + kVAlignCenter,
			label = "ui.auction.nextbid"
		},
		Text
		{
			name = "nextbid_value",
			font = Green12Font,
			x = auction_txt_nextbid_params["x"]-24,
			y = auction_txt_nextbid_params["y"]-10,
			w = auction_txt_nextbid_params["w"]+20,
			h = auction_txt_nextbid_params["h"]+20,
			flags = kHAlignRight + kVAlignCenter,
			label = ""
		},
		
		Bitmap
		{
			name = "highestbid_mover",
			image="menu/ico_splayericon_h",
			x = auction_ico_bidframe_01_params["x"]-OFFSET_MOVERS_X,
			y = auction_ico_bidframe_01_params["y"]-OFFSET_MOVERS_Y,
		},
		
		Text
		{
			name = "highestbid_text",
			font = RedHBidFont,
			x = auction_txt_highestbid_params["x"]-10,
			y = auction_txt_highestbid_params["y"]-10,
			w = auction_txt_highestbid_params["w"]+20,
			h = auction_txt_highestbid_params["h"]+20,
			flags = kHAlignCenter + kVAlignCenter,
			label = "ui.auction.highestbid"
		},
		Text
		{
			name = "highestbid_value",
			font = RedHBidBigFont,
			x = auction_txt_bid_params["x"]-10,
			y = auction_txt_bid_params["y"]-10,
			w = auction_txt_bid_params["w"]+20,
			h = auction_txt_bid_params["h"]+20,
			flags = kHAlignCenter + kVAlignCenter,
			label = ""
		},
		
		-- Auction buttons
		Bitmap
		{
			name = "slot1_disabled",
			image="hud/btn_redslot_01",
			x = auction_btn_redslot_01_params["x"],
			y = auction_btn_redslot_01_params["y"],
		},
		MonopolyButton
		{
			name="btn_slot1",
			graphics = auction_btn_redslot_01_params["graphics"],
			x = auction_btn_redslot_01_params["x"],
			y = auction_btn_redslot_01_params["y"],
			label="",
			command=
				function()
					OnAuctionButtonBid(0);
				end;
		},
		
		Bitmap
		{
			name = "slot1_mover",
			image="hud/ico_splayericon",
			x = auction_btn_redslot_01_params["x"]-OFFSET_MOVERS_X,
			y = auction_btn_redslot_01_params["y"]-OFFSET_MOVERS_Y,
		},
		
		Text
		{
			name = "slot1_bidtext",
			font = RedBidFont,
			x = auction_txt_bidred_params["x"]-10,
			y = auction_txt_bidred_params["y"]-10,
			w = auction_txt_bidred_params["w"]+20,
			h = auction_txt_bidred_params["h"]+20,
			flags = kHAlignCenter + kVAlignCenter,
			label = ""
		},
		Text
		{
			name = "slot1_presstext",
			font = RedPressFont,
			x = auction_txt_pressred_params["x"]-10,
			y = auction_txt_pressred_params["y"]-10,
			w = auction_txt_pressred_params["w"]+20,
			h = auction_txt_pressred_params["h"]+20,
			flags = kHAlignCenter + kVAlignCenter,
			label = "ui.auction.key.1"
		},

		
		Bitmap
		{
			name = "slot2_disabled",
			image="hud/btn_greenslot_01",
			x = auction_btn_greenslot_01_params["x"],
			y = auction_btn_greenslot_01_params["y"],
		},
		MonopolyButton
		{
			name="btn_slot2",
			graphics = auction_btn_greenslot_01_params["graphics"],
			x = auction_btn_greenslot_01_params["x"],
			y = auction_btn_greenslot_01_params["y"],
			label="",
			command=
				function()
					OnAuctionButtonBid(1);
				end;
		},
		
		Bitmap
		{
			name = "slot2_mover",
			image="hud/ico_splayericon",
			x = auction_btn_greenslot_01_params["x"]-OFFSET_MOVERS_X,
			y = auction_btn_greenslot_01_params["y"]-OFFSET_MOVERS_Y,
		},
		
		Text
		{
			name = "slot2_bidtext",
			font = GreenBidFont,
			x = auction_txt_bidgreen_params["x"]-10,
			y = auction_txt_bidgreen_params["y"]-10,
			w = auction_txt_bidgreen_params["w"]+20,
			h = auction_txt_bidgreen_params["h"]+20,
			flags = kHAlignCenter + kVAlignCenter,
			label = ""
		},
		Text
		{
			name = "slot2_presstext",
			font = GreenPressFont,
			x = auction_txt_pressgreen_params["x"]-10,
			y = auction_txt_pressgreen_params["y"]-10,
			w = auction_txt_pressgreen_params["w"]+20,
			h = auction_txt_pressgreen_params["h"]+20,
			flags = kHAlignCenter + kVAlignCenter,
			label = "ui.auction.key.2"
		},
		
		Bitmap
		{
			name = "slot3_disabled",
			image="hud/btn_yellowslot_01",
			x = auction_btn_yellowslot_01_params["x"],
			y = auction_btn_yellowslot_01_params["y"],
		},
		MonopolyButton
		{
			name="btn_slot3",
			graphics = auction_btn_yellowslot_01_params["graphics"],
			x = auction_btn_yellowslot_01_params["x"],
			y = auction_btn_yellowslot_01_params["y"],
			label="",
			command=
				function()
					OnAuctionButtonBid(2);
				end;
		},
		
		Bitmap
		{
			name = "slot3_mover",
			image="hud/ico_splayericon",
			x = auction_btn_yellowslot_01_params["x"]-OFFSET_MOVERS_X,
			y = auction_btn_yellowslot_01_params["y"]-OFFSET_MOVERS_Y,
		},
		
		Text
		{
			name = "slot3_bidtext",
			font = YellowBidFont,
			x = auction_txt_bidyellow_params["x"]-10,
			y = auction_txt_bidyellow_params["y"]-10,
			w = auction_txt_bidyellow_params["w"]+20,
			h = auction_txt_bidyellow_params["h"]+20,
			flags = kHAlignCenter + kVAlignCenter,
			label = ""
		},
		Text
		{
			name = "slot3_presstext",
			font = YellowPressFont,
			x = auction_txt_pressyellow_params["x"]-10,
			y = auction_txt_pressyellow_params["y"]-10,
			w = auction_txt_pressyellow_params["w"]+20,
			h = auction_txt_pressyellow_params["h"]+20,
			flags = kHAlignCenter + kVAlignCenter,
			label = "ui.auction.key.3"
		},
		
		Bitmap
		{
			name = "slot4_disabled",
			image="hud/btn_blueslot_01",
			x = auction_btn_blueslot_01_params["x"],
			y = auction_btn_blueslot_01_params["y"],
		},
		MonopolyButton
		{
			name="btn_slot4",
			graphics = auction_btn_blueslot_01_params["graphics"],
			x = auction_btn_blueslot_01_params["x"],
			y = auction_btn_blueslot_01_params["y"],
			label="",
			command=
				function()
					OnAuctionButtonBid(3);
				end;
		},
		
		Bitmap
		{
			name = "slot4_mover",
			image="hud/ico_splayericon",
			x = auction_btn_blueslot_01_params["x"]-OFFSET_MOVERS_X,
			y = auction_btn_blueslot_01_params["y"]-OFFSET_MOVERS_Y,
		},
		
		Text
		{
			name = "slot4_bidtext",
			font = BlueBidFont,
			x = auction_txt_bidblue_params["x"]-10,
			y = auction_txt_bidblue_params["y"]-10,
			w = auction_txt_bidblue_params["w"]+20,
			h = auction_txt_bidblue_params["h"]+20,
			flags = kHAlignCenter + kVAlignCenter,
			label = ""
		},
		Text
		{
			name = "slot4_presstext",
			font = BluePressFont,
			x = auction_txt_pressblue_params["x"]-10,
			y = auction_txt_pressblue_params["y"]-10,
			w = auction_txt_pressblue_params["w"]+20,
			h = auction_txt_pressblue_params["h"]+20,
			flags = kHAlignCenter + kVAlignCenter,
			label = "ui.auction.key.4"
		},

	},
}


bidpopup_group = 
{
	Window
	{
		name = "bidpopupdialog",
		x = 0,
		y = 0,
		w = kMax,
		h = kMax,
	

		
		Bitmap
		{
			name = "bidpopup_panel",
			image = auctiondistrict_win_medframead_params["image"],
			x = auctiondistrict_win_medframead_params["x"],
			y = auctiondistrict_win_medframead_params["y"],
		},
					
		Text
		{
			name = "bidauction_title",
			font = Green15Font,
			x = auction_txt_auction_params["x"]-10,
			y = auction_txt_auction_params["y"]-10,
			w = auction_txt_auction_params["w"]+20,
			h = auction_txt_auction_params["h"]+20,
			flags = kHAlignCenter + kVAlignCenter,
			label = "auctiontitle"
		},
		
		-- Auction this district ?
		Text
		{
			name = "auction_this_district",
			font = Green15Font,
			x = auctiondistrict_txt_auctionthisdistrict_params["x"]-10,
			y = auctiondistrict_txt_auctionthisdistrict_params["y"]-10,
			w = auctiondistrict_txt_auctionthisdistrict_params["w"]+20,
			h = auctiondistrict_txt_auctionthisdistrict_params["h"]+20,
			flags = kHAlignCenter + kVAlignCenter,
			label = "auction.txt"
		},		
		
		-- Price :
		Text
		{
			name = "auction_price",
			font = Green15Font,
			x = auctiondistrict_txt_price_params["x"]-10,
			y = auctiondistrict_txt_price_params["y"]-10,
			w = auctiondistrict_txt_price_params["w"]+20,
			h = auctiondistrict_txt_price_params["h"]+20,
			flags = kHAlignCenter + kVAlignCenter,
			label = "district.price"
		},
		
		-- : Amount
		Text
		{
			name = "auction_amount",
			font = Green15Font,
			x = auctiondistrict_txt_priceamt_params["x"]-10,
			y = auctiondistrict_txt_priceamt_params["y"]-10,
			w = auctiondistrict_txt_priceamt_params["w"]+20,
			h = auctiondistrict_txt_priceamt_params["h"]+20,
			flags = kHAlignCenter + kVAlignCenter,
			label = ""
		},		
		
		Text
		{
			name = "bidpopup_title",
			font = Green15Font,
			x = auctiondistrict_txt_startingbid_params["x"]-10,
			y = auctiondistrict_txt_startingbid_params["y"]-10,
			w = auctiondistrict_txt_startingbid_params["w"]+20,
			h = auctiondistrict_txt_startingbid_params["h"]+20,
			flags = kHAlignCenter + kVAlignCenter,
			label = "startingbid"
		},
		Text
		{
			name = "bidpopup_valueM",
			font = Green15Font,
			x = auctiondistrict_txt_millions_params["x"]-20,
			y = auctiondistrict_txt_millions_params["y"]-9,
			w = auctiondistrict_txt_millions_params["w"]+20,
			h = auctiondistrict_txt_millions_params["h"]+20,
			flags = kHAlignRight + kVAlignCenter,
			label = ""
		},
		Text
		{
			name = "bidpopup_valueK",
			font = Green15Font,
			x = auctiondistrict_txt_thousands_params["x"],
			y = auctiondistrict_txt_thousands_params["y"]-9,
			w = auctiondistrict_txt_thousands_params["w"]+20,
			h = auctiondistrict_txt_thousands_params["h"]+20,
			flags = kHAlignLeft + kVAlignCenter,
			label = ""
		},
		AutoRepeatButton
		{
			name="btn_plusM",
			graphics = auctiondistrict_btn_arrowup_01_params["graphics"],
			x = auctiondistrict_btn_arrowup_01_params["x"],
			y = auctiondistrict_btn_arrowup_01_params["y"],
			label="",
			command=
				function()
					OnAuctionButtonInitialBid(1000);
				end;
		},
		AutoRepeatButton
		{
			name="btn_minusM",
			graphics = auctiondistrict_btn_arrowdown_01_params["graphics"],
			x = auctiondistrict_btn_arrowdown_01_params["x"],
			y = auctiondistrict_btn_arrowdown_01_params["y"],
			label="",
			command=
				function()
					OnAuctionButtonInitialBid(-1000);
				end;
		},
		AutoRepeatButton
		{
			name="btn_plusK",
			graphics = auctiondistrict_btn_arrowup_02_params["graphics"],
			x = auctiondistrict_btn_arrowup_02_params["x"],
			y = auctiondistrict_btn_arrowup_02_params["y"],
			label="",
			command=
				function()
					OnAuctionButtonInitialBid(10);
				end;
		},
		AutoRepeatButton
		{
			name="btn_minusK",
			graphics = auctiondistrict_btn_arrowdown_02_params["graphics"],
			x = auctiondistrict_btn_arrowdown_02_params["x"],
			y = auctiondistrict_btn_arrowdown_02_params["y"],
			label="",
			command=
				function()
					OnAuctionButtonInitialBid(-10);
				end;
		},
		MonopolyButton
		{
			name="btn_startauction",
			graphics = auctiondistrict_btn_menu_adauction_params["graphics"],
			x = auctiondistrict_btn_menu_adauction_params["x"],
			y = auctiondistrict_btn_menu_adauction_params["y"],
			label="startauction.btn",
			font = White12Font,
			command=
				function()
					OnAuctionButtonStart();
				end;
		},
		Bitmap
		{
			name = "btn_return_disabled",
			image="hud/btn_menu_04",
			x = auctiondistrict_btn_menu_chooseagain_params["x"],
			y = auctiondistrict_btn_menu_chooseagain_params["y"],
		},
		MonopolyButton
		{
			name="btn_return",
			graphics = auctiondistrict_btn_menu_chooseagain_params["graphics"],
			x = auctiondistrict_btn_menu_chooseagain_params["x"],
			y = auctiondistrict_btn_menu_chooseagain_params["y"],
			label="",
			font = White12Font,
			command=
				function()
					OnAuctionButtonReturn();
				end;
		},
		Text
		{
			name = "btn_return_text",
			font = White12Font,
			x = auctiondistrict_txt_chooseagain_params["x"]-10,
			y = auctiondistrict_txt_chooseagain_params["y"]-10,
			w = auctiondistrict_txt_chooseagain_params["w"]+20,
			h = auctiondistrict_txt_chooseagain_params["h"]+20,
			flags = kHAlignCenter + kVAlignCenter,
			label = "chooseagain.btn"
		},

	},

}

auctionwin_group = 
{
	Window
	{
		name = "auctionwindialog",
		x = 0,
		y = 0,
		w = kMax,
		h = kMax,
	
		
		Bitmap
		{
			name = "auctionwin_panel",
			image = auctionwin_win_smallframeaw_params["image"],
			x = auctionwin_win_smallframeaw_params["x"],
			y = auctionwin_win_smallframeaw_params["y"],
		},
					
		Text
		{
			name = "auctionwin_title",
			font = Green15Font,
			x = auctionwin_txt_auctionend_params["x"]-10,
			y = auctionwin_txt_auctionend_params["y"]-10,
			w = auctionwin_txt_auctionend_params["w"]+20,
			h = auctionwin_txt_auctionend_params["h"]+20,
			flags = kHAlignCenter + kVAlignCenter,
			label = "ui.auction.ended"
		},

		Bitmap
		{
			name = "auctionwin_playericon",
			image = auctionwin_ico_mplayericon01_params["image"],
			x = auctionwin_ico_mplayericon01_params["x"],
			y = auctionwin_ico_mplayericon01_params["y"],
		},
		
		Text
		{
			name = "auctionwin_text",
			font = Green12Font,
			x = auctionwin_txt_whowon_params["x"]-10,
			y = auctionwin_txt_whowon_params["y"]-10,
			w = auctionwin_txt_whowon_params["w"]+20,
			h = auctionwin_txt_whowon_params["h"]+20,
			flags = kHAlignCenter + kVAlignCenter,
			label = "ui.auction.result"
		},
		
		MonopolyButton
		{
			name="btn_ok",
			graphics = auctionwin_btn_menu_auctionok_params["graphics"],
			x = auctionwin_btn_menu_auctionok_params["x"],
			y = auctionwin_btn_menu_auctionok_params["y"],
			label="common.ok.label",
			font = White12Font,
			command=
				function()
					OnAuctionWinButtonOK();
				end;
		},
	},

}