Skip to content
Snippets Groups Projects
Commit 2f7a5404 authored by dg's avatar dg
Browse files

id from inventory screen not updates corretly

git-svn-id: http://svn.net-core.org/repos/t-engine4@594 51575b47-30f0-44d4-a5cc-537603b46e54
parent 5c00bce6
No related branches found
No related tags found
No related merge requests found
......@@ -145,6 +145,7 @@ function _M:unregisterDialog(d)
local last = self.dialogs[#self.dialogs] or self
if last.key then last.key:setCurrent() end
if last.mouse then last.mouse:setCurrent() end
if last.on_recover_focus then last:on_recover_focus() end
end
--- The C core gives us command line arguments
......
......@@ -163,6 +163,10 @@ function _M:generateList()
self.scroll = 1
end
function _M:on_recover_focus()
self:generateList()
end
function _M:drawDialog(s)
if self.list[self.sel] and not self.list[self.sel].item then
lines = self.actor.inven_def[self.list[self.sel].inven].description:splitLines(self.iw / 2 - 10, self.font)
......
......@@ -58,10 +58,10 @@ function _M:init(title, actor, filter, action)
end
function _M:use()
game:unregisterDialog(self)
if self.list[self.sel] then
self.action(self.list[self.sel].object, self.list[self.sel].inven, self.list[self.sel].item)
end
game:unregisterDialog(self)
end
function _M:generateList()
......
......@@ -104,10 +104,10 @@ function _M:defineHotkey(id)
end
function _M:use()
game:unregisterDialog(self)
if self.list[self.sel] then
self.action(self.list[self.sel].object, self.list[self.sel].item)
end
game:unregisterDialog(self)
end
function _M:generateList()
......
......@@ -59,6 +59,7 @@ end
--- Identify the object
function _M:identify(id)
print("[Identify]", self.name, true)
self:forAllStack(function(so)
so.identified = id
if so.id_by_type then
......
......@@ -29,6 +29,7 @@ local Map = require "engine.Map"
local Target = require "engine.Target"
local Level = require "engine.Level"
local Birther = require "engine.Birther"
local Astar = require "engine.Astar"
local Store = require "mod.class.Store"
local Trap = require "mod.class.Trap"
......
......@@ -65,7 +65,7 @@ function _M:use()
local act = self.list[self.sel].action
if act == "use" then self.actor:playerUseItem(self.object, self.item, self.inven)
if act == "use" then self.actor:playerUseItem(self.object, self.item, self.inven, self.onuse)
elseif act == "drop" then self.actor:doDrop(self.inven, self.item)
elseif act == "wear" then self.actor:doWear(self.inven, self.item, self.object)
elseif act == "takeoff" then self.actor:doTakeoff(self.inven, self.item, self.object)
......
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