diff options
Diffstat (limited to 'plugins/ruby/ui.rb')
| -rw-r--r-- | plugins/ruby/ui.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/ruby/ui.rb b/plugins/ruby/ui.rb index 9dded66c..a9dd0543 100644 --- a/plugins/ruby/ui.rb +++ b/plugins/ruby/ui.rb @@ -66,11 +66,12 @@ module DFHack world.status.reports << rep world.status.announcements << rep world.status.display_timer = 2000 + yield rep if block_given? end end - # add an announcement to display in a game popup message - # (eg "the megabeast foobar arrived") + # add an announcement to display in a game popup message + # (eg "the megabeast foobar arrived") def popup_announcement(str, color=nil, bright=nil) pop = PopupMessage.cpp_new(:text => str) pop.color = color if color @@ -78,4 +79,13 @@ module DFHack world.status.popups << pop end end + + class Viewscreen + def feed_keys(*keys) + keyset = StlSet.cpp_new(keys, InterfaceKey) + ret = feed(keyset) + keyset._cpp_delete + ret + end + end end |
