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

SetState(kPause, true);

function removeInstructionLevel()
    SetState(kPause, false);
    PopModal("InstructionsLevelDialog");
end

local gpxBackgroud = "";
local gpxIcon = "";
local lblTitle = "";
local lblPanel = "";

if gGameMode == "Classic" then
    gpxBackgroud = "gpx/screens/screen_help_classic";
    gpxIcon = "gpx/modes/icon_layout_classic";
    lblTitle = "#"..GetString("lblClassicTitle");
    lblPanel = "lblPanelInstructionsClassic";
elseif gGameMode == "Blitz" then
    gpxBackgroud = "gpx/screens/screen_help_classic";
    gpxIcon = "gpx/modes/icon_layout_blitz";
    lblTitle = "#"..GetString("lblBlitzTitle");
    lblPanel = "lblPanelInstructionsBlitz";
elseif gGameMode == "Strategy" then
    gpxBackgroud = "gpx/screens/screen_help_classic";
    gpxIcon = "gpx/modes/icon_layout_strategy";
    lblTitle = "#"..GetString("lblStrategyTitle");
    lblPanel = "lblPanelInstructionsStrategy";
elseif gGameMode == "Rome" then
    gpxBackgroud = "gpx/screens/screen_help_craddle";
    gpxIcon = "gpx/modes/icon_layout_cradle";
    lblTitle = "#"..GetString("lblCradleRomeTitle");
    lblPanel = "lblPanelInstructionsCradle";
elseif gGameMode == "Joker" then
    gpxBackgroud = "gpx/screens/screen_help_joker";
    gpxIcon = "gpx/modes/icon_layout_joker";
    lblTitle = "#"..GetString("lblJokerTitle");
    lblPanel = "lblPanelInstructionsJoker";
end
lblTitle = lblTitle.." "..GetString("Mode");

function MakeAditionalObjects()
    if (gGameMode == "Classic") or (gGameMode == "Strategy") then
        return Group {
            Text {
                name = "lblNewRowMeter";
                label = "lblNewRowMeter";
                font = Font18;
                x = 14; y = 709;
                w = 133; h = 45;
                flags = kHAlignCenter + kVAlignCenter;
            };
        };
    elseif (gGameMode == "Blitz") then
        return Group {
            Text {
                name = "lblTimer";
                label = "lblTimer";
                font = Font18;
                x = 14; y = 709;
                w = 133; h = 40;
                flags = kHAlignCenter + kVAlignCenter;
            };
        };
    elseif (gGameMode == "Rome") then
        return Group {
            Text {
                name = "lblTimer";
                label = "lblTimer";
                font = Font18;
                x = 14; y = 709;
                w = 133; h = 40;
                flags = kHAlignCenter + kVAlignCenter;
            };
            Text {
                name = "lblOrangeTile";
                label = "lblOrangeTile";
                font = Font18;
                x = 647; y = 467;
                w = 150; h = 30;
                flags = kHAlignCenter + kVAlignCenter;
            };
        };
    elseif (gGameMode == "Joker") then
        return Group {
            Text {
                name = "lblJoker";
                label = "lblJoker";
                font = Font18;
                x = 156; y = 339;
                w = 200; h = 30;
                flags = kHAlignCenter + kVAlignCenter;
            };
            Text {
                name = "lblTargetTile";
                label = "lblTargetTile";
                font = Font18;
                x = 629; y = 306;
                w = 200; h = 30;
                flags = kHAlignCenter + kVAlignCenter;
            };
        };
    end
end

MakeDialog {
    name = "InstructionsLevelDialog";

    wndInstructionLevel {
        w = kMax; h = kMax;

        Bitmap {
            name = "bmpPanelBlack";
            image = gpxBackgroud;
            alpha = true;
        };

        Bitmap {
            name = "bmpContainer";
            --image = gpxBackgroud;
            alpha = true;
            w = kMax; h = kMax;

            Bitmap {
                name = "bmpIcon";
                image = gpxIcon;
                x = 448; y = 147;
            };

            clsText {
                name = "lblTitle";
                label = lblTitle;
                font = Font42White;
				x = 185; y = 105;
                w = 600; h = 50;
                flags = kHAlignCenter + kVAlignTop;
                Scale = 0.43;
                Space = -10;
            };

            Text {
                name = "lblLevelGoal";
                label = "lblLevelGoal";
                font = Font18;
                x = 36; y = 225;
                w = 196; h = 20;
                flags = kHAlignCenter + kVAlignTop;
            };

            Text {
                name = "lblPanel";
                label = lblPanel;
                font = Font18;
                x = 207; y = 593;
                w = 574; h = 100;
                flags = kHAlignCenter + kVAlignCenter;
            };

            MakeAditionalObjects();

            SetStyle(PanelButtonStyle);
            Button {
                x = 419; y = 720;
                name = "btnOk";
                label = "btnOk";
                command = function()
                    gfn_OnBackInstructionLevel();
                end
            };
        };
    };
};
