function OnSceneLoad(screen)
    game_state = {}    
    LoadData(screen)
    local pf = play_field
    local level = pf:GetLevelScreen()
    game_state.custom_cursors = {}
    game_state.locked_objects = {}
    --level:AddTaskSafe(CreateTask('', '', ''))
    --zone = CreateZoomZone('')
    game_state.locker = ReferenceCounter()
    game_state.active_zone = nil
    game_state.inventory_zones = {}
    game_state.active_objects = {}
       
    
    -- Create inventory gramophone
    play_field:IgnoreOnTestPoint('pin_animation');
    local anim_pin = play_field:GetObject('pin_animation');
    anim_pin:GetAnimation():Stop();
    anim_pin:GetAnimation():SetFrame(0);
    play_field:GetObject('trumpet_complete'):SetOpacity(0.);    
    

	---------------------------------------------------------------------------------------------
    -- Create inventory gramophone
    local anim_door            = play_field:GetObject('door_animation');
    anim_door:GetAnimation():Stop();
    anim_door:GetAnimation():SetFrame(0);
    game_state.locked_objects['pin'] = true;
    game_state.meta_object = 'cigar6'
end

function OnScreenShown()    
end

function OnSceneFree(screen)
    FreeData(screen)
end

function OnUpdate(dt)
end

function OnNotebookOpened()
    --OnSceneStateChanged(play_field)
end


function OnExit()
end

function OnObjectMouseEnter(object)
    DefaultOnObjectMouseEnter(object)
end

function OnObjectMouseLeave(object)
    DefaultOnObjectMouseLeave(object)
end

function OnObjectMouseDown(object)
    obj_name = object:GetName()
    local pf = play_field
    local is_wrong_click = true

    is_wrong_click = DefaultOnObjectMouseDown(object)

    if is_wrong_click then
        --pf:ShowWrongObjectEffect()
    end

    return is_wrong_click;    
end

function OnObjectMouseUp(object)
end

function OnObjectWasFound(object)
end

function OnObjectWillBeFound(object)	
end

function OnToolFound(tool)
end

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

function OnObjectReachPanel(object)
end

function OnButtonPress(title)
    DefaultOnButtonPress(title)
end

function OnMouseMove(previous_pos, current_pos)
end

function OnSetTool(tool)
end

function CanBeHinted(obj)
    if locked_object[obj] ~= true then
        return true
    else
        return false
    end
end

function OnLostFocus()
end

function OnGainFocus()
end

