dofile('data/Lua/Screens/DialogOK.lua')

function OnSceneLoad(screen)
    LoadData(screen)

    if custom_cursors == nil then
        custom_cursors = {}
    end
    screen:SetAllowInput(true)
    local bttn_ok = create_button_ex(screen, 'data/Texture/GUI/Button/bttn_ok.png', 'ok', 513, 473, 120)
    bttn_ok:SetHotKey(HGEK_ENTER)
    
    PlaySound("opening_window")
    
    if play_field or menu then
        screen:SetXY(171, 0)
    end
    play_field_stop = false
    level_screen_stop = false
    if play_field then
        if play_field:IsPaused() == false then
            play_field:Stop()
            play_field_stop = true
        end
        if play_field:GetLevelScreen():IsPaused() == false then
            play_field:GetLevelScreen():Stop()
            level_screen_stop = true
        end
    end
end

function SetCaptions(screen, title, message)
	text_title = CreateTextEntity("WindowText28", message)
    text_title:AttachTo( screen:GetObject('YesNoScreen') )
	text_title:SetScale(1)
	text_title:SetZ(190)
	text_title:SetXY(10, -70)
	text_title:SetXY(-250, -80)
	text_title:SetBorderSize(500, 100)
end

function OnSceneFree()
    FreeData()
end

function OnScreenShown()
end

function OnUpdate(dt)
end

function OnLose()
end

function OnExit()
end

function OnObjectMouseEnter(object)
    DefaultOnObjectMouseEnter(object)
end

function OnObjectMouseLeave(object)
    DefaultOnObjectMouseLeave(object)
end

function OnObjectMouseDown(object)
end

function OnObjectMouseUp(object)
end

function OnObjectRightMouseDown(object)
end

function OnObjectRightMouseUp(object)
end

function OnObjectFound(object)
end

function OnToolFound(tool)
end

function OnToolApply(tool, object)
    DefaultOnToolApply(tool, object)
end

function OnButtonMouseEnter(title)
end

function OnButtonMouseLeave(title)
end

function OnObjectReachPanel(object)
end

function OnButtonPress(title)
    DefaultOnButtonPress(title)
    
    -- destroy this screen
    local current_screen = GetGameManager():GetCurrentScreen()
    current_screen:SetAllowInput(false)
    current_screen:ScreenDestroy()
    
    if play_field then
        if play_field_stop then
            play_field:Go()
        end
        if level_screen_stop then
            play_field:GetLevelScreen():Go()
        end
    end
end

function OnMouseMove(previous_pos, current_pos)
end

function OnSetTool(tool)
end

function OnMinigameCompleted()
end

function OnLostFocus()
end

function OnGainFocus()
end

-- CLEAR_ON_SAVE_BEGIN
-- Do not edit code listed below (generated by the editor on each save)
function LoadData(screen)
	local anim = CreateAnimation('data/Texture/Scenes/Common/pixel.jpg',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('pixel',anim,512,385,70,0,128,96)
	local anim = CreateAnimation('data/Texture/Screen/YesNoScreen/YesNoScreen.png',0,0,606,333,1,0)
	anim:SetHotSpot(303,166)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('YesNoScreen',anim,512,384,100,0,1,1)
	local anim = CreateAnimation('data/Texture/GUI/Button/bttn_back.png',0,0,185,72,1,0)
	anim:SetHotSpot(92,36)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('bttn_back',anim,508,479,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/pixel.jpg',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0xDD000000')
	screen:CreateObject('pixel_bg',anim,512,384,70,0,528,296)
end

function FreeData(screen)
end
-- CLEAR_ON_SAVE_END
