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

BodyFont = {
    textFont, 
    16,
    Color(252, 226, 115, 255)
};

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

MakeDialog {
    -- Name the modal dialog
    name = "GameOverDialog";

    GameOverWindow {
        name = "GameOverWindow";
        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 {
            name = "bmpPanelContainer";
            image = "images/gui/ae_paneloptions";
            x = kCenter;
            y = 154;

            Bitmap {
                name = "bmpTitle";
                image = gLocalizedPath.."images/ae_timeisup";
                x = kCenter;
                y = 68;
            };

            Text {
                name = "lblGameOverMessage",
                x = 89, y = 120,
                w = 300, h = 80,
                font = DialogTitleFont,
                label = "lblGameOverMessage";
                flags = kHAlignCenter + kVAlignCenter,
            };

            SetStyle(ButtonStyle);
            Button {
                name = "btnRetry";
                graphics = RetryButtonGraphics;
                x = 53;
                --x = kCenter;
                y = 226;
                command = 
                    function()
                        PopModal("GameOverDialog");
                        SetState(kPause, false);
                        -- Our game processes this message--it's not
                        -- handled by Playground
                        msg = SendMessage("restartLevel");
                        handleMessage(msg);
                    end
            };
            Button {
                name = "btnMainMenu";
                graphics = MainMenu2ButtonGraphics;
                x = 243;
                y = 226;
                command = 
                    function()
                        -- Our game processes this message--it's not
                        -- handled by Playground
                        SendGameMessage("quit");
                        SetState(kPause, false);
                    end
            },
        };
    };
}