--============================================================================
--  gain_tropy.lua
--  Copyright (c) 2009, Bamtang Games. All Rights Reserved.
------------------------------------------------------------------------------
require( "scripts/style.lua" );

kButtonY = kCenter + 130;

--SetState(kPause, true);
-- InsideGame(false);

trpGTitleFont = {
    titleFont,
    19,
    Color(252, 226, 115, 255)
};

trpGBodyFont = {
    titleFont,
    16,
    Color(252, 226, 115, 255)
};

if (gGainTrophy == "-1") then 
    imgTrophy = "";                                       -- 0 None
    lblTrophy = "None";
    lblTrophyDsc = "None"
elseif (gGainTrophy == "0") then 
    imgTrophy = "images/trophies/ae_panel_medal.png";         -- 1 ThanksToAmelia - I do what I do, thanks to Amelia
    lblTrophy = "ThanksToAmelia";
    lblTrophyDsc = "ThanksToAmeliaDsc";
elseif (gGainTrophy == "1") then 
    imgTrophy = "images/trophies/ae_panel_kansas.png";       -- 2 GirlFromAtchison - That girl from Atchison, Kansas
    lblTrophy = "GirlFromAtchison";
    lblTrophyDsc = "GirlFromAtchisonDsc";
elseif (gGainTrophy == "2") then 
    imgTrophy = "images/trophies/ae_panel_plane.png";              -- 4 ThatPlane - That plane said something to me
    lblTrophy = "ThatPlane";
    lblTrophyDsc = "ThatPlaneDsc";
elseif (gGainTrophy == "3") then 
    imgTrophy = "images/trophies/ae_panel_cow.png";          -- 8 ScaredTheCows - I scared the cows where I landed
    lblTrophy = "ScaredTheCows";
    lblTrophyDsc = "ScaredTheCowsDsc";
elseif (gGainTrophy == "4") then 
    imgTrophy = "images/trophies/ae_panel_lei.png";           -- 16 AlohaOakland - Aloha Oakland
    lblTrophy = "AlohaOakland";
    lblTrophyDsc = "AlohaOaklandDsc";
elseif (gGainTrophy == "5") then 
    imgTrophy = "images/trophies/ae_panel_electra.png";             -- 32 LastFlight - Electra's Last flight
    lblTrophy = "LastFlight";
    lblTrophyDsc = "LastFlightDsc";
elseif (gGainTrophy == "6") then 
    imgTrophy = "images/trophies/ae_panel_island.png";              -- 64 Exploring - Exploring the Island
    lblTrophy = "Exploring";
    lblTrophyDsc = "ExploringDsc";
elseif (gGainTrophy == "7") then 
    imgTrophy = "images/trophies/ae_panel_amelia.png";          -- 128 AmeliasLegacy - Amelia's legacy
    lblTrophy = "AmeliasLegacy";
    lblTrophyDsc = "AmeliasLegacyDsc";
elseif (gGainTrophy == "8") then 
    imgTrophy = "images/trophies/ae_panel_bronzehint.png";        -- 256 GoodObservation - Good observation skills
    lblTrophy = "GoodObservation";
    lblTrophyDsc = "GoodObservationDsc";
elseif (gGainTrophy == "9") then 
    imgTrophy = "images/trophies/ae_panel_silverhint.png";  -- 512 IncredibleObservation - Incredible observation skills
    lblTrophy = "IncredibleObservation";
    lblTrophyDsc = "IncredibleObservationDsc";
elseif (gGainTrophy == "10") then 
    imgTrophy = "images/trophies/ae_panel_goldhint.png";         -- 1024 NeverInterrupt - Never interrupt someone doing something you said couldn't be done
    lblTrophy = "NeverInterrupt";
    lblTrophyDsc = "NeverInterruptDsc";
elseif (gGainTrophy == "11") then 
    imgTrophy = "images/trophies/ae_panel_bronzeskip.png";           -- 2048 GoodThinking - Good thinking
    lblTrophy = "GoodThinking";
    lblTrophyDsc = "GoodThinkingDsc";
elseif (gGainTrophy == "12") then 
    imgTrophy = "images/trophies/ae_panel_silverskip.png";        -- 4096 AwesomeThinking - Awesome thinking 
    lblTrophy = "AwesomeThinking";
    lblTrophyDsc = "AwesomeThinkingDsc";
elseif (gGainTrophy == "13") then 
    imgTrophy = "images/trophies/ae_panel_goldskip.png";           -- 8192 EffectiveWay - The most effective way to do it, is to do it 
    lblTrophy = "EffectiveWay";
    lblTrophyDsc = "EffectiveWayDsc";
elseif (gGainTrophy == "14") then 
    imgTrophy = "images/trophies/ae_panel_redvega.png";          -- 16384 EasierToStart - it is far easier to start something than it is to finish it.
    lblTrophy = "EasierToStart";
    lblTrophyDsc = "EasierToStartDsc";
elseif (gGainTrophy == "15") then 
    imgTrophy = "images/trophies/ae_panel_yellowvega.png";       -- 32768 AdventureIsWorthwhile - Adventure is worthwhile in itself.
    lblTrophy = "AdventureIsWorthwhile";
    lblTrophyDsc = "AdventureIsWorthwhileDsc";
end;

if (gGainTrophy ~= "-1") then

	MakeDialog {
		name = "GainTrophy",
		GainTrophyWnd {
			x = 0, y = 0, 
			w = kMax, h = kMax,
			Bitmap {
				image = "images/gui/ae_background.png",
				name = "BackGround",
				x = kCenter, y = kCenter,
                alpha = true;

				Bitmap{
					image = "images/gui/ae_paneltrophies.png",
					x = kCenter,
					y = kCenter,
				},
				Bitmap {
					image = imgTrophy; 
					x = kCenter, 
					y = 200,
				},
				Text {
					font = trpGTitleFont,
					x = kCenter,
					y = 130,
					w = 380,
					h = 60,
					flags = kHAlignCenter + kVAlignCenter,
					label = lblTrophy,
				},
				Text {
					font = trpGBodyFont,
					x = kCenter,
					y = 360,
					w = 380,
					h = 100,
					flags = kHAlignCenter,
					label = lblTrophyDsc,
				},
			},
			SetStyle(ButtonStyle),
			Button {
				x = kCenter,
				y = 485,
				graphics = ContinueButtonGraphics,
				name = "continue",
				cancel = true,
				command =
					function()
						-- InsideGame(true);
						--SetState(kPause, false);
						PopModal("GainTrophy");
					end;
			},
		},
	};
end;
