local zone_news

function OnSceneLoad(screen)
    LoadData(screen)
    
    game_screen = screen;
    
    DefaultOnSceneLoad('data/Scenes/04_Hotel_Street_Sunset_Main.lua', 'quest')
	
	RegisterQuestObjects('area_metrodotel')

    LinkScene('area_hotel', 'CursorDoorLeft', 'data/Scenes/02_Hotel_Reception_Main.lua', false)
    LinkScene('area_metrodotel', 'CursorDoorUp', 'data/Scenes/05_Metrodotel_Hall_Main.lua', false)
    
	local on_load_when_light_clicked = function()
		game_state.ignore_on_highlight['area_left_light'] = true
		game_state.ignore_on_highlight['area_right_light'] = true
	end

    RegisterActiveObject('area_left_light',
                        ShowRandomLightComment,
                        on_load_when_light_clicked,
						true,
						'CursorGlass')
                        
    RegisterActiveObject('area_right_light',
                        ShowRandomLightComment,
                        on_load_when_light_clicked,
						true,
						'CursorGlass')
    
    MakeSoundEntity("wind"):Play(true);

    zone_news = CreateZoomZone('Newspaper',
							   'CloseNewspaperZoom_04',
							   'BG_Zoom_Newspaper', true);
	zone_news.on_open = function()
		game_state.ignore_on_highlight['Newspaper'] = true
		AddGameState('IgnoreOnHighlight', 'Newspaper')
	end

    game_state.ignore_on_highlight['area_hotel'] = true
	HighlightObject('area_metrodotel')

	MiniGameFlag = false;
end

function ShowRandomLightComment()
	game_state.ignore_on_highlight['area_left_light'] = true
	game_state.ignore_on_highlight['area_right_light'] = true

    ShowMonolog('04_street_light_comment',
                 SelectRandom('C_04_STREET_LIGHTS_1',
                              'C_04_STREET_LIGHTS_2',
                              'C_04_STREET_LIGHTS_3')
                );

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	
    
    if(obj_name == 'area_Lock') then
		MiniGameFlag = true;
	end
    
    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 OnSceneDestroy(playfield)
    DefaultOnSceneDestroy(playfield)
end

function LevelLoaded(level)
    AddFlyingLeavesAnimation(level, 120);

	local anim = level:CreateAnimation('data/Texture/Scenes/04_Hotel_Street_Sunset/Clouds.png');
	anim:SetPosXY(512+220, 95);
	anim:SetOpacity(0.6);
	anim:SetScaleXY(1, 1);
	anim:SetPosZ(47);

	local effector = CreateTextureEffector();
	effector:AttachToAnimation(anim);
	effector:SetSpeed(-16);
	effector:Play();
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/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_hotel',anim,80,418,100,0,20,70)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_metrodotel',anim,857,474,100,0,10,15)
	local anim = CreateAnimation('data/Texture/Scenes/04_Hotel_Street_Sunset/BG_Hotel_street_Sunset.jpg',0,0,1024,768,1,0)
	anim:SetHotSpot(512,384)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('BG_Hotel_street_Sunset',anim,512,384,40,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_left_light',anim,457,286,100,0,10,15)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_right_light',anim,907,289,100,0,10,16)
	local anim = CreateAnimation('data/Texture/Scenes/04_Hotel_Street_Sunset/Newspaper.png',0,0,150,70,1,0)
	anim:SetHotSpot(110,25)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Newspaper',anim,399,640,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/04_Hotel_Street_Sunset/Zoom_newspaper/BG_Zoom_Newspaper.jpg',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('BG_Zoom_Newspaper',anim,512,384,150,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/04_Hotel_Street_Sunset/sky.jpg',0,0,1024,357,1,0)
	anim:SetHotSpot(512,0)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sky',anim,626,0,4,0,0.78,0.5)
	local anim = CreateAnimation('data/Texture/Scenes/04_Hotel_Street_Sunset/Layer_Top.png',0,0,801,235,1,0)
	anim:SetHotSpot(400,0)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_Top',anim,623,-3,100,0,1,1)
end

function FreeData(screen)
end
-- CLEAR_ON_SAVE_END
