GameScreen.textures_path = "graphics/screens/02_elevator/location/"

GameScreen.hint_table = {
    {obj = {"shaft_hint", 547, 0}, fun = function() if(GetState(CURRENT_SCREEN, "state") == "") then return true end end},
    {obj = {"button_panel_hint", 772, 626}, fun = function() if(GetState(CURRENT_SCREEN, "state") == "panel") then return true end end, tool = "panel_002"},
    {obj = {"button_hint", 828, 733}, fun = function() if(GetState(CURRENT_SCREEN, "state") == "finish") then return true end end},
}

function GameScreen:RestoreScreen()
    if(GetState(CURRENT_SCREEN, "state") == "") then
    elseif(GetState(CURRENT_SCREEN, "state") == "panel") then
    elseif(GetState(CURRENT_SCREEN, "state") == "finish") then
        self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "button_panel_affix", "graphics/screens/02_elevator/location/button_panel_affix",786, 640);
        self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "button_hand", "graphics/screens/02_elevator/location/button_hand",843, 748);
        self:SetItemCursor("button_hand", "hand")
        ItemRemove(self.name, "button_panel_eye")
    end
    
    for found_item in string.gmatch(GetState(CURRENT_SCREEN, "found_obj"), "[_%a%d]+") do
		ItemRemove(self.name, found_item)
		ItemRemove(self.name, found_item.."_shadow")
    end 
end
	
function GameScreen:InitScreen()
    self:LoadScreen()
    self:RestoreScreen();
     
    self:SetItemCursor("button_panel_eye", "eye")
    local panel_apply = function()
        Inventory:ActiveToolApply()
        self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "button_panel_affix", "graphics/screens/02_elevator/location/button_panel_affix",786, 640);
        self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "button_hand", "graphics/screens/02_elevator/location/button_hand",840, 745);
        ItemSetOpacity("button_panel_affix", 0.0)
        ItemChangeOpacity("button_panel_affix", 1.0, 0.3)
        self:SetItemCursor("button_hand", "hand")
        SetState(CURRENT_SCREEN, "state", "finish")
        ItemRemove(self.name, "button_panel_eye")
    end
    self:AddToolApplyZone("button_panel_eye", "panel_002", panel_apply, true);
    
    self:CreateLocationPortal("shaft_eye", "002_shaft", "eye")
    self:CreateLocationPortal("hall_return_eye", "002_hall", "eye")

    MusicPlay({"sound/ambient/02_ambient.ogg", "sound/music/hospital.ogg"}, 2) 
end
function GameScreen:onObjectClick(item_name)
    if(item_name == "button_panel_eye") then
        HUDScreen:ShowTips({path = "graphics/screens/02_elevator/location/Text_02f", x = 438, y = 1129})
    end
    if(item_name == "button_hand") then
        SetState("screen_002_hall", "state", "elev_closing")
        clApplication:LoadLocation("002_hall")
    end
end
------------------------------------------------------------------------------------------------------
-------------------------------------------Mouse functions--------------------------------------------
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
function GameScreen:LoadScreen()
	--[[---Background---]]--
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "02_elevator", "graphics/screens/02_elevator/location/02_elevator",0, 0);

    self:CreateObj(OBJ_TYPE.TRIGGER, "hall_return_eye", "graphics/screens/02_elevator/location/hall_return_eye",1072, 238);
    self:CreateObj(OBJ_TYPE.TRIGGER, "button_panel_eye", "graphics/screens/02_elevator/location/button_panel_eye",784, 640);
    
    self:CreateObj(OBJ_TYPE.TRIGGER, "shaft_eye", "graphics/screens/02_elevator/location/shaft_eye",562, 0);
    
    clScreenManager:add_screen("hud") 
end