function OnMinigameCompleted()
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/6_cabinet_chief_repair_3/Items/sewing_machine.png',0,0,105,60,1,0)
	anim:SetHotSpot(52,30)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sewing_machine',anim,420,69,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Animations/door_animation.dds',0,0,143,338,4,8)
	anim:SetHotSpot(286,169)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('door_animation',anim,656,279,90,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Animations/advertisement_animation.dds',0,0,93,76,40,10)
	anim:SetHotSpot(232,304)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('advertisement_animation',anim,1045,715,120,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Layers/bg.jpg',0,0,1024,768,1,0)
	anim:SetHotSpot(512,384)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('bg',anim,512,384,10,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('0x01FFFFFF')
	screen:CreateObject('pixel_gramophone',anim,492,512,250,0,9,7)
	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_keyhole',anim,392,329,255,0,8,8)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Animations/pin_animation.png',0,0,92,27,5,8)
	anim:SetHotSpot(46,13)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('pin_animation',anim,489,520,130,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Items/trumpet.png',0,0,111,119,1,0)
	anim:SetHotSpot(56,60)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('trumpet',anim,776,437,95,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Items/trumpet.png',0,0,111,119,1,0)
	anim:SetHotSpot(56,60)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('trumpet_1',anim,780,456,100,0,0.6,0.6)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Items/spire.png',0,0,47,24,1,0)
	anim:SetHotSpot(23,12)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('spire_complete',anim,482,475,126,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Items/cashe_empty.png',0,0,92,27,1,0)
	anim:SetHotSpot(46,13)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('cashe_empty',anim,490,520,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Items/pin.png',0,0,63,15,1,0)
	anim:SetHotSpot(31,7)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('pin',anim,491,516,120,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Items/pin.png',0,0,63,15,1,0)
	anim:SetHotSpot(31,7)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('pin_1',anim,512,384,1,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('0x01FFFFFF')
	screen:CreateObject('pixel_zoom_door',anim,392,287,250,0,4,38)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Zoom/bg_zoom_door.jpg',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('bg_zoom_door',anim,512,384,1000,0,1,1)
	local anim = CreateAnimation('data/Texture/Comics/Sheriff.dds',0,0,530,636,1,0)
	anim:SetHotSpot(266,256)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('Sheriff',anim,505,390,400,0,1,1)
	local anim = CreateAnimation('data/Texture/Comics/Service_Manager.dds',0,0,661,696,1,0)
	anim:SetHotSpot(330,348)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('Service_Manager',anim,698,420,400,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('0x00FFFFFF')
	screen:CreateObject('pixel1',anim,512,384,401,0,128,96)
	local anim = CreateAnimation('data/Texture/Scenes/Common/pixel.jpg',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('pixel2',anim,512,384,401,0,128,96)
	local anim = CreateAnimation('data/Texture/Scenes/Common/pixel.jpg',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('pixel3',anim,512,384,401,0,128,96)
	local anim = CreateAnimation('data/Texture/Comics/eyes.png',0,0,79,33,1,0)
	anim:SetHotSpot(39,16)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('eyes',anim,499,212,500,0,1,1)
	local anim = CreateAnimation('data/Texture/Comics/SMmask.png',0,0,203,61,1,0)
	anim:SetHotSpot(101,30)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('SMMask',anim,721,158,410,0,1,1)
	local anim = CreateAnimation('data/Texture/Comics/eyes_sm.png',0,0,142,22,1,0)
	anim:SetHotSpot(71,11)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('eyes_sm',anim,729,163,405,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/1_museum_gallery_1/Zoom/screw.png',0,0,39,28,1,0)
	anim:SetHotSpot(19,14)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('screw_1',anim,995,521,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/1_museum_gallery_1/Zoom/screw.png',0,0,39,28,1,0)
	anim:SetHotSpot(19,14)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('screw_2',anim,933,68,100,20,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/1_museum_gallery_1/Zoom/screw.png',0,0,39,28,1,0)
	anim:SetHotSpot(19,14)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('screw_3',anim,293,639,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/1_museum_gallery_1/Zoom/screw.png',0,0,39,28,1,0)
	anim:SetHotSpot(19,14)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('screw_4',anim,387,581,100,20,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Items/awl.png',0,0,71,22,1,0)
	anim:SetHotSpot(35,11)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('awl',anim,447,716,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Items/ball.png',0,0,28,29,1,0)
	anim:SetHotSpot(14,14)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('ball',anim,288,147,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Items/box.png',0,0,107,52,1,0)
	anim:SetHotSpot(53,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('box',anim,266,699,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Items/cat.png',0,0,45,93,1,0)
	anim:SetHotSpot(22,46)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('cat',anim,697,455,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Items/corkscrew.png',0,0,40,47,1,0)
	anim:SetHotSpot(20,23)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('corkscrew',anim,590,432,120,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Items/elephant.png',0,0,85,71,1,0)
	anim:SetHotSpot(42,35)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('elephant',anim,607,72,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Items/goblet.png',0,0,43,71,1,0)
	anim:SetHotSpot(21,35)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('goblet',anim,428,567,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Items/gloves.png',0,0,91,65,1,0)
	anim:SetHotSpot(45,32)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('gloves',anim,764,716,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Items/hammer.png',0,0,78,35,1,0)
	anim:SetHotSpot(39,17)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('hammer',anim,973,601,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Items/iron.png',0,0,67,97,1,0)
	anim:SetHotSpot(33,48)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('iron',anim,849,377,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Items/locomotive.png',0,0,35,25,1,0)
	anim:SetHotSpot(17,12)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('locomotive',anim,328,150,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Items/record.png',0,0,58,57,1,0)
	anim:SetHotSpot(29,28)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('record',anim,641,74,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Items/torch.png',0,0,53,36,1,0)
	anim:SetHotSpot(26,18)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('torch',anim,823,184,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Items/wrenches.png',0,0,67,39,1,0)
	anim:SetHotSpot(33,19)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('wrenches',anim,647,530,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Layers/A.png',0,0,144,97,1,0)
	anim:SetHotSpot(72,49)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('A',anim,237,716,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Layers/B.png',0,0,304,317,1,0)
	anim:SetHotSpot(152,158)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('B',anim,779,427,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Items/trumpet_2.png',0,0,120,131,1,0)
	anim:SetHotSpot(60,65)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('trumpet_complete',anim,501,423,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Items/awl.png',0,0,71,22,1,0)
	anim:SetHotSpot(35,11)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('awl_1',anim,529,384,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Items/record.png',0,0,58,57,1,0)
	anim:SetHotSpot(29,28)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('record_1',anim,574,192,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/Items/candy.png',0,0,44,28,1,0)
	anim:SetHotSpot(22,14)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('candy',anim,497,550,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/6_cabinet_chief_repair_3/cigar6.png',0,0,105,52,1,0)
	anim:SetHotSpot(52,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('cigar6',anim,391,592,105,0,1,1)
end

function FreeData(screen)
end
-- CLEAR_ON_SAVE_END
