ruby: fix item_find(:selected) in item details screen

develop
jj 2012-10-10 18:01:57 +02:00
parent 5cf42fd6f8
commit 46a24a83fb
1 changed files with 6 additions and 2 deletions

@ -6,8 +6,12 @@ module DFHack
if what == :selected
case curview._rtti_classname
when :viewscreen_itemst
ref = curview.entry_ref[curview.cursor_pos]
ref.item_tg if ref.kind_of?(GeneralRefItem)
if ref = curview.entry_ref[curview.cursor_pos]
ref.item_tg if ref.kind_of?(GeneralRefItem)
else
# not a container
curview.item
end
when :viewscreen_storesst # z/stocks
if curview.in_group_mode == 0 and curview.in_right_list == 1
curview.items[curview.item_cursor]