--- deliantra/server/ext/item-worldmap.ext 2007/07/22 14:17:58 1.3 +++ deliantra/server/ext/item-worldmap.ext 2007/07/22 17:10:06 1.4 @@ -1,5 +1,17 @@ #! perl # depends=widget -#! perl + +# this module implements a rather fancy worldmap + +our $WORLDMAP_UPDATE_INTERVAL = $cfg::CFG{worldmap_update_interval} || 10; + +cf::async_ext { + my $schedule_interval = Coro::Event->timer (after => 1); + + while () { + $schedule_interval->interval ($WORLDMAP_UPDATE_INTERVAL); + $schedule_interval->next; + } +}; sub create_widgets { my ($ns) = @_; @@ -31,7 +43,11 @@ $info } -# this module implements a rather fancy worldmap +sub update_worldmap { + my ($ns) = @_; + + my $ws = $ns->{ws_worldmap} or return; +} cf::object::attachment item_worldmap => on_apply => sub { @@ -41,7 +57,10 @@ if ($ns->{can_widget}) { my $ws = $ns->{ws_worldmap} ||= create_widgets $ns; - $ws->{toplevel}->show; + $ws->{toplevel}->toggle_visibility; + $ws->{toplevel}->get (visible => sub { + update_worldmap $ns; + }); } else { $ns->send_msg ("log", "Your client doesn't support the (required) widget extension. Try CFPlus at http://crossfire.schmorp.de/.", cf::NDI_RED); }