function OnSceneLoad(screen)
    LoadData(screen)

    dialog = screen
    dialog:SetAllowInput(true)
    local bttn_yes = create_button_ex(screen, 'data/Texture/GUI/Button/bttn_yes.png', 'yes', 403, 476, 110)
    bttn_yes:SetHotKey(HGEK_ENTER)
    local bttn_no = create_button_ex(screen, 'data/Texture/GUI/Button/bttn_no.png', 'no', 629, 476, 110)
    bttn_no:SetHotKey(HGEK_ESCAPE)
    SetCaptions(screen)
    PlaySound("opening_window")
    
    SetCursor( GetCursorArrow() )
    
    screen:SetXY(171, 0)
end

function SetCaptions(screen)
	text = CreateTextEntity("WindowText28", GetString("Q_QUIT"))
	text:AttachTo( screen:GetObject('YesNoScreen') )
	text:SetScale(1)
	text:SetZ(190)
	text:SetXY(10, -70)
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 OnButtonPress(title)
    DefaultOnButtonPress(title)
    
    -- destroy this screen
    dialog:SetAllowInput(false)
    dialog:ScreenDestroy()
    dialog = nil
    
    if title == 'yes' then
        GetGameApp():DoExit(true)
    end
    
    if title == 'no' then
        menu:SetAllowInput(true)
    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_yes',anim,398,482,105,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_no',anim,623,482,105,0,1,1)
end

function FreeData(screen)
end
-- CLEAR_ON_SAVE_END
