dofile ('Data/Scripts/Common/InteractiveHelp.lua')

-- Registered Tips -------------------------------------------------------------
InteractiveHelp.registerTipConstructor('COMICS_GABRIELLA',
    function (id)
        local messageTextAlias      = 'INTERACTIVE_HELP_MSG_'..id
        local instructionsTextAlias = 'INTERACTIVE_HELP_INSTR_'..id
        
        local screen = createInteractiveHelpScreen(Vector2f(285, 200), messageTextAlias, instructionsTextAlias)
        
        screen:addArrowPointerAtObject( current_scene:getPlayField():getEntityNamed('area_comics_gabriella') )
        screen:setForcedObject( current_scene:getPlayField():getEntityNamed('area_comics_gabriella') )
    end,
    function (id)
        return current_scene:getPlayField():isObjectClicked('area_comics_gabriella')
    end)

InteractiveHelp.registerTipConstructor('NOTEBOOK',
    function (id)
        local messageTextAlias      = 'INTERACTIVE_HELP_MSG_'..id
        local instructionsTextAlias = 'INTERACTIVE_HELP_INSTR_'..id
        
        local screen = createInteractiveHelpScreen(Vector2f(490, 420), messageTextAlias, instructionsTextAlias)
        
        screen:addArrowPointerAt( 70, 690, 2.5 )
        screen:setRect(70, 690, 100, 100)
        screen:setConfirmCallback( function()
                                        current_scene:getPanel():getControlsPanel():onNotesButtonClick()
                                        current_scene:getPlayField():getMouseBlocker():push()
                                        current_scene:getPlayField().timer:add( function()
                                                                                    current_scene:getPlayField():getMouseBlocker():pop()
                                                                                    InteractiveHelp.showTip('ZOOM_PICTURE', 1)
                                                                                end, 2)
                                   end )
    end)

InteractiveHelp.registerTipConstructor('ZOOM_PICTURE',
    function (id)
        local messageTextAlias      = 'INTERACTIVE_HELP_MSG_'..id
        local instructionsTextAlias = 'INTERACTIVE_HELP_INSTR_'..id
        
        local screen = createInteractiveHelpScreen(Vector2f(500, 400), messageTextAlias, instructionsTextAlias)
        
        screen:addArrowPointerAtObject( current_scene:getPlayField():getEntityNamed('area_zoom_Picture'), 3.7 )
        screen:setForcedObject( current_scene:getPlayField():getEntityNamed('area_zoom_Picture') )
        
        screen:setConfirmCallback(  function()
                                        current_scene:getPlayField():getMouseBlocker():push()
                                        current_scene:getPlayField().timer:add( function()
                                                                                    current_scene:getPlayField():getMouseBlocker():pop()
                                                                                    InteractiveHelp.showTip('CLICK_ON_PICTURE', 1)
                                                                                end, 1)
                                    end)
    end)
    
InteractiveHelp.registerTipConstructor('CLICK_ON_PICTURE',
    function (id)
        local messageTextAlias      = 'INTERACTIVE_HELP_MSG_'..id
        local instructionsTextAlias = 'INTERACTIVE_HELP_INSTR_'..id
        
        local screen = createInteractiveHelpScreen(Vector2f(300, 200), messageTextAlias, instructionsTextAlias)
        
        --screen:addArrowPointerAtObject( current_scene:getPlayField():getEntityNamed('area_click_on_open_picture') )
        screen:addArrowPointerAt( 540, 420, 1.2 )
        screen:setForcedObject( current_scene:getPlayField():getEntityNamed('area_click_on_open_picture') )
        
        screen:setConfirmCallback(  function()
                                        current_scene:getPlayField():getMouseBlocker():push()
                                        current_scene:getPlayField().timer:add( function()
                                                                                    current_scene:getPlayField():getMouseBlocker():pop()
                                                                                    InteractiveHelp.showTip('CLICK_ON_COIN', 1)
                                                                                end, 1)
                                    end)
    end)
    
InteractiveHelp.registerTipConstructor('CLICK_ON_COIN',
    function (id)
        local messageTextAlias      = 'INTERACTIVE_HELP_MSG_'..id
        local instructionsTextAlias = 'INTERACTIVE_HELP_INSTR_'..id
        
        local screen = createInteractiveHelpScreen(Vector2f(710, 250), messageTextAlias, instructionsTextAlias)
        
        screen:addArrowPointerAtObject( current_scene:getPlayField():getEntityNamed('area_find_coin'), 2.2 )
        screen:setForcedObject( current_scene:getPlayField():getEntityNamed('area_find_coin') )
        
        screen:setConfirmCallback(  function()
                                        current_scene:getPlayField():getMouseBlocker():push()
                                        current_scene:getPlayField().timer:add( function()
                                                                                    current_scene:getPlayField():getMouseBlocker():pop()
                                                                                    InteractiveHelp.showTip('FIND_TOOL', 1)
                                                                                end, 1)
                                    end)
    end) 
    
