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

SetState(kPause, true);

local nameReward = "";
local textReward = "";
local imageReward = "";

if gReward == 1 then
    nameReward = "powerup wild";
    imageReward = "gpx/tiles/wild";
    textReward = "powerup wild text";
elseif gReward == 2 then
    nameReward = "powerup bomb";
    imageReward = "gpx/tiles/bomb";
    textReward = "powerup bomb text";
elseif gReward == 3 then
    nameReward = "powerup sidewinder";
    imageReward = "gpx/tiles/sidewinder";
    textReward = "powerup sidewinder text";
elseif gReward == 4 then
    nameReward = "powerup showtime";
    imageReward = "gpx/tiles/showtime";
    textReward = "powerup showtime text";
elseif gReward == 5 then
    nameReward = "powerup freeze";
    imageReward = "gpx/tiles/freeze";
    textReward = "powerup freeze text";
end

function removeReward()
    SetState(kPause, false);
    PopModal("RewardDialog");
end

MakeDialog {
    name = "RewardDialog";

    wndReward {
        x = 0; y = 0; w = 1024; h = 768;

        Bitmap {
            name = "bmpPanelBlack";
            image = "gpx/screens/transparent_background";
            alpha = true;
        };

        Bitmap {
            name = "bmpContainer";
            image = "gpx/screens/panel05";
            x = 328; y = 282;
            alpha = true;

            Bitmap {
                image = "gpx/screens/powerup_circle";
                x = 5; y = 45;
            };

            Bitmap {
                image = imageReward;
                x = 32; y = 72;
            };

            clsText {
                label = nameReward;
                font = Font42;
		        flags = kHAlignCenter + kVAlignCenter;
                x = 0; y = 10; w = 329; h = 50;
                Scale = 0.4;
                Space = -1;
            };

            Text {
                label = textReward;
                font = Font16;
                x = 100; y = 39; w = 215; h = 107;
            };

            SetStyle(PanelButtonStyle);
            Button {
                label = "btnOk";
                x = 88; y = 150;
                command = function()
                    gfn_OnBackReward();
                end
            };
        };
    };
};
