… | |
… | |
26 | text => $k, |
26 | text => $k, |
27 | fontsize => 0.2, |
27 | fontsize => 0.2, |
28 | ); |
28 | ); |
29 | |
29 | |
30 | my $marker = $ws->new (Face => |
30 | my $marker = $ws->new (Face => |
31 | face => $ws->{ns}->find_face ("res/map-arrow.png"), |
31 | face => $ws->{ns}->need_face ("res/map-arrow"), |
32 | ); |
32 | ); |
33 | my $children = [$label, $marker]; |
33 | my $children = [$label, $marker]; |
34 | |
34 | |
35 | $ws->{canvas}->add (my $vbox = $ws->new (VBox => |
35 | $ws->{canvas}->add (my $vbox = $ws->new (VBox => |
36 | children => $children, |
36 | children => $children, |
… | |
… | |
68 | x => "center", |
68 | x => "center", |
69 | y => "center", |
69 | y => "center", |
70 | has_close_button => 1, |
70 | has_close_button => 1, |
71 | on_delete => sub { shift->hide }, |
71 | on_delete => sub { shift->hide }, |
72 | on_visibility_change => sub { |
72 | on_visibility_change => sub { |
73 | warn "VCHANGE <@_>\n";#d# |
|
|
74 | $_[0]{visibility} = $_[1]; |
73 | $_[0]{visibility} = $_[1]; |
75 | update_worldmap $_[0]{ws} if $_[1]; |
74 | update_worldmap $_[0]{ws} if $_[1]; |
76 | }, |
75 | }, |
77 | ); |
76 | ); |
78 | |
77 | |
… | |
… | |
80 | $sw->add (my $canvas = $ws->{canvas} = $ws->new (Canvas => expand => 1)); |
79 | $sw->add (my $canvas = $ws->{canvas} = $ws->new (Canvas => expand => 1)); |
81 | |
80 | |
82 | $ws->{mapface} = $ws->new (Face => |
81 | $ws->{mapface} = $ws->new (Face => |
83 | size_w => undef, |
82 | size_w => undef, |
84 | size_h => undef, |
83 | size_h => undef, |
85 | face => $ws->{ns}->find_face ("res/worldmap.jpg"), |
84 | face => $ws->{ns}->need_face ("res/worldmap"), |
86 | ); |
85 | ); |
87 | |
86 | |
88 | $ws->{canvas}->add ($ws->{mapface}); |
87 | $ws->{canvas}->add ($ws->{mapface}); |
89 | |
88 | |
90 | $ws |
89 | $ws |
… | |
… | |
106 | cf::override 1; |
105 | cf::override 1; |
107 | }, |
106 | }, |
108 | ; |
107 | ; |
109 | |
108 | |
110 | cf::async_ext { |
109 | cf::async_ext { |
111 | my $schedule_interval = Coro::Event->timer (after => 1); |
110 | $Coro::current->{desc} = "worldmap updater"; |
112 | |
111 | |
113 | while () { |
112 | while () { |
114 | $schedule_interval->interval ($WORLDMAP_UPDATE_INTERVAL); |
113 | Coro::EV::timer_once $WORLDMAP_UPDATE_INTERVAL; |
115 | $schedule_interval->next; |
|
|
116 | |
114 | |
117 | cf::get_slot 0.01, -50, "worldmap update"; |
115 | cf::get_slot 0.01, -50, "worldmap update"; |
118 | |
116 | |
119 | ++$GENCOUNT; |
117 | ++$GENCOUNT; |
120 | |
118 | |