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

local wnd_name = "hint";
local timer_default = {
    name = "panels",
    category = "UI",
};

SkipFrameButtonGraphics = {
    "interface/game/pnl_tutorial/btn_skip_frame/normal",
    "interface/game/pnl_tutorial/btn_skip_frame/pressed",
    "interface/game/pnl_tutorial/btn_skip_frame/over",
};
SkipTutorialButtonGraphics = {
    "interface/game/pnl_tutorial/btn_skip_tutorial/normal",
    "interface/game/pnl_tutorial/btn_skip_tutorial/pressed",
    "interface/game/pnl_tutorial/btn_skip_tutorial/over",
};

MakeDialog
{
    Bitmap
    {
        name = wnd_name,
        image = "interface/game/pnl_tutorial/back",
        fit = true,
        x = 123, y = 143,
        
        SetStyle(TextStyle),
        CreateLucidaNamedText(19, BlackColor, 80, 80, "stub", 255, 160, "text"),
        CreateNamedText(12, GrayColor, 250, 55, "skip_tutorial", 76, 18, "txt_skip_tutorial"),
        
        SetStyle({flags = kVAlignCenter + kHAlignCenter,}),
        Button
        {
            x=kCenter,
            y=kMax-65,
            name="skip_frame",
            label = "ok",
            graphics = SkipFrameButtonGraphics,
            sound = "audio/sfx/game_ui/button_clickUI.ogg",
            rolloversound = "audio/sfx/game_ui/button_rolloverUI.ogg",
            mask = "interface/game/pnl_tutorial/btn_skip_frame/normal_alpha",
            font = CreateNamedFont(MinionSymbolSet, 15, ButtonBrown),
            command = function()
                HM_HintOkPress();
            end;
        },
        Button
        {
            x=320,
            y=51,
            name="skip_tutorial",
            graphics = SkipTutorialButtonGraphics,
            sound = "audio/sfx/game_ui/button_clickUI.ogg",
            rolloversound = "audio/sfx/game_ui/button_rolloverUI.ogg",
            command = function()
                GM_StartPersistentAction("UIClick");
                if (IsDay()) then
                    GM_StartPersistentAction("GameClick");
                else
                    if not kDialogActive then
                        GM_StartPersistentAction("ShopClick");
                    end;
                end;
                HM_HideHint();
                kSkipTutorialShowed = true;
                retval = DisplayDialog{
                    "scripts/dlg_yesno.lua",
                    title = "title_skip_tutorial",
                    body = "body_skip_tutorial",
                    image = "interface/dlg_yes_no/skip_tutorial",
                    dlg_name = "dlg_skip_tutorial",
                    timer = {
                        name = "ui",
                        category = "UI",
                    },
                };
                kSkipTutorialShowed = false;
                if retval == "yes" then
                    HM_HintSkipPress();
                    if GetCount("hint_accept_quest") < 2 then
                        ResetShopStarted();
                    end;
                    if GetCount("pnl_sell_screen_state") == 2 then
                        ActivateControl('buttonSlot1');
                        GM_StartPersistentAction("PotionClick");
                    end;
                else
                    HM_RestoreHint();
                end;
            end;
        },
    },
} -- MakeDialog
