require( "scripts/style.lua" );
require( "scripts/ui/style_text.lua" );

MakeDialog
{
    WindowExt
    {
        x = 512,
        y = 384,
        fit = true,
        name = "messagebox_ok",
        
        state_handlers = {
            justcreated = function()
                ShowControl("messagebox_ok");
                PauseTimer("ui", "UI");
                PauseTimer("panels", "UI");
                PauseTimer("pnl_pause", "UI");
                PauseTimer("game", "game");
                EnableWindow("pnl_water_barrel_rollover", false);
                EnableWindow("pnl_fountain_rollover", false);
                EnableWindow("pnl_gates_rollover", false);
                EnableWindow("pnl_magic_object_rollover", false);
                EnableWindow("pnl_storage_rollover", false);
            end;
            hidden = function()
                StartTimer("ui", "UI");
                StartTimer("panels", "UI");
                StartTimer("pnl_pause", "UI");
                StartTimer("game", "game");
                CloseWindow();
            end;
        },
        
        Bitmap
        {
            name="yesnobackground",
            image="backgrounds/dialog",
            x=kCenter,
            y=kCenter,
            
            SetStyle(ButtonStyle),
            Button
            {
                font = CreateNamedFont(MinionSbItSymbolSet, 24, ButtonBrown),
                graphics = StandardButtonGraphics,
                close = true,
                flags = kVAlignCenter + kHAlignCenter,
                label = "ok",
                name = "ok",
                command = function()
                    if gDialogTable.cmd then
                        gDialogTable.cmd();
                    end;
                    HideControl("messagebox_ok");
                end,
                x = kCenter,
                y = 220,
            },

            SetStyle(TextStyle),
            CreateMinionSbItText(24, CaptionBrown, kCenter+1, 34, "#"..GetString("caption_outline", GetString(gDialogTable.title)), 300, 80),
            CreateMinionSbItText(24, CaptionYellow, kCenter, 33, "#"..GetString("caption_outline", GetString(gDialogTable.title)), 300, 80),
            
            CreateMinionSbItText(20, ShadowColor, kCenter+1, kCenter - 9, "#"..GetString("caption_outline", GetString(gDialogTable.body)), 300, 220),
            CreateMinionSbItText(20, WhiteColor, kCenter, kCenter - 10, "#"..GetString("caption_outline", GetString(gDialogTable.body)), 300, 220),

            -- LAMP FX

            WndFxSprite
            {
                name = "left_lamp_firebugs_fx",
                x = 0,
                y = 0,
                w = 580,
                h = 310,
                effect_position = "67,96",
                file_name = "fx/lamp_firebugs.lua",
                start_activate = true,
                advance = 50,
                timer_settings = {
                    name = "control",
                    category = "control",
                },
            },

            WndFxSprite
            {
                name = "right_lamp_firebugs_fx",
                x = 0,
                y = 0,
                w = 580,
                h = 310,
                effect_position = "518,96",
                file_name = "fx/lamp_firebugs.lua",
                start_activate = true,
                advance = 50,
                timer_settings = {
                    name = "control",
                    category = "control",
                },
            },

            WndFxSprite
            {
                name = "left_lamp_light_fx",
                x = 0,
                y = 0,
                w = 580,
                h = 310,
                effect_position = "67,96",
                file_name = "fx/lamp_light.lua",
                start_activate = true,
                advance = 50,
                timer_settings = {
                    name = "control",
                    category = "control",
                },
            },

            WndFxSprite
            {
                name = "right_lamp_light_fx",
                x = 0,
                y = 0,
                w = 580,
                h = 310,
                effect_position = "518,96",
                file_name = "fx/lamp_light.lua",
                start_activate = true,
                advance = 50,
                timer_settings = {
                    name = "control",
                    category = "control",
                },
            },
        },
    },
} -- MakeDialog