InteractiveHelp.registerTipConstructor('FIND_TOOL',
    function (id)
        local messageTextAlias      = 'INTERACTIVE_HELP_MSG_'..id
        local instructionsTextAlias = 'INTERACTIVE_HELP_INSTR_'..id
        
        local screen = createInteractiveHelpScreen(Vector2f(280, 200), messageTextAlias, instructionsTextAlias)
        
        screen:addArrowPointerAtObject( current_scene:getPlayField():getEntityNamed('area_find_snakes_eye') )
        screen:setForcedObject( current_scene:getPlayField():getEntityNamed('area_find_snakes_eye') )
    end)
    

    
InteractiveHelp.registerTipConstructor('LINK_SCENE',
    function (id)
        local messageTextAlias      = 'INTERACTIVE_HELP_MSG_'..id
        local instructionsTextAlias = 'INTERACTIVE_HELP_INSTR_'..id
        
        local screen = createInteractiveHelpScreen(Vector2f(700, 280), messageTextAlias, instructionsTextAlias)
        
        screen:addArrowPointerAtObject( current_scene:getPlayField():getEntityNamed('area_link_5'), 2.2 )
        screen:setForcedObject( current_scene:getPlayField():getEntityNamed('area_link_5') )
    end)
    
InteractiveHelp.registerTipConstructor('APPLY_TOOL',
    function (id)
        local messageTextAlias      = 'INTERACTIVE_HELP_MSG_'..id
        local instructionsTextAlias = 'INTERACTIVE_HELP_INSTR_'..id
        
        local screen = createInteractiveHelpScreen(Vector2f(730, 450), messageTextAlias, instructionsTextAlias)
        current_scene:getInventory():slideUp()
        AddUniqueGameState(INVENTORY_LOCK, 'true')
        
        local info  = current_scene:getInventory():getCellInfoByToolName('01_snakes_eye')
        if info then
            screen:addArrowPointerAt( info.cell:getScrX(), info.cell:getScrY(), 2.5)    
        end
        
        screen:addArrowPointerAtObject( current_scene:getPlayField():getEntityNamed('area_apply_snakes_eye'), 3.8 )
        
        screen:setConfirmCallback(  function()
                                        if HasGameState(INVENTORY_LOCK) then
                                            RemoveGameState(INVENTORY_LOCK)
                                        end
                                        current_scene:getInventory():slideDown()
                                    end )
    end) 

InteractiveHelp.registerTipConstructor('CLICK_ON_HINT',
    function (id)
        local messageTextAlias      = 'INTERACTIVE_HELP_MSG_'..id
        local instructionsTextAlias = 'INTERACTIVE_HELP_INSTR_'..id
        
        local screen = createInteractiveHelpScreen(Vector2f(520, 530), messageTextAlias, instructionsTextAlias)
        
        screen:addArrowPointerAtObject( current_scene:getPlayField():getEntityNamed('area_click_hint'), 4.8)
        screen:setForcedObject( current_scene:getPlayField():getEntityNamed('area_click_hint') )
        
        screen:setConfirmCallback(  function()
                                        InteractiveHelp.showTip('APPLY_HINT', 2.5)
                                    end)
    end) 

InteractiveHelp.registerTipConstructor('APPLY_HINT',
    function (id)
        local messageTextAlias      = 'INTERACTIVE_HELP_MSG_'..id
        local instructionsTextAlias = 'INTERACTIVE_HELP_INSTR_'..id
        
        local screen = createInteractiveHelpScreen(Vector2f(512, 384), messageTextAlias, instructionsTextAlias)
        
        screen:addArrowPointerAt( 950, 690, 1 )
        screen:setRect(960, 700, 160, 160)
        
        screen:setConfirmCallback(  function()
                                        current_scene:getPlayField():getMouseBlocker():push()
                                        current_scene:getPlayField().timer:add( function()
                                                                                    current_scene:getPlayField():getMouseBlocker():pop()
                                                                                    local val = current_scene:getPlayField():getHint():hint()
                                                                                    current_scene:getPanel():getControlsPanel():getHintAnimationLogic():addHint(1)
                                                                                end, 1)
                                    end )

    end) 
    
InteractiveHelp.registerTipConstructor('MG_SKIP',
    function (id)
        local messageTextAlias      = 'INTERACTIVE_HELP_MSG_'..id
        local instructionsTextAlias = 'INTERACTIVE_HELP_INSTR_'..id
        
        local screen = createInteractiveHelpScreen(Vector2f(512, 384), messageTextAlias, instructionsTextAlias)
        
        screen:addArrowPointerAt( 950, 690, 1 )
        screen:setRect(512, 384, 1024, 768)
        
        screen:setConfirmCallback(  function()
                                    end)
    end) 
    
InteractiveHelp.registerTipConstructor('HO_ZONE',
    function (id)
        local messageTextAlias      = 'INTERACTIVE_HELP_MSG_'..id
        local instructionsTextAlias = 'INTERACTIVE_HELP_INSTR_'..id
        
        local screen = createInteractiveHelpScreen(Vector2f(800, 470), messageTextAlias, instructionsTextAlias)
        
        screen:addArrowPointerAtObject( current_scene:getPlayField():getEntityNamed('area_link_ho'), 3.4)
        screen:setForcedObject( current_scene:getPlayField():getEntityNamed('area_link_ho') )
    end) 


