<?xml version="1.0" encoding="UTF-8"?>
<app name="Region Changer" version="1.8.5" icon="images/icon.png">
	<resources>
		<module src="../../modules/tolua.klf" />
		<module src="../../modules/luaDS.klf" />
		<module src="../../modules/luaGUI.klf" />
		<module src="../../modules/luaKOS.klf" />
		<module src="modules/app_region_changer.klf" />
		<script type="text/lua" src="lua/main.lua" />
		<font src="../../fonts/ttf/arial_lite.ttf" type="ttf" size="18" name="arial" />
		<font src="../../fonts/ttf/comic_lite.ttf" type="ttf" size="14" name="comic" />
		<image src="../../gui/back/grey.png" name="back" />
		<image src="../../gui/buttons/big_green/normal.png" name="mNorm" />
		<image src="../../gui/buttons/big_green/highlight.png" name="mHigh" />
		<image src="../../gui/buttons/big_green/pressed.png" name="mPress" />
		<image src="../../gui/buttons/big_green2/normal.png" name="bNorm" />
		<image src="../../gui/buttons/big_green2/highlight.png" name="bHigh" />
		<image src="../../gui/buttons/big_green2/pressed.png" name="bPress" />
		<image src="../../gui/buttons/checkbox/check.png" name="bCheck" />
		<image src="../../gui/buttons/checkbox/uncheck.png" name="bUncheck" />
		<image src="images/label.png" name="label" />
		<image src="images/logo.png" name="logo" />
		<image src="images/about.png" name="about" />
		<image src="images/menu.png" name="menu" />
		<surface width="270" height="30" name="pb-b">
			<fill color="#AAAAAA" />
			<fill x="2" y="2" width="266" height="26" color="#F5F5F5" />
		</surface>
		<surface width="270" height="30" name="pb-p">
			<fill color="#AAAAAA" />
			<fill x="2" y="2" width="266" height="26" color="#9FDF54" />
		</surface>
		<theme>
			<input type="button" normal="mNorm" highlight="mHigh" pressed="mPress" disabled="mNorm" name="mBut" />
			<input type="button" normal="bNorm" highlight="bHigh" pressed="bPress" disabled="bNorm" name="bBut" />
			<input type="checkbox" onnormal="bCheck" onhighlight="bCheck" offnormal="bUncheck" offhighlight="bUncheck" />
		</theme>
	</resources>
	<body width="640" height="480" background="back" onload="RegionChanger:Initialize()">
		<cardstack width="100%" height="100%" name="pages">
			<panel name="home-page">
				<image src="logo" height="100" name="logo" />
				<panel height="50">
					<image src="label" width="262" height="23" x="189">
						  <label font="comic" color="#ffffff" text="Region Changer v1.8.5" />
					</image>
				</panel>
				<panel x="233" y="180" width="181" height="250">
					<input type="button" onclick="RegionChanger:ShowPage(1)" theme="bBut" height="40">
						<label font="arial" color="#ffffff" text="Change Region" />
					</input>
					<input type="button" onclick="RegionChanger:ShowPage(2)" theme="bBut" y="50" height="40">
						<label font="arial" color="#ffffff" text="Backup Flash" />
					</input>
					<input type="button" onclick="RegionChanger:ShowPage(3)" theme="bBut" y="100" height="40">
						<label font="arial" color="#ffffff" text="Clear Flash" />
					</input>
					<input type="button" onclick="RegionChanger:ShowPage(4)" theme="bBut" y="150" height="40">
						<label font="arial" color="#ffffff" text="About" />
					</input>
					<input type="button" onclick="console:app -o -n Main" theme="bBut" y="200" height="40">
						<label font="arial" color="#ffffff" text="Exit" />
					</input>
				</panel>
			</panel>
			<panel name="change-page">
				<panel height="40">
					<image src="label" width="262" height="23" x="189">
						  <label font="comic" color="#ffffff" text="Change region code" />
					</image>
				</panel>
				<panel height="30">
					<image src="menu" />
				</panel>
				<input type="checkbox" onclick="RegionChanger:SelectCountry(1)" x="50" y="100" width="120" height="30" name="change-country-japan-checkbox">
					<label x="25" height="20" font="comic" color="#000000" text="Japan" align="left" />
				</input>
				<input type="checkbox" onclick="RegionChanger:SelectCountry(2)" x="50" y="130" width="120" height="30" name="change-country-usa-checkbox">
					<label x="25" height="20" font="comic" color="#000000" text="USA" align="left" />
				</input>
				<input type="checkbox" onclick="RegionChanger:SelectCountry(3)" x="50" y="160" width="120" height="30" name="change-country-europe-checkbox">
					<label x="25" height="20" font="comic" color="#000000" text="Europe" align="left" />
				</input>
				<input type="checkbox" x="50" y="250" width="180" height="30" name="change-swirl-checkbox">
					<label x="25" height="20" font="comic" color="#000000" text="Set swirl color to black" align="left" />
				</input>
				<input type="checkbox" onclick="RegionChanger:SelectBroadcast(1)" x="250" y="100" width="120" height="30" name="change-ntsc-checkbox">
					<label x="25" height="20" font="comic" color="#000000" text="NTSC" align="left" />
				</input>
				<input type="checkbox" onclick="RegionChanger:SelectBroadcast(2)" x="250" y="130" width="120" height="30" name="change-pal-checkbox">
					<label x="25" height="20" font="comic" color="#000000" text="PAL" align="left" />
				</input>
				<input type="checkbox" onclick="RegionChanger:SelectBroadcast(3)" x="250" y="160" width="120" height="30" name="change-palm-checkbox">
					<label x="25" height="20" font="comic" color="#000000" text="PAL_M" align="left" />
				</input>
				<input type="checkbox" onclick="RegionChanger:SelectBroadcast(4)" x="250" y="190" width="120" height="30" name="change-paln-checkbox">
					<label x="25" height="20" font="comic" color="#000000" text="PAL_N" align="left" />
				</input>
				<input type="checkbox" onclick="RegionChanger:SelectLang(1)" x="450" y="100" width="120" height="30" name="change-lang-japan-checkbox">
					<label x="25" height="20" font="comic" color="#000000" text="Japan" align="left" />
				</input>
				<input type="checkbox" onclick="RegionChanger:SelectLang(2)" x="450" y="130" width="120" height="30" name="change-lang-english-checkbox">
					<label x="25" height="20" font="comic" color="#000000" text="English" align="left" />
				</input>
				<input type="checkbox" onclick="RegionChanger:SelectLang(3)" x="450" y="160" width="120" height="30" name="change-lang-german-checkbox">
					<label x="25" height="20" font="comic" color="#000000" text="German" align="left" />
				</input>
				<input type="checkbox" onclick="RegionChanger:SelectLang(4)" x="450" y="190" width="120" height="30" name="change-lang-french-checkbox">
					<label x="25" height="20" font="comic" color="#000000" text="French" align="left" />
				</input>
				<input type="checkbox" onclick="RegionChanger:SelectLang(5)" x="450" y="220" width="120" height="30" name="change-lang-spanish-checkbox">
					<label x="25" height="20" font="comic" color="#000000" text="Spanish" align="left" />
				</input>
				<input type="checkbox" onclick="RegionChanger:SelectLang(6)" x="450" y="250" width="120" height="30" name="change-lang-italian-checkbox">
					<label x="25" height="20" font="comic" color="#000000" text="Italian" align="left" />
				</input>
				<input type="button" onclick="RegionChanger:Read()" theme="mBut" x="115" y="380" width="135" height="40">
					<label font="arial" color="#ffffff" text="Read" />
				</input>
				<input type="button" onclick="RegionChanger:Write()" theme="mBut" x="251" y="380" width="135" height="40">
					<label font="arial" color="#ffffff" text="Write" />
				</input>
				<input type="button" onclick="console:dc -reboot" theme="mBut" x="389" y="380" width="135" height="40">
					<label font="arial" color="#ffffff" text="Reboot" />
				</input>
				<input type="button" onclick="RegionChanger:ShowPage(0)" theme="mBut" x="251" y="430" width="135" height="40">
					<label font="arial" color="#ffffff" text="Back" />
				</input>
			</panel>
			<panel name="backup-page">
				<panel height="50">
					<image src="label" width="262" height="23" x="189">
						<label font="comic" color="#ffffff" text="Flash factory settings backup" />
					</image>
				</panel>
				<panel x="258" y="170" width="110" height="30">
					<label font="comic" color="#000000" text=".::Progress::." />
				</panel>
				<progressbar width="270" height="30" x="185" y="200" name="backup-progress" pos="0.0" bimage="pb-b" pimage="pb-p" />
				<input type="button" onclick="RegionChanger:CreateBackup()" theme="mBut" x="185" y="275" width="135" height="40">
					<label font="arial" color="#ffffff" text="Create" />
				</input>
				<input type="button" onclick="RegionChanger:RestoreBackup()" theme="mBut" x="320" y="275" width="135" height="40">
					<label font="arial" color="#ffffff" text="Restore" />
				</input>
				<input type="button" onclick="RegionChanger:ShowPage(0)" theme="mBut" x="251" y="350" width="135" height="40">
					<label font="arial" color="#ffffff" text="Back" />
				</input>
			</panel>
			<panel name="clear-page">
				<panel height="50">
					<image src="label" width="262" height="23" x="189">
						<label font="comic" color="#ffffff" text="Clear flashrom" />
					</image>
				</panel>
				<input type="checkbox" x="50" y="130" width="180" height="30" name="clear-game-checkbox">
					<label x="25" height="20" font="comic" color="#000000" text="Game Settings" align="left" />
				</input>
				<input type="checkbox" x="50" y="100" width="180" height="30" name="clear-sys-checkbox">
					<label x="25" height="20" font="comic" color="#000000" text="ISP/SYS Settings" align="left" />
				</input>
				<input type="button" onclick="RegionChanger:ClearFlashrom()" theme="mBut" x="251" y="300" width="135" height="40">
					<label width="135" height="40" font="arial" color="#ffffff" text="Clear" />
				</input>
				<input type="button" onclick="RegionChanger:ShowPage(0)" theme="mBut" x="251" y="350" width="135" height="40">
					<label width="135" height="40" font="arial" color="#ffffff" text="Back" />
				</input>
			</panel>
			<panel name="about-page">
				<image src="about" height="300" align="center" valign="top" />
				<input type="button" onclick="RegionChanger:ShowPage(0)" theme="mBut" x="251" y="350" width="135" height="40">
					<label font="arial" color="#ffffff" text="Back" />
				</input>
			</panel>
		</cardstack>
	</body>
</app>
