
require ( "menu/playerprof.lua" );
require ( "menu/newprofile.lua" );

require ( "scripts/game_style.lua" );

AchievementLockedStyle = {
	graphics = {
		playerprof_ach_locked_params["image"],
		playerprof_ach_locked_params["image"],
		playerprof_ach_locked_params["image"],
		playerprof_ach_locked_params["image"]
	},
};

playerprofile_group =
{
	PlayerProfileMenu
	{
		name = "playerprofilemenu",
		x = 0,
		y = 0,
		w = 800,
		h = 600,
		
	
		-- New Profile Sub-Interface
		Window
		{
			name = "Panel_0",
			x = 0,
			y = 0,
			w = 800,
			h = 600,
			
			-- Panel
			Bitmap
			{
				name=newprofile_win_medframelg_params["name"],
				image=newprofile_win_medframelg_params["image"],
				x=newprofile_win_medframelg_params["x"],
				y=newprofile_win_medframelg_params["y"],
			},
			-- Layout
			Bitmap
			{
				name=newprofile_ico_layoutnp_params["name"],
				image=newprofile_ico_layoutnp_params["image"],
				x=newprofile_ico_layoutnp_params["x"],
				y=newprofile_ico_layoutnp_params["y"],
			},		
			-- Title
			Bitmap
			{
				name=newprofile_ico_createprofile_params["name"],
				image=newprofile_ico_createprofile_params["image"],
				x=newprofile_ico_createprofile_params["x"],
				y=newprofile_ico_createprofile_params["y"],
			},

			Text
			{
				font = Green14Font,
				name=newprofile_txt_entername_params["name"],
				x=newprofile_txt_entername_params["x"]-10,
				y=newprofile_txt_entername_params["y"]-10,
				w=newprofile_txt_entername_params["w"]+20,
				h=newprofile_txt_entername_params["h"]+20,
				label="entername.description",
				flags = kHAlignCenter + kVAlignCenter,
			},
			Text
			{
				font = Green14Font,
				name=newprofile_txt_choose_params["name"],
				x=newprofile_txt_choose_params["x"]-10,
				y=newprofile_txt_choose_params["y"]-10,
				w=newprofile_txt_choose_params["w"]+20,
				h=newprofile_txt_choose_params["h"]+20,
				label="choosemover.description",
				flags = kHAlignCenter + kVAlignCenter,
			},
			
			TextEdit
			{
				name = "0_profile_name",
				font = Green14Font,
				x = 320,
				y = 340-5,
				w = 170,
				h = 15 + 10,
				label="",
				flags = kHAlignLeft + kVAlignCenter,
				utf8=false,
				length=11,
				ignore = kIllegalNameChars,
				clearinitial=false,
			},
			
			-- Tutorial Text
			Text
			{
				name = "profile_tutorial",
				font = Green14Font,
				x = newprofile_txt_desc_params["x"],
				y = newprofile_txt_desc_params["y"]-5,
				w = newprofile_txt_desc_params["w"]+5,
				h = newprofile_txt_desc_params["h"]+10,
				label="",
				flags = kHAlignLeft + kVAlignTop,
			},

			Bitmap
			{
				name = "0_accept_static",
				image="menu/btn_menu_04",
				x = newprofile_btn_menu_newaccept_params["x"],
				y = newprofile_btn_menu_newaccept_params["y"],
				Text
				{
					name = "0_accept_static_text",
					font = White12Font,
					flags = kHAlignCenter + kVAlignCenter,
					x = 0,
					y = 0,
					label="common.accept.label",
					w = playerprof_btn_menu_ppaccept_params["w"],
					h = playerprof_btn_menu_ppaccept_params["h"],
				}
			},
			-- accept
			MonopolyButton
			{
				name = "0_accept_btn",
				font = White12Font,
				graphics = newprofile_btn_menu_newaccept_params["graphics"],
				x = newprofile_btn_menu_newaccept_params["x"],
				y = newprofile_btn_menu_newaccept_params["y"],
				type = kPush,
				label="common.accept.label",
				command=
					function()
						if PlayerCheckNameDuplicated() then
							DisplayDialog
							{
								"scripts/generic_ok.lua",
								body = "nameinuse",
								title = "menu/ico_createprofile"
							};
						else
							OnPlayerProfileBtnAccept();
						end			
					end
			},
			--cancel
			MonopolyButton
			{
				name = "0_cancel_btn",
				font = White12Font,
				graphics = newprofile_btn_menu_newcancel_params["graphics"],
				x = newprofile_btn_menu_newcancel_params["x"],
				y = newprofile_btn_menu_newcancel_params["y"],
				type = kPush,
				label="common.cancel.label",
				command=
					function()
						OnPlayerProfileBtnCancel();
					end
			},
			
			Window
			{
				name = "favored_token_container",
				x = 250,
				y = 382,
				w = 300,
				h = 80,
			
				BeginGroup(),
				-- The buttons
				MonopolyButton
				{
					name = "0_token_btn_1",
					graphics = pop_tokenpopup_btn_dframe_01_params["graphics"],
					type = kRadio,
					x = pop_tokenpopup_btn_dframe_01_params["x"],
					y = pop_tokenpopup_btn_dframe_01_params["y"],
					command=
						function()
							OnPlayerProfileBtnToken(0, false);
						end
				},
				MonopolyButton
				{
					name = "0_token_btn_2",
					graphics = pop_tokenpopup_btn_vframe_01_params["graphics"],
					type = kRadio,
					x = pop_tokenpopup_btn_vframe_01_params["x"],
					y = pop_tokenpopup_btn_vframe_01_params["y"],
					command=
						function()
							OnPlayerProfileBtnToken(1, false);
						end
				},
				MonopolyButton
				{
					name = "0_token_btn_3",
					graphics = pop_tokenpopup_btn_tframe_01_params["graphics"],
					type = kRadio,
					x = pop_tokenpopup_btn_tframe_01_params["x"],
					y = pop_tokenpopup_btn_tframe_01_params["y"],
					command=
						function()
							OnPlayerProfileBtnToken(2, false);
						end
				},
				MonopolyButton
				{
					name = "0_token_btn_4",
					graphics = pop_tokenpopup_btn_pframe_01_params["graphics"],
					type = kRadio,
					x = pop_tokenpopup_btn_pframe_01_params["x"],
					y = pop_tokenpopup_btn_pframe_01_params["y"],
					command=
						function()
							OnPlayerProfileBtnToken(3, false);
						end
				},
				MonopolyButton
				{
					name = "0_token_btn_5",
					graphics = pop_tokenpopup_btn_kframe_01_params["graphics"],
					type = kRadio,
					x = pop_tokenpopup_btn_kframe_01_params["x"],
					y = pop_tokenpopup_btn_kframe_01_params["y"],
					command=
						function()
							OnPlayerProfileBtnToken(4, false);
						end
				},
				MonopolyButton
				{
					name = "0_token_btn_6",
					graphics = pop_tokenpopup_btn_hframe_01_params["graphics"],
					type = kRadio,
					x = pop_tokenpopup_btn_hframe_01_params["x"],
					y = pop_tokenpopup_btn_hframe_01_params["y"],
					command=
						function()
							OnPlayerProfileBtnToken(5, false);
						end
				},
			},
		},
		
		-- View / Edit Profile Sub-Interface
		Window
		{
			name = "Panel_1",
			x = 0,
			y = 0,
			w = 800,
			h = 600,

			-- Panel
			Bitmap
			{
				name=playerprof_win_largeframe_params["name"],
				image=playerprof_win_largeframe_params["image"],
				x=playerprof_win_largeframe_params["x"],
				y=playerprof_win_largeframe_params["y"],
			},
			-- Layout
			Bitmap
			{
				name=playerprof_ico_layoutpp_params["name"],
				image=playerprof_ico_layoutpp_params["image"],
				x=playerprof_ico_layoutpp_params["x"],
				y=playerprof_ico_layoutpp_params["y"],
			},		
			-- Title
			Bitmap
			{
				name=playerprof_ico_pprofile_params["name"],
				image=playerprof_ico_pprofile_params["image"],
				x=playerprof_ico_pprofile_params["x"],
				y=playerprof_ico_pprofile_params["y"],
			},
			
			--[[
			MonopolyButton
			{
				name = "profile_tooltipper",
				x = playerprof_txt_playername_params["x"]+3,
				y = playerprof_txt_playername_params["y"]+3,
				w = playerprof_txt_playername_params["h"]+6,
				h = playerprof_txt_playername_params["h"]+6,
				tooltip = "enternameprompt",
			},
			--]]
			TextEdit
			{
				name = "1_profile_name",
				font = White18Font,
				x = playerprof_txt_playername_params["x"]-5,
				y = playerprof_txt_playername_params["y"]-10,
				w = 400,
				h = playerprof_txt_playername_params["h"]+20,
				label="",
				flags = kHAlignLeft + kVAlignCenter,
				utf8=false,
				length=11,
				ignore = kIllegalNameChars,
				clearinitial=false,
			},

			-- mover button selector
			MonopolyButton
			{
				type = kPush,
				name = "mover_btn",
				graphics =
				{
					"menu/btn_ltframe01_01",
					"menu/btn_ltframe01_02",
					"menu/btn_ltframe01_03",
				},
				x = playerprof_ico_ltframe_02_params["x"],
				y = playerprof_ico_ltframe_02_params["y"],
				command=
					function()
						OnPlayerProfileBtnChooseToken();
					end
			},
			
			Bitmap
			{
				name = "mover_icon",
				image = playerprof_ico_lplayericon01_params["image"],
				x = playerprof_ico_lplayericon01_params["x"],
				y = playerprof_ico_lplayericon01_params["y"],
			},
			
			-- stats
			Text
			{
				name = "profile_stats_wins",
				font = Green14Font,
				x = playerprof_txt_playerstats_params["x"]-3,
				y = playerprof_txt_playerstats_params["y"]-5,
				w = playerprof_txt_playerstats_params["w"]+50,
				h = playerprof_txt_playerstats_params["h"]+20,
				label="",
				flags = kHAlignLeft + kVAlignTop,
			},
			Text
			{
				name = "profile_stats_losses",
				font = Green14Font,
				x = playerprof_txt_playerstats_params["x"]-3,
				y = playerprof_txt_playerstats_params["y"]-5+15,
				w = playerprof_txt_playerstats_params["w"]+50,
				h = playerprof_txt_playerstats_params["h"]+20,
				label="",
				flags = kHAlignLeft + kVAlignTop,
			},
			Text
			{
				name = "profile_stats_ties",
				font = Green14Font,
				x = playerprof_txt_playerstats_params["x"]-3,
				y = playerprof_txt_playerstats_params["y"]-5+30,
				w = playerprof_txt_playerstats_params["w"]+50,
				h = playerprof_txt_playerstats_params["h"]+20,
				label="",
				flags = kHAlignLeft + kVAlignTop,
			},
			Text
			{
				name = "profile_stats_game_played",
				font = Green14Font,
				x = playerprof_txt_playerstats_params["x"]-3,
				y = playerprof_txt_playerstats_params["y"]-5+45,
				w = playerprof_txt_playerstats_params["w"]+50,
				h = playerprof_txt_playerstats_params["h"]+20,
				label="",
				flags = kHAlignLeft + kVAlignTop,
			},
			Text
			{
				name = "profile_stats_time_played",
				font = Green14Font,
				x = playerprof_txt_playerstats_params["x"]-3,
				y = playerprof_txt_playerstats_params["y"]-5+60,
				w = playerprof_txt_playerstats_params["w"]+50,
				h = playerprof_txt_playerstats_params["h"]+20,
				label="",
				flags = kHAlignLeft + kVAlignTop,
			},
			Text
			{
				name = "profile_stats_highest_cash",
				font = Green14Font,
				x = playerprof_txt_playerstats_params["x"]-3,
				y = playerprof_txt_playerstats_params["y"]-5+75,
				w = playerprof_txt_playerstats_params["w"]+50,
				h = playerprof_txt_playerstats_params["h"]+20,
				label="",
				flags = kHAlignLeft + kVAlignTop,
			},
			Text
			{
				name = "profile_stats_total_salary",
				font = Green14Font,
				x = playerprof_txt_playerstats_params["x"]-3,
				y = playerprof_txt_playerstats_params["y"]-5+90,
				w = playerprof_txt_playerstats_params["w"]+50,
				h = playerprof_txt_playerstats_params["h"]+20,
				label="",
				flags = kHAlignLeft + kVAlignTop,
			},
			
			-- Achievements
			Text
			{
				name = playerprof_txt_achievements_params["name"],
				font = Green14Font,
				x = playerprof_txt_achievements_params["x"]-5,
				y = playerprof_txt_achievements_params["y"]-5,
				w = playerprof_txt_achievements_params["w"]+10,
				h = playerprof_txt_achievements_params["h"]+10,
				flags = kHAlignCenter + kVAlignCenter,
				label = "achievements",	
			},
			
			SetStyle(AchievementLockedStyle),
			
			MonopolyButton
			{
				name = "icon_ach20_locked",
				x = playerprof_ach_ach20_params["x"],
				y = playerprof_ach_ach20_params["y"],
				tooltip = "achievement.tip.20",
				tooltip_x = playerprof_ach_ach20_params["x"] + 0.5 * playerprof_ach_ach20_params["w"],
				tooltip_y = playerprof_ach_ach20_params["y"] - 15,
			},
			
			Bitmap
			{
				name = "icon_ach20",
				image = playerprof_ach_ach20_params["image"],
				x = playerprof_ach_ach20_params["x"],
				y = playerprof_ach_ach20_params["y"],
			},
		
		
			MonopolyButton
			{
				name = "icon_ach19_locked",
				x = playerprof_ach_ach19_params["x"],
				y = playerprof_ach_ach19_params["y"],
				tooltip = "achievement.tip.19",
				tooltip_x = playerprof_ach_ach19_params["x"] + 0.5 * playerprof_ach_ach19_params["w"],
				tooltip_y = playerprof_ach_ach19_params["y"] - 15,
			},
			
			Bitmap
			{
				name = "icon_ach19",
				image = playerprof_ach_ach19_params["image"],
				x = playerprof_ach_ach19_params["x"],
				y = playerprof_ach_ach19_params["y"],
			},
			
			MonopolyButton
			{
				name = "icon_ach18_locked",
				x = playerprof_ach_ach18_params["x"],
				y = playerprof_ach_ach18_params["y"],
				tooltip = "achievement.tip.18",
				tooltip_x = playerprof_ach_ach18_params["x"] + 0.5 * playerprof_ach_ach18_params["w"],
				tooltip_y = playerprof_ach_ach18_params["y"] - 15,
			},
			
			Bitmap
			{
				name = "icon_ach18",
				image = playerprof_ach_ach18_params["image"],
				x = playerprof_ach_ach18_params["x"],
				y = playerprof_ach_ach18_params["y"],
			},
			
			MonopolyButton
			{
				name = "icon_ach17_locked",
				x = playerprof_ach_ach17_params["x"],
				y = playerprof_ach_ach17_params["y"],
				tooltip = "achievement.tip.17",
				tooltip_x = playerprof_ach_ach17_params["x"] + 0.5 * playerprof_ach_ach17_params["w"],
				tooltip_y = playerprof_ach_ach17_params["y"] - 15,
			},
			
			Bitmap
			{
				name = "icon_ach17",
				image = playerprof_ach_ach17_params["image"],
				x = playerprof_ach_ach17_params["x"],
				y = playerprof_ach_ach17_params["y"],
			},
			
			MonopolyButton
			{
				name = "icon_ach16_locked",
				x = playerprof_ach_ach16_params["x"],
				y = playerprof_ach_ach16_params["y"],
				tooltip = "achievement.tip.16",
				tooltip_x = playerprof_ach_ach16_params["x"] + 0.5 * playerprof_ach_ach16_params["w"],
				tooltip_y = playerprof_ach_ach16_params["y"] - 15,
			},
			
			Bitmap
			{
				name = "icon_ach16",
				image = playerprof_ach_ach16_params["image"],
				x = playerprof_ach_ach16_params["x"],
				y = playerprof_ach_ach16_params["y"],
			},
			
			MonopolyButton
			{
				name = "icon_ach15_locked",
				x = playerprof_ach_ach15_params["x"],
				y = playerprof_ach_ach15_params["y"],
				tooltip = "achievement.tip.15",
				tooltip_x = playerprof_ach_ach15_params["x"] + 0.5 * playerprof_ach_ach15_params["w"],
				tooltip_y = playerprof_ach_ach15_params["y"] - 15,
			},
			
			Bitmap
			{
				name = "icon_ach15",
				image = playerprof_ach_ach15_params["image"],
				x = playerprof_ach_ach15_params["x"],
				y = playerprof_ach_ach15_params["y"],
			},
			
			MonopolyButton
			{
				name = "icon_ach14_locked",
				x = playerprof_ach_ach14_params["x"],
				y = playerprof_ach_ach14_params["y"],
				tooltip = "achievement.tip.14",
				tooltip_x = playerprof_ach_ach14_params["x"] + 0.5 * playerprof_ach_ach14_params["w"],
				tooltip_y = playerprof_ach_ach14_params["y"] - 15,
			},
			
			Bitmap
			{
				name = "icon_ach14",
				image = playerprof_ach_ach14_params["image"],
				x = playerprof_ach_ach14_params["x"],
				y = playerprof_ach_ach14_params["y"],
			},
			
			MonopolyButton
			{
				name = "icon_ach13_locked",
				x = playerprof_ach_ach13_params["x"],
				y = playerprof_ach_ach13_params["y"],
				tooltip = "achievement.tip.13",
				tooltip_x = playerprof_ach_ach13_params["x"] + 0.5 * playerprof_ach_ach13_params["w"],
				tooltip_y = playerprof_ach_ach13_params["y"] - 15,
			},
			
			Bitmap
			{
				name = "icon_ach13",
				image = playerprof_ach_ach13_params["image"],
				x = playerprof_ach_ach13_params["x"],
				y = playerprof_ach_ach13_params["y"],
			},
			
			MonopolyButton
			{
				name = "icon_ach12_locked",
				x = playerprof_ach_ach12_params["x"],
				y = playerprof_ach_ach12_params["y"],
				tooltip = "achievement.tip.12",
				tooltip_x = playerprof_ach_ach12_params["x"] + 0.5 * playerprof_ach_ach12_params["w"],
				tooltip_y = playerprof_ach_ach12_params["y"] - 15,
			},
			
			Bitmap
			{
				name = "icon_ach12",
				image = playerprof_ach_ach12_params["image"],
				x = playerprof_ach_ach12_params["x"],
				y = playerprof_ach_ach12_params["y"],
			},
			
			MonopolyButton
			{
				name = "icon_ach11_locked",
				x = playerprof_ach_ach11_params["x"],
				y = playerprof_ach_ach11_params["y"],
				tooltip = "achievement.tip.11",
				tooltip_x = playerprof_ach_ach11_params["x"] + 0.5 * playerprof_ach_ach11_params["w"],
				tooltip_y = playerprof_ach_ach11_params["y"] - 15,
			},
			
			Bitmap
			{
				name = "icon_ach11",
				image = playerprof_ach_ach11_params["image"],
				x = playerprof_ach_ach11_params["x"],
				y = playerprof_ach_ach11_params["y"],
			},
			
			MonopolyButton
			{
				name = "icon_ach10_locked",
				x = playerprof_ach_ach10_params["x"],
				y = playerprof_ach_ach10_params["y"],
				tooltip = "achievement.tip.10",
				tooltip_x = playerprof_ach_ach10_params["x"] + 0.5 * playerprof_ach_ach10_params["w"],
				tooltip_y = playerprof_ach_ach10_params["y"] - 15,
			},
			
			Bitmap
			{
				name = "icon_ach10",
				image = playerprof_ach_ach10_params["image"],
				x = playerprof_ach_ach10_params["x"],
				y = playerprof_ach_ach10_params["y"],
			},
			
			MonopolyButton
			{
				name = "icon_ach9_locked",
				x = playerprof_ach_ach09_params["x"],
				y = playerprof_ach_ach09_params["y"],
				tooltip = "achievement.tip.09",
				tooltip_x = playerprof_ach_ach09_params["x"] + 0.5 * playerprof_ach_ach09_params["w"],
				tooltip_y = playerprof_ach_ach09_params["y"] - 15,
			},
			
			Bitmap
			{
				name = "icon_ach9",
				image = playerprof_ach_ach09_params["image"],
				x = playerprof_ach_ach09_params["x"],
				y = playerprof_ach_ach09_params["y"],
			},
			
			MonopolyButton
			{
				name = "icon_ach8_locked",
				x = playerprof_ach_ach08_params["x"],
				y = playerprof_ach_ach08_params["y"],
				tooltip = "achievement.tip.08",
				tooltip_x = playerprof_ach_ach08_params["x"] + 0.5 * playerprof_ach_ach08_params["w"],
				tooltip_y = playerprof_ach_ach08_params["y"] - 15,
			},
			
			Bitmap
			{
				name = "icon_ach8",
				image = playerprof_ach_ach08_params["image"],
				x = playerprof_ach_ach08_params["x"],
				y = playerprof_ach_ach08_params["y"],
			},
			
			MonopolyButton
			{
				name = "icon_ach7_locked",
				x = playerprof_ach_ach07_params["x"],
				y = playerprof_ach_ach07_params["y"],
				tooltip = "achievement.tip.07",
				tooltip_x = playerprof_ach_ach07_params["x"] + 0.5 * playerprof_ach_ach07_params["w"],
				tooltip_y = playerprof_ach_ach07_params["y"] - 15,
			},
			
			Bitmap
			{
				name = "icon_ach7",
				image = playerprof_ach_ach07_params["image"],
				x = playerprof_ach_ach07_params["x"],
				y = playerprof_ach_ach07_params["y"],
			},
			
			MonopolyButton
			{
				name = "icon_ach6_locked",
				x = playerprof_ach_ach06_params["x"],
				y = playerprof_ach_ach06_params["y"],
				tooltip = "achievement.tip.06",
				tooltip_x = playerprof_ach_ach06_params["x"] + 0.5 * playerprof_ach_ach06_params["w"],
				tooltip_y = playerprof_ach_ach06_params["y"] - 15,
			},
			
			Bitmap
			{
				name = "icon_ach6",
				image = playerprof_ach_ach06_params["image"],
				x = playerprof_ach_ach06_params["x"],
				y = playerprof_ach_ach06_params["y"],
			},
			
			MonopolyButton
			{
				name = "icon_ach5_locked",
				x = playerprof_ach_ach05_params["x"],
				y = playerprof_ach_ach05_params["y"],
				tooltip = "achievement.tip.05",
				tooltip_x = playerprof_ach_ach05_params["x"] + 0.5 * playerprof_ach_ach05_params["w"],
				tooltip_y = playerprof_ach_ach05_params["y"] - 15,
			},
			
			Bitmap
			{
				name = "icon_ach5",
				image = playerprof_ach_ach05_params["image"],
				x = playerprof_ach_ach05_params["x"],
				y = playerprof_ach_ach05_params["y"],
			},
			
			MonopolyButton
			{
				name = "icon_ach4_locked",
				x = playerprof_ach_ach04_params["x"],
				y = playerprof_ach_ach04_params["y"],
				tooltip = "achievement.tip.04",
				tooltip_x = playerprof_ach_ach04_params["x"] + 0.5 * playerprof_ach_ach04_params["w"],
				tooltip_y = playerprof_ach_ach04_params["y"] - 15,
			},
			
			Bitmap
			{
				name = "icon_ach4",
				image = playerprof_ach_ach04_params["image"],
				x = playerprof_ach_ach04_params["x"],
				y = playerprof_ach_ach04_params["y"],
			},
			
			MonopolyButton
			{
				name = "icon_ach3_locked",
				x = playerprof_ach_ach03_params["x"],
				y = playerprof_ach_ach03_params["y"],
				tooltip = "achievement.tip.03",
				tooltip_x = playerprof_ach_ach03_params["x"] + 0.5 * playerprof_ach_ach03_params["w"],
				tooltip_y = playerprof_ach_ach03_params["y"] - 15,
			},
			
			Bitmap
			{
				name = "icon_ach3",
				image = playerprof_ach_ach03_params["image"],
				x = playerprof_ach_ach03_params["x"],
				y = playerprof_ach_ach03_params["y"],
			},
			
			MonopolyButton
			{
				name = "icon_ach2_locked",
				x = playerprof_ach_ach02_params["x"],
				y = playerprof_ach_ach02_params["y"],
				tooltip = "achievement.tip.02",
				tooltip_x = playerprof_ach_ach02_params["x"] + 0.5 * playerprof_ach_ach02_params["w"],
				tooltip_y = playerprof_ach_ach02_params["y"] - 15,
			},
			
			Bitmap
			{
				name = "icon_ach2",
				image = playerprof_ach_ach02_params["image"],
				x = playerprof_ach_ach02_params["x"],
				y = playerprof_ach_ach02_params["y"],
			},
			
			MonopolyButton
			{
				name = "icon_ach1_locked",
				x = playerprof_ach_ach01_params["x"],
				y = playerprof_ach_ach01_params["y"]-2,
				tooltip = "achievement.tip.01",
				tooltip_x = playerprof_ach_ach01_params["x"] + 0.5 * playerprof_ach_ach01_params["w"],
				tooltip_y = playerprof_ach_ach01_params["y"] - 15 - 2,
			},
			
			Bitmap
			{
				name = "icon_ach1",
				image = playerprof_ach_ach01_params["image"],
				x = playerprof_ach_ach01_params["x"],
				y = playerprof_ach_ach01_params["y"],
			},

			Bitmap
			{
				name = "1_accept_static",
				image="menu/btn_menu_04",
				x = playerprof_btn_menu_ppaccept_params["x"],
				y = playerprof_btn_menu_ppaccept_params["y"],
				Text
				{
					name = "1_accept_static_text",
					font = White12Font,
					flags = kHAlignCenter + kVAlignCenter,
					x = 0,
					y = 0,
					label="common.accept.label",
					w = playerprof_btn_menu_ppaccept_params["w"],
					h = playerprof_btn_menu_ppaccept_params["h"],
				}
			},
			-- accept
			MonopolyButton
			{
				name = "1_accept_btn",
				font = White12Font,
				graphics = playerprof_btn_menu_ppaccept_params["graphics"],
				x = playerprof_btn_menu_ppaccept_params["x"],
				y = playerprof_btn_menu_ppaccept_params["y"],
				type = kPush,
				label="common.accept.label",
				command=
					function()
						if PlayerCheckNameDuplicated() then
							DisplayDialog
							{
								"scripts/generic_ok.lua",
								body = "nameinuse",
								title = "menu/ico_pprofile"
							};
						else
							OnPlayerProfileBtnAccept();
						end			
					end
			},
			--cancel
			MonopolyButton
			{
				name = "1_cancel_btn",
				font = White12Font,
				graphics = playerprof_btn_menu_ppcancel_params["graphics"],
				x = playerprof_btn_menu_ppcancel_params["x"],
				y = playerprof_btn_menu_ppcancel_params["y"],
				type = kPush,
				label="common.cancel.label",
				command=
					function()
						OnPlayerProfileBtnCancel();
					end
			},
			
			--reset stats
			MonopolyButton
			{
				name = "reset_btn",
				font = White12Font,
				graphics = playerprof_btn_menu_ppreset_params["graphics"],
				x = playerprof_btn_menu_ppreset_params["x"],
				y = playerprof_btn_menu_ppreset_params["y"],
				type = kPush,
				label="reset.btn",
				command=
					function()
						OnPlayerProfileBtnReset();
					end
			},

			--delete
			MonopolyButton
			{
				name = "delete_btn",
				font = White12Font,
				graphics = playerprof_btn_delete_01_params["graphics"],
				x = playerprof_btn_delete_01_params["x"],
				y = playerprof_btn_delete_01_params["y"],
				type = kPush,
				command=
					function()
						result = DisplayDialog
						{
							"scripts/generic_yesno.lua",
							body = "ui.deleteprofile.confirmation",
							title = "menu/ico_pprofile"
						};
						if (result=='yes') then
							OnPlayerProfileBtnDelete();
						end
					end
			},
			
			AvatarSelectionDropDown
			{
				name = "favored_token_popup",
				x = 196,
				y = 262,
				w=300,h=80,

				--BG
				Bitmap
				{
					name = pop_tokenpopup_pop_tpframe_params["name"],
					image = pop_tokenpopup_pop_tpframe_params["image"],
					x = pop_tokenpopup_pop_tpframe_params["x"],
					y = pop_tokenpopup_pop_tpframe_params["y"],
				},
				
				-- The buttons
				MonopolyButton
				{
					name = "token_btn_1",
					graphics = pop_tokenpopup_btn_dframe_01_params["graphics"],
					type = kPush,
					x = pop_tokenpopup_btn_dframe_01_params["x"],
					y = pop_tokenpopup_btn_dframe_01_params["y"],
					command=
						function()
							OnPlayerProfileBtnToken(0, true);
						end
				},
				MonopolyButton
				{
					name = "token_btn_2",
					graphics = pop_tokenpopup_btn_vframe_01_params["graphics"],
					type = kPush,
					x = pop_tokenpopup_btn_vframe_01_params["x"],
					y = pop_tokenpopup_btn_vframe_01_params["y"],
					command=
						function()
							OnPlayerProfileBtnToken(1, true);
						end
				},
				MonopolyButton
				{
					name = "token_btn_3",
					graphics = pop_tokenpopup_btn_tframe_01_params["graphics"],
					type = kPush,
					x = pop_tokenpopup_btn_tframe_01_params["x"],
					y = pop_tokenpopup_btn_tframe_01_params["y"],
					command=
						function()
							OnPlayerProfileBtnToken(2, true);
						end
				},
				MonopolyButton
				{
					name = "token_btn_4",
					graphics = pop_tokenpopup_btn_pframe_01_params["graphics"],
					type = kPush,
					x = pop_tokenpopup_btn_pframe_01_params["x"],
					y = pop_tokenpopup_btn_pframe_01_params["y"],
					command=
						function()
							OnPlayerProfileBtnToken(3, true);
						end
				},
				MonopolyButton
				{
					name = "token_btn_5",
					graphics = pop_tokenpopup_btn_kframe_01_params["graphics"],
					type = kPush,
					x = pop_tokenpopup_btn_kframe_01_params["x"],
					y = pop_tokenpopup_btn_kframe_01_params["y"],
					command=
						function()
							OnPlayerProfileBtnToken(4, true);
						end
				},
				MonopolyButton
				{
					name = "token_btn_6",
					graphics = pop_tokenpopup_btn_hframe_01_params["graphics"],
					type = kPush,
					x = pop_tokenpopup_btn_hframe_01_params["x"],
					y = pop_tokenpopup_btn_hframe_01_params["y"],
					command=
						function()
							OnPlayerProfileBtnToken(5, true);
						end
				},
			},
		},
	}
}

SetFocus( "profile_name" );
