Skip to content
Snippets Groups Projects
Commit 5c922d53 authored by dg's avatar dg
Browse files

Can not use items from the transmog chest popup on level change

git-svn-id: http://svn.net-core.org/repos/t-engine4@5888 51575b47-30f0-44d4-a5cc-537603b46e54
parent ee6588b6
No related branches found
No related tags found
No related merge requests found
......@@ -582,7 +582,7 @@ function _M:changeLevel(lev, zone, params)
d:generateList()
d:updateTitle(titleupdator())
if stop then self:unregisterDialog(d) end
end)
end, true)
self:registerDialog(ud)
end)
d.unload = function()
......
......@@ -25,12 +25,13 @@ local Map = require "engine.Map"
module(..., package.seeall, class.inherit(engine.ui.Dialog))
function _M:init(center_mouse, actor, object, item, inven, onuse)
function _M:init(center_mouse, actor, object, item, inven, onuse, no_use)
self.actor = actor
self.object = object
self.inven = inven
self.item = item
self.onuse = onuse
self.no_use_allowed = no_use
self:generateList()
local name = object:getName()
......@@ -100,7 +101,7 @@ function _M:generateList()
if not self.object:isIdentified() and self.actor:attr("auto_id") and self.actor:attr("auto_id") >= 2 then list[#list+1] = {name="Identify", action="identify"} end
if self.object.__transmo then list[#list+1] = {name="Move to normal inventory", action="toinven"} end
if not self.object.__transmo then if self.object:canUseObject() then list[#list+1] = {name="Use", action="use"} end end
if not self.object.__transmo and not self.no_use_allowed then if self.object:canUseObject() then list[#list+1] = {name="Use", action="use"} end end
if self.inven == self.actor.INVEN_INVEN and self.object:wornInven() and self.actor:getInven(self.object:wornInven()) then list[#list+1] = {name="Wield/Wear", action="wear"} end
if not self.object.__transmo then if self.inven ~= self.actor.INVEN_INVEN and self.object:wornInven() then list[#list+1] = {name="Take off", action="takeoff"} end end
if self.inven == self.actor.INVEN_INVEN then list[#list+1] = {name="Drop", action="drop"} end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment