function OnSceneLoad(screen)
    LoadData(screen)
    DefaultOnSceneLoad('data/Scenes/21_Mill_Workshop_HO.lua', 'hidden_object', 'data/Scenes/21_Mill_Workshop_Main.lua')
    
    play_field:IgnoreOnTestPoint('BG_Grabli');
    play_field:IgnoreOnTestPoint('BG_Vily');
    play_field:IgnoreOnTestPoint('BG_Vedro');
    play_field:IgnoreOnTestPoint('BG_Kruzhka1');
    
    AddTask(CreateTask('CUP',       'CUPS',  'Cup1', 'Cup2', 'Cup3'));
    AddTask(CreateTask('HOOK',      'HOOKS', 'Hook1', 'Hook2', 'Hook3'));
    AddTask(CreateTask('PITCHFORK', '',      'Pitchfork'))
    
    AddRandomTasks( CreateTask('BOLT',              '', 'Bolt'),
                    CreateTask('BUCKET',            '', 'Bucket'),
                    CreateTask('BUG',               '', 'Bug'),
                    CreateTask('BUNDLE_OF_WHEAT',   '', 'BundleOfSpikelets'),
                    CreateTask('BUTTERFLY',         '', 'Butterfly'),
                    CreateTask('CANDLESTICK',       '', 'Candlestick'),
                    CreateTask('CAT',               '', 'Cat'),
                    CreateTask('CIRCUITRY',         '', 'Circuitry'),
                    CreateTask('CLOTHESPIN',        '', 'Clothespin'),
                    CreateTask('DOLL',              '', 'Doll'),
                    CreateTask('FEATHER',           '', 'Feather'),
                    CreateTask('NAPILNIK',          '', 'File'),
                    CreateTask('FISH',              '', 'Fish'),
                    CreateTask('FROG',              '', 'Frog'),
                    CreateTask('GARLAND',           '', 'Garland'),
                    CreateTask('GRASSHOPPER',       '', 'Grasshopper'),
                    CreateTask('HANDBELL',          '', 'Handbell'),
                    CreateTask('HORSESHOE',         '', 'Horseshoe'),
                    CreateTask('KEY',               '', 'Key'),
                    CreateTask('LARGEBOTTLE',       '', 'LargeBottle'),
                    CreateTask('OAKTWIG',           '', 'OakTwig'),
                    CreateTask('ONIONS',            '', 'Onions'),
                    CreateTask('PINION',            '', 'Pinion'),
                    CreateTask('PIPE',              '', 'Pipe'),
                    CreateTask('RAKE',              '', 'Rake'),
                    CreateTask('ROPE',              '', 'Rope'),
                    CreateTask('SABOTS',            '', 'Sabots'),
                    CreateTask('SAW_BLADE',         '', 'Saw'),
                    CreateTask('POT',               '', 'Scoop'),
                    CreateTask('SIEVE',             '', 'Sieve'),
                    CreateTask('SPIDER',            '', 'Spider'),
                    CreateTask('WHEAT_SPIKE',       '', 'Spikelet'),
                    CreateTask('WALKING_STICK',     '', 'Stick'),
                    CreateTask('SPOOL_OF_THREAD',   '', 'Threads'));
    
    RegisterToolFindInfo('21_pitchfork');
end

function OnSceneFree(screen)
    DefaultOnSceneFree()
    FreeData(screen)
end

function OnUpdate(dt)
    DefaultOnUpdate(dt)
end

function OnAllItemsFound()
    DefaultOnAllItemsFound()
end

function OnLose()
    DefaultOnLose()
end

function OnExit()
    DefaultOnExit()
end

function OnClose()
    DefaultOnClose()
end

function OnObjectMouseEnter(object)
    DefaultOnObjectMouseEnter(object)
end

function OnObjectMouseLeave(object)
    DefaultOnObjectMouseLeave(object)
end

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

    DefaultOnObjectMouseDownProcessed(is_wrong_click);
end

function OnObjectMouseUp(object)
    DefaultOnObjectMouseUp(object)
end

function OnObjectFound(object)
    DefaultOnObjectFound(object)
end

function OnToolFound(tool)
    DefaultOnToolFound(tool)
end

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

function OnObjectReachPanel(object)
    DefaultOnObjectReachPanel(object)
end

function OnButtonPress(title)
    DefaultOnButtonPress(title)
end

function OnMouseMove(previous_pos, current_pos)
    DefaultOnMouseMove(previous_pos, current_pos)
end

function OnSetTool(tool)
    DefaultOnSetTool(tool)
end

function LevelLoaded(level)
end

