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

HeadFont = {
    titleFont;
    24;
    Color(255, 242, 108);
};

RadioFont = {
    titleFont,
    20,
    Color(255, 242, 108),
};

kRbtTimedX = 115;
kRbtTimedY = 130;
kRbtRelaxedX = 247;
kRbtRelaxedY = 130;
kRbtLabelSpace = 30;

MakeDialog {
    name = "ModeSelectionDialog";

    ModeSelectionWnd {
        x = 0; y = 0;
        w = 800; h = 600;

        Bitmap {
            name = "bmpPanelBlack";
            image = "images/gui/ae_background";
            alpha = true;
            x = 0; y = 0;
            w = 800; h = 600;
        };

        Bitmap {
            image="images/gui/ae_paneloptions";
            name = "bmpPanelContainer";
            x = kCenter; y = kCenter;

            Text {
                name = "txtTitle";
                font = HeadFont;
                x = kCenter; y = 75;
                w = 250; h = 50;
                flags = kHAlignCenter;
                label = "lblSelectMode";
            };
            SetStyle(RadioStyle);
            BeginGroup();
            Button {
                name = "rbtTimed";
                x = kRbtTimedX;
                y = kRbtTimedY;
                scale = 0.8;
                font = RadioFont;
                label = "lblTimed";
                w = 125;
                flags = kVAlignCenter;
                tx = 32;
            };
            Button {
                name = "rbtRelaxed";
                x = kRbtRelaxedX;
                y = kRbtRelaxedY;
                scale = 0.8;
                font = RadioFont;
                label = "lblRelaxed";
                w = 125;
                flags = kVAlignCenter;
                tx = 32;
            };

            SetStyle(ButtonStyle),
            Button {
                x = 52; y = 226;
                name = "btnOk",
                graphics = OkButtonGraphics,
                command =
                    function()
                        local currentMode = "relaxed";
                        if IsModeSelectionTimed() == 1 then 
                            currentMode = "timed";
                        end
                        RestartGameToMode(currentMode);
                        PopModal("ModeSelectionDialog");
                        onButtonPress("ButtonPlay");
                    end
            };

            Button {
                x = 244; y = 226;
                name = "btnCancel",
                cancel = true;
                default = true,
                graphics = CancelButtonGraphics,
                command =
                    function()
                        PopModal("ModeSelectionDialog");
                    end
            };
        };
    };
}
