diff options
| author | jj | 2012-08-31 19:16:13 +0200 |
|---|---|---|
| committer | jj | 2012-08-31 19:16:13 +0200 |
| commit | ce608e4f6aabef63d8e0da265e964b00109e5380 (patch) | |
| tree | a454b59edaf61f879ee50205a4eed51092cedc76 /plugins/ruby | |
| parent | 54780cac3f03df28d51cfd4a2c59e0dc5369d391 (diff) | |
| download | dfhack-ce608e4f6aabef63d8e0da265e964b00109e5380.tar.gz dfhack-ce608e4f6aabef63d8e0da265e964b00109e5380.tar.bz2 dfhack-ce608e4f6aabef63d8e0da265e964b00109e5380.tar.xz | |
ruby: yield announcements for further customization
Diffstat (limited to 'plugins/ruby')
| -rw-r--r-- | plugins/ruby/ui.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/ruby/ui.rb b/plugins/ruby/ui.rb index 9dded66c..00f73184 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 |
