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

function SetCaptions(screen)
	text = CreateTextEntity("WindowText28", GetString("Q_TUTORIAL"))
	text:AttachTo( screen:GetObject('YesNoScreen') )
	text:SetScale(1)
	text:SetZ(190)
	text:SetXY(10, -40)
end

function OnButtonPress(title)
    DefaultOnButtonPress(title)
    
    -- destroy this screen
    dialog:SetAllowInput(false)
    dialog:ScreenDestroy()
    dialog = nil
    
    if title == 'yes' then
        SetTutorialEnabled('true')
    end
    if title == 'no' then
        SetTutorialEnabled('false')
        
        local pf = play_field
        if pf:HasObject('fishing_line') and pf:IsIgnoredOnTestPoint(pf:GetObject('fishing_line')) then
            pf:DoNotIgnoreOnTestPoint('fishing_line')
        end
    end
    
	play_field:GetLevelScreen():GetPanel():SetAllowInput(true)
	play_field:GetLevelScreen():GetPhone():SetAllowInput(true)
	play_field:SetEnabled(true)
	play_field:GetLevelScreen():SetAllowInput(true)

	local current_screen = GetGameManager():GetCurrentScreen()
	current_screen:SetAllowInput(false)
	current_screen:ScreenDestroy()
	
	play_field:Go()
	play_field:GetLevelScreen():Go()
	
	AddGameState('DialogTutorial', '')
	
	if IsSkipTutorial() then   
	    game_state.chain_use_active_zone.Play()
	end
end