function OnSceneDestroy(playfield)
    DefaultOnSceneDestroy(playfield)
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/21_Mill_workshop/Zone_HO/Layers/background.jpg',0,0,1024,768,1,0)
	anim:SetHotSpot(512,384)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('background',anim,512,384,99,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Bolt.png',0,0,59,43,1,0)
	anim:SetHotSpot(29,21)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Bolt',anim,358,597,106,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Bucket.png',0,0,156,97,1,0)
	anim:SetHotSpot(78,48)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Bucket',anim,453,567,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Bug.png',0,0,41,61,1,0)
	anim:SetHotSpot(20,30)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Bug',anim,40,467,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/BundleOfSpikelets.png',0,0,72,194,1,0)
	anim:SetHotSpot(36,97)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('BundleOfSpikelets',anim,582,520,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Butterfly.png',0,0,86,47,1,0)
	anim:SetHotSpot(43,23)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Butterfly',anim,923,145,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Candlestick.png',0,0,72,108,1,0)
	anim:SetHotSpot(36,54)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Candlestick',anim,298,466,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Cat.png',0,0,94,82,1,0)
	anim:SetHotSpot(47,41)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Cat',anim,664,165,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Circuitry.png',0,0,56,142,1,0)
	anim:SetHotSpot(28,71)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Circuitry',anim,720,75,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Clothespin.png',0,0,58,22,1,0)
	anim:SetHotSpot(29,11)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Clothespin',anim,912,302,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Cup1.png',0,0,81,70,1,0)
	anim:SetHotSpot(40,35)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Cup1',anim,36,574,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Cup2.png',0,0,71,60,1,0)
	anim:SetHotSpot(35,30)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Cup2',anim,557,612,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Cup3.png',0,0,73,42,1,0)
	anim:SetHotSpot(36,21)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Cup3',anim,108,488,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Doll.png',0,0,95,67,1,0)
	anim:SetHotSpot(47,33)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Doll',anim,766,442,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Feather.png',0,0,75,52,1,0)
	anim:SetHotSpot(37,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Feather',anim,672,267,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/File.png',0,0,154,34,1,0)
	anim:SetHotSpot(77,17)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('File',anim,150,612,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Fish.png',0,0,56,135,1,0)
	anim:SetHotSpot(28,67)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Fish',anim,31,185,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Frog.png',0,0,56,53,1,0)
	anim:SetHotSpot(28,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Frog',anim,198,473,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Garland.png',0,0,127,123,1,0)
	anim:SetHotSpot(63,61)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Garland',anim,191,183,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Grasshopper.png',0,0,78,47,1,0)
	anim:SetHotSpot(39,23)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Grasshopper',anim,735,528,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Handbell.png',0,0,69,57,1,0)
	anim:SetHotSpot(34,28)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Handbell',anim,332,473,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Hook1.png',0,0,88,68,1,0)
	anim:SetHotSpot(44,34)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Hook1',anim,714,644,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Hook2.png',0,0,115,47,1,0)
	anim:SetHotSpot(57,23)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Hook2',anim,191,574,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Hook3.png',0,0,40,122,1,0)
	anim:SetHotSpot(20,61)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Hook3',anim,508,59,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Horseshoe.png',0,0,66,70,1,0)
	anim:SetHotSpot(33,35)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Horseshoe',anim,431,218,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Key.png',0,0,93,30,1,0)
	anim:SetHotSpot(46,15)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Key',anim,383,573,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/LargeBottle.png',0,0,107,150,1,0)
	anim:SetHotSpot(53,75)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('LargeBottle',anim,680,550,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/OakTwig.png',0,0,138,104,1,0)
	anim:SetHotSpot(69,52)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('OakTwig',anim,633,456,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Onions.png',0,0,66,124,1,0)
	anim:SetHotSpot(33,62)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Onions',anim,94,139,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Pinion.png',0,0,64,61,1,0)
	anim:SetHotSpot(32,30)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Pinion',anim,268,594,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Pipe.png',0,0,77,96,1,0)
	anim:SetHotSpot(38,48)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Pipe',anim,375,543,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Pitchfork.png',0,0,84,332,1,0)
	anim:SetHotSpot(42,166)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Pitchfork',anim,60,413,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Rake.png',0,0,128,329,1,0)
	anim:SetHotSpot(64,164)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Rake',anim,442,436,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Rope.png',0,0,122,54,1,0)
	anim:SetHotSpot(61,27)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Rope',anim,136,283,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Sabots.png',0,0,73,64,1,0)
	anim:SetHotSpot(36,32)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Sabots',anim,782,573,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Saw.png',0,0,96,97,1,0)
	anim:SetHotSpot(48,48)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Saw',anim,54,74,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Scoop.png',0,0,103,108,1,0)
	anim:SetHotSpot(51,54)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Scoop',anim,465,617,106,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Sieve.png',0,0,124,106,1,0)
	anim:SetHotSpot(62,53)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Sieve',anim,94,568,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Spider.png',0,0,97,53,1,0)
	anim:SetHotSpot(48,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Spider',anim,786,114,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Spikelet.png',0,0,91,26,1,0)
	anim:SetHotSpot(45,13)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Spikelet',anim,190,434,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Stick.png',0,0,136,267,1,0)
	anim:SetHotSpot(68,133)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Stick',anim,840,556,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Items/Threads.png',0,0,56,47,1,0)
	anim:SetHotSpot(28,23)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Threads',anim,994,436,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Layers/BG_Grabli.png',0,0,65,87,1,0)
	anim:SetHotSpot(32,43)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('BG_Grabli',anim,401,323,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Layers/BG_Kruzhka1.png',0,0,52,61,1,0)
	anim:SetHotSpot(26,30)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('BG_Kruzhka1',anim,44,595,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Layers/BG_Pila1.png',0,0,31,67,1,0)
	anim:SetHotSpot(15,33)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('BG_Pila1',anim,13,70,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Layers/BG_Prischepka.png',0,0,63,19,1,0)
	anim:SetHotSpot(31,9)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('BG_Prischepka',anim,912,309,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Layers/BG_Tsep.png',0,0,58,72,1,0)
	anim:SetHotSpot(29,36)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('BG_Tsep',anim,718,36,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Layers/BG_Vedro.png',0,0,78,89,1,0)
	anim:SetHotSpot(39,44)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('BG_Vedro',anim,405,582,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Layers/BG_Vetka duba.png',0,0,149,80,1,0)
	anim:SetHotSpot(74,40)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('BG_Vetka duba',anim,623,435,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Mill_workshop/Zone_HO/Layers/BG_Vily.png',0,0,89,304,1,0)
	anim:SetHotSpot(44,152)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('BG_Vily',anim,63,430,102,0,1,1)
end

function FreeData(screen)
end
-- CLEAR_ON_SAVE_END
