diff options
| author | jj | 2012-08-11 22:25:08 +0200 |
|---|---|---|
| committer | jj | 2012-08-11 22:25:08 +0200 |
| commit | 2362bb8eea2d45352fc42c995d8aa2d0fb2b4689 (patch) | |
| tree | eef6b0bcde5f3886e59c2fb9a22d38147e9b2907 /plugins/ruby | |
| parent | cb04a082fd60499c4463809787b1f9b93b7b0f1b (diff) | |
| download | dfhack-2362bb8eea2d45352fc42c995d8aa2d0fb2b4689.tar.gz dfhack-2362bb8eea2d45352fc42c995d8aa2d0fb2b4689.tar.bz2 dfhack-2362bb8eea2d45352fc42c995d8aa2d0fb2b4689.tar.xz | |
ruby: add popup_announcement method
Diffstat (limited to 'plugins/ruby')
| -rw-r--r-- | plugins/ruby/ui.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/ruby/ui.rb b/plugins/ruby/ui.rb index 6d2b5c2c..9dded66c 100644 --- a/plugins/ruby/ui.rb +++ b/plugins/ruby/ui.rb @@ -68,5 +68,14 @@ module DFHack world.status.display_timer = 2000 end end + + # 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 + pop.bright = bright if bright + world.status.popups << pop + end end end |
