--============================================================================
--  lose_life.lua
--  Copyright (c) 2010; Bamtang Games. All Rights Reserved.
------------------------------------------------------------------------------
require("scripts/style.lua");

function numberLifes(num)
    EnableWindow("lblGameOver",num < 1);
    EnableWindow("bmp1",num < 2);
    EnableWindow("bmp2",num < 3);
    EnableWindow("bmp3",num < 4);
end

SetState(kPause, true);

MakeDialog {
    name = "MemoryWizModal";

    Bitmap {
        name = "bmpBgAlpha";
        image = "gpx/screens/transparent_background";
        x = 0; y = 0;
        alpha = true;
    };

    wndMove {
        x = kCenter; y = kCenter;
		w = kMax; h = kMax;

		wndLoseLife {
			w = kMax; h = kMax;

            avatar_x = 625;
            avatar_y = 180;

			LifeCount = gDialogTable.lifeCount;
			Bitmap {
				name = "bmpBG";
				image = "gpx/screens/panel03";
				x = kCenter;
				y = kCenter;

				Bitmap {
					image = "gpx/screens/bonus_icon_01";
					x = 9;
					y = 18;
					w = 77;
					h = 77;
				};

				Bitmap {
					image = "gpx/screens/bonus_icon_02";
					x = 338;
					y = 18;
					w = 77;
					h = 77;
				};

				clsText {
					label = "not fast enough1";
					font = Font50;
					x = kCenter + 5; y = 20; w = 300; h = 50;
					flags = kHAlignCenter + kVAlignTop;
					Scale = 0.5;
					Space = -10;
				};

				clsText {
					label = "not fast enough2";
					font = Font50;
					x = kCenter + 5; y = 68; w = 300; h = 50;
					flags = kHAlignCenter + kVAlignTop;
					Scale = 0.5;
					Space = -10;
				};

				Text {
					name = "lblGameOver";
					label = "lblGameOver";
					font = Font50;
					x = kCenter; y = 130; w = 300; h = 150;
					flags = kHAlignCenter + kVAlignTop;
				};

				Bitmap {
					name = "bmp1";
					x = 66; y = 111;
					image = "gpx/gameplay/heartbig";
				};

				Bitmap {
					name = "bmp2";
					x = 166; y = 111;
					image = "gpx/gameplay/heartbig";
				};

				Bitmap {
					name = "bmp3";
					x = 266; y = 111;
					image = "gpx/gameplay/heartbig";
				};

				SetStyle(PanelButtonStyle);
				Button {
					x = 139; y = 211;
					label = "continue";
					font = Font20;
					command =
						function()
                            SetState(kPause, false);
							PopModal("MemoryWizModal");
							onEndLevel();
						end
				};
			};
		};
	};
};
