changeset 144:9fb18f3d6e26

added warning dialog for attacks
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Fri, 31 Oct 2008 16:13:36 +0800
parents bfa78302cf09
children aad08889ddb3 00a21f73e906
files agent.pl
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/agent.pl	Fri Oct 31 12:47:34 2008 +0800
+++ b/agent.pl	Fri Oct 31 16:13:36 2008 +0800
@@ -20,6 +20,11 @@
 
 sub is_attacked {
     my ($self, $city) = @_;
+    if($self->{'ikariam'}->{'military'}->{attacks} > 0) {
+        # notify youself.
+        system('zenity --warning  --title="Ikariam" --text="You are attacked"');
+    }
+
     return ($self->{'ikariam'}->{'military'}->{attacks} > 0 ) ? 1 : 0;
 }