--------------------------------------------------------------------------------
--  File     : Hut_1st_floor_Cabinet
--  Author(s): Prokopovich Larisa
--
--  Summary  : Скрипт управления локацией.
--
--  Copyright © 2012 Floodlight Games.  All rights reserved.
--------------------------------------------------------------------------------
LOC_1FLOOR				= "Hut_1st_floor"

I_KNIFE					= "KNIFE_Q"		--нож
--------------------------------------------------------------------------------
function OnFirstEntry()
	stars:Show(I_KNIFE, "4")
end
--------------------------------------------------------------------------------
function OnMouseClickOnBack()
	if cstore:GetKey("Close_up_Cabinet") == 1 then
		chapter:JumpRoom(LOC_1FLOOR)
		cstore:SetKey("Close_up_Cabinet", 2)
	else
		chapter:ExitCloseup()
	end
	return true
end
--------------------------------------------------------------------------------
function OnMouseClickOnItem(item)
	local itemName = item:GetName()
	
	if itemName == I_KNIFE then						--нож
		if cstore:GetKey("Close_up_Cabinet") == 1 then
			pick_panel:AddItemsRoom(itemName, LOC_1FLOOR)
		else
			pick_panel:AddItems(itemName, true)
		end
		cstore:SetKey("Close_up_Cabinet", 3)
		room:MarkCompleted()
		return true
	end
end
