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

SliderFont = {
    titleFont,
    18,
    Color(252, 226, 115, 255)
};

function removeOptions() 
    PopModal("optionsmenu");
end

MakeDialog {
    -- Name the modal dialog
    name="optionsmenu",

    OptionsWindow {
        x = 0, y = 0,
        w = 800, h = 600,

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

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

            Text {
                font = SliderFont,
                name = "sfx",
                x = 65, y = 58, 
                w = 50, h = 50,
                flags = kHAlignCenter + kVAlignCenter,
                label = "sfxlevel"
            },

            Text {
                font = SliderFont,
                name = "music",
                x = 65, y = 104, 
                w = 50, h = 50,
                flags = kHAlignCenter + kVAlignCenter,
                label = "musiclevel"
            },

            SetStyle(CheckboxButtonStyle),
            Button {
                name = "fullscreen",
                label = "fullscreen",
                x = 99, y = 163,
                w = 150,
                command = 
                    function()
                        if (ToggleFullScreen() == false) then
                            DisplayDialog {
                                "scripts/ok.lua",
                                body ="screenswitchfailed",
                                title = ""
                            };
                        end
                    end
            },

            Button {
                name = "mutebox",
                x = 250,
                y = 163,
                w = 175,
                label = "mutesound",
                command =
                    function()
                        ToggleSoundMute();
                    end
            },

            SetStyle(SliderStyle),
            Slider {
                name = "sfxlevelslider",
                x = 149,
                y = 72,
                w = 235,
            },

            Slider {
                name = "musiclevelslider",
                x = 149,
                y = 116,
                w = 235,
            },

            Bitmap {
                image = "images/gui/ae_slider_positive",
                name = "bmpMusicPositive",
                x = 390, 
                y = 71,
            },

            Bitmap {
                image = "images/gui/ae_slider_positive",
                name = "bmpSoundPositive",
                x = 390, 
                y = 116,
            },
            Bitmap {
                image = "images/gui/ae_slider_negative",
                name = "bmpMusicNegative",
                x = 122, 
                y = 77,
            },

            Bitmap {
                image = "images/gui/ae_slider_negative",
                name = "bmpSoundNegative",
                x = 122, 
                y = 121,
            },
        },

        SetStyle(ButtonStyle),
        Button {
            x = 216,
            y = 388,
            name = "back",
            --cancel = true,
            default = true,
            graphics = BackButtonGraphics,
            command =
                function()
                    onButtonPressed("ButtonBack");
                end
        },

        Button {
            x = 402,
            y = 388,
            name = "credits",
            graphics = CreditsButtonGraphics;
            command =
                function()
                    DoModal("scripts/credits.lua");
                end
        },
    },

}

