diff options
| author | jj | 2012-09-17 21:16:01 +0200 |
|---|---|---|
| committer | jj | 2012-09-18 10:17:33 +0200 |
| commit | 57d01f00084f4e035a82a4bddeb3a5e28a278883 (patch) | |
| tree | 67038f81068571dc2a073d81d5d8346ac8bec4ed /plugins/ruby | |
| parent | 2032f8e4070292d5777fb6b28d007f9c05076630 (diff) | |
| download | dfhack-57d01f00084f4e035a82a4bddeb3a5e28a278883.tar.gz dfhack-57d01f00084f4e035a82a4bddeb3a5e28a278883.tar.bz2 dfhack-57d01f00084f4e035a82a4bddeb3a5e28a278883.tar.xz | |
ruby: use ui.follow_item/unit in unit_find, show non-english names by default
Diffstat (limited to 'plugins/ruby')
| -rw-r--r-- | plugins/ruby/item.rb | 2 | ||||
| -rw-r--r-- | plugins/ruby/unit.rb | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/plugins/ruby/item.rb b/plugins/ruby/item.rb index 34b40450..032c0d8c 100644 --- a/plugins/ruby/item.rb +++ b/plugins/ruby/item.rb @@ -26,6 +26,8 @@ module DFHack u = world.units.active[ui_selected_unit] u.inventory[ui_look_cursor].item if u and u.pos.z == cursor.z and ui_unit_view_mode.value == :Inventory and u.inventory[ui_look_cursor] + else + ui.follow_item_tg if ui.follow_item != -1 end end elsif what.kind_of?(Integer) diff --git a/plugins/ruby/unit.rb b/plugins/ruby/unit.rb index 1a619c5c..f0eeb138 100644 --- a/plugins/ruby/unit.rb +++ b/plugins/ruby/unit.rb @@ -24,6 +24,8 @@ module DFHack when :LookAround k = ui_look_list.items[ui_look_cursor] k.unit if k.type == :Unit + else + ui.follow_unit_tg if ui.follow_unit != -1 end end elsif what.kind_of?(Integer) @@ -104,7 +106,7 @@ module DFHack end class LanguageName - def to_s(english=true) + def to_s(english=false) df.translate_name(self, english) end end |
