… | |
… | |
13 | use Crossfire; |
13 | use Crossfire; |
14 | use Crossfire::Map; |
14 | use Crossfire::Map; |
15 | use Crossfire::MapWidget; |
15 | use Crossfire::MapWidget; |
16 | |
16 | |
17 | use GCE::AttrEdit; |
17 | use GCE::AttrEdit; |
|
|
18 | use GCE::Util; |
18 | |
19 | |
19 | use Glib::Object::Subclass |
20 | use Glib::Object::Subclass |
20 | Gtk2::Window; |
21 | Gtk2::Window; |
21 | |
22 | |
22 | use strict; |
23 | use strict; |
23 | |
24 | |
|
|
25 | sub build_menu { |
|
|
26 | my ($self) = @_; |
|
|
27 | |
|
|
28 | my $menu_tree = [ |
|
|
29 | _File => { |
|
|
30 | item_type => '<Branch>', |
|
|
31 | children => [ |
|
|
32 | "_Save" => { |
|
|
33 | callback => sub { $self->save_map }, |
|
|
34 | accelerator => '<ctrl>S' |
|
|
35 | }, |
|
|
36 | "Save As" => { |
|
|
37 | callback => sub { $self->save_map_as }, |
|
|
38 | }, |
|
|
39 | "Close" => { |
|
|
40 | callback => sub { $self->delete; 1 }, |
|
|
41 | }, |
|
|
42 | ] |
|
|
43 | }, |
|
|
44 | _Edit => { |
|
|
45 | item_type => '<Branch>', |
|
|
46 | children => [ |
|
|
47 | "_Undo" => { |
|
|
48 | callback => sub { $self->undo }, |
|
|
49 | accelerator => "<ctrl>Z" |
|
|
50 | }, |
|
|
51 | "_Redo" => { |
|
|
52 | callback => sub { $self->redo }, |
|
|
53 | accelerator => "<ctrl>Y" |
|
|
54 | }, |
|
|
55 | "_Map Properties" => { |
|
|
56 | callback => sub { $self->open_map_prop }, |
|
|
57 | accelerator => "<ctrl>P" |
|
|
58 | }, |
|
|
59 | "_Map Resize" => { |
|
|
60 | callback => sub { $self->open_resize_map }, |
|
|
61 | accelerator => "<ctrl>R" |
|
|
62 | }, |
|
|
63 | ] |
|
|
64 | }, |
|
|
65 | _Go => { |
|
|
66 | item_type => '<Branch>', |
|
|
67 | children => [ |
|
|
68 | "_Up" => { |
|
|
69 | callback => sub { $self->follow ('u') }, |
|
|
70 | accelerator => "<ctrl>U" |
|
|
71 | }, |
|
|
72 | "_Down" => { |
|
|
73 | callback => sub { $self->follow ('d') }, |
|
|
74 | accelerator => "<ctrl>D" |
|
|
75 | }, |
|
|
76 | "_Right" => { |
|
|
77 | callback => sub { $self->follow ('r') }, |
|
|
78 | accelerator => "<ctrl>R" |
|
|
79 | }, |
|
|
80 | "_Left" => { |
|
|
81 | callback => sub { $self->follow ('l') }, |
|
|
82 | accelerator => "<ctrl>L" |
|
|
83 | }, |
|
|
84 | ] |
|
|
85 | }, |
|
|
86 | |
|
|
87 | ]; |
|
|
88 | |
|
|
89 | my $men = |
|
|
90 | Gtk2::SimpleMenu->new ( |
|
|
91 | menu_tree => $menu_tree, |
|
|
92 | default_callback => \&default_cb, |
|
|
93 | ); |
|
|
94 | |
|
|
95 | for ( |
|
|
96 | [i => 'pick'], |
|
|
97 | [p => 'place'], |
|
|
98 | [e => 'erase'], |
|
|
99 | [s => 'select'], |
|
|
100 | [l => 'eval'], |
|
|
101 | [x => 'connectexit'], |
|
|
102 | [f => 'followexit'] |
|
|
103 | ) |
|
|
104 | { |
|
|
105 | my $tool = $_->[1]; |
|
|
106 | $men->{accel_group}->connect ($Gtk2::Gdk::Keysyms{$_->[0]}, [], 'visible', |
|
|
107 | sub { $::MAINWIN->set_edit_tool ($tool) }); |
|
|
108 | } |
|
|
109 | |
|
|
110 | $self->add_accel_group ($men->{accel_group}); |
|
|
111 | |
|
|
112 | return $men->{widget}; |
|
|
113 | } |
|
|
114 | |
|
|
115 | sub ea { |
|
|
116 | my ($self) = @_; |
|
|
117 | $self->{ea_alt} || $::MAINWIN->{sel_editaction}; |
|
|
118 | } |
|
|
119 | |
24 | sub INIT_INSTANCE { |
120 | sub INIT_INSTANCE { |
25 | my ($self) = @_; |
121 | my ($self) = @_; |
26 | |
122 | |
27 | $self->set_title ('gce - map editor'); |
123 | $self->set_title ('gce - map editor'); |
28 | $self->add (my $vb = Gtk2::VBox->new); |
124 | $self->add (my $vb = Gtk2::VBox->new); |
|
|
125 | |
|
|
126 | $self->signal_connect (delete_event => sub { $self->delete; 1 }); |
|
|
127 | |
|
|
128 | $vb->pack_start (my $menu = $self->build_menu, 0, 1, 0); |
|
|
129 | |
29 | $vb->pack_start (my $map = $self->{map} = Crossfire::MapWidget->new, 1, 1, 0); |
130 | $vb->pack_start (my $map = $self->{map} = Crossfire::MapWidget->new, 1, 1, 0); |
|
|
131 | |
|
|
132 | $self->signal_connect (focus_in_event => sub { |
|
|
133 | my $ea = $::MAINWIN->{sel_editaction}; |
|
|
134 | if ($ea->special_arrow) { |
|
|
135 | $self->{map}->{window}->set_cursor (Gtk2::Gdk::Cursor->new ($ea->special_arrow)); |
|
|
136 | } else { |
|
|
137 | $self->{map}->{window}->set_cursor (Gtk2::Gdk::Cursor->new ('GDK_LEFT_PTR')); |
|
|
138 | } |
|
|
139 | delete $self->{ea_alt}; |
|
|
140 | }); |
|
|
141 | |
|
|
142 | $map->signal_connect (key_press_event => sub { |
|
|
143 | my ($map, $event) = @_; |
|
|
144 | |
|
|
145 | my $kv = $event->keyval; |
|
|
146 | |
|
|
147 | my ($x, $y) = $map->coord ($map->get_pointer); |
|
|
148 | for ([Control_L => sub { $self->{ea_alt} = $::MAINWIN->{edit_collection}{erase} }], |
|
|
149 | [Alt_L => sub { $self->{ea_alt} = $::MAINWIN->{edit_collection}{pick} }], |
|
|
150 | [c => sub { $::MAINWIN->{edit_collection}{select}->copy }], |
|
|
151 | [v => sub { $::MAINWIN->{edit_collection}{select}->paste ($x, $y) }], |
|
|
152 | [n => sub { $::MAINWIN->{edit_collection}{select}->invoke }], |
|
|
153 | ) |
|
|
154 | { |
|
|
155 | if ($kv == $Gtk2::Gdk::Keysyms{$_->[0]}) { |
|
|
156 | $_->[1]->(); |
|
|
157 | } |
|
|
158 | } |
|
|
159 | |
|
|
160 | if ($self->ea->special_arrow) { |
|
|
161 | $map->{window}->set_cursor (Gtk2::Gdk::Cursor->new ($self->ea->special_arrow)); |
|
|
162 | } |
|
|
163 | 1; |
|
|
164 | }); |
|
|
165 | $map->signal_connect (key_release_event => sub { |
|
|
166 | my ($map, $event) = @_; |
|
|
167 | |
|
|
168 | if ($event->keyval == $Gtk2::Gdk::Keysyms{Control_L} |
|
|
169 | or $event->keyval == $Gtk2::Gdk::Keysyms{Alt_L}) |
|
|
170 | { |
|
|
171 | delete $self->{ea_alt}; |
|
|
172 | } |
|
|
173 | |
|
|
174 | if ($self->ea->special_arrow) { |
|
|
175 | $map->{window}->set_cursor (Gtk2::Gdk::Cursor->new ($self->ea->special_arrow)); |
|
|
176 | } else { |
|
|
177 | # XXX: Get the original cursor and insert it here |
|
|
178 | $map->{window}->set_cursor (Gtk2::Gdk::Cursor->new ('GDK_LEFT_PTR')); |
|
|
179 | } |
|
|
180 | 1; |
|
|
181 | }); |
30 | $map->signal_connect (button_press_event => sub { |
182 | $map->signal_connect (button_press_event => sub { |
31 | my ($map, $event) = @_; |
183 | my ($map, $event) = @_; |
32 | |
184 | |
33 | my ($x, $y) = $map->coord ($event->x, $event->y); |
185 | my ($x, $y) = $map->coord ($event->x, $event->y); |
34 | my $as = $map->get ($x, $y); |
186 | my $as = $map->get ($x, $y); |
35 | |
187 | |
36 | my $btn = $event->button; |
188 | if ((not $self->{draw_mode}) and $event->button != 2) { |
37 | |
189 | |
38 | if ($btn != 2 and my $ea = $GCE::MainWindow::MAINWIN->{sel_editaction}) { |
190 | my $ea = $self->ea; |
39 | |
191 | |
40 | $ea->begin ($map, $x, $y, $btn); |
192 | $ea->begin ($map, $x, $y, $self) |
|
|
193 | if $x >= 0 and $y >= 0 and $x < $map->{map}{width} and $y < $map->{map}{height}; |
41 | |
194 | |
42 | $self->{draw_mode} = [$ea, $x, $y, $btn]; |
195 | $self->{draw_mode} = [$x, $y]; |
43 | |
196 | |
44 | $ea->want_cursor |
197 | $ea->want_cursor |
45 | or $map->disable_tooltip; |
198 | or $map->disable_tooltip; |
46 | |
199 | |
47 | if ($ea->special_arrow) { |
|
|
48 | |
|
|
49 | $map->{window}->set_cursor (Gtk2::Gdk::Cursor->new ($ea->special_arrow)); |
|
|
50 | #'GDK_QUESTION_ARROW')); |
|
|
51 | } |
|
|
52 | |
|
|
53 | return 1; |
200 | return 1; |
|
|
201 | } |
|
|
202 | 0 |
|
|
203 | }); |
|
|
204 | |
|
|
205 | $map->signal_connect_after (motion_notify_event => sub { |
|
|
206 | my ($map, $event) = @_; |
|
|
207 | |
|
|
208 | $self->{draw_mode} |
|
|
209 | or return; |
|
|
210 | |
|
|
211 | my $ea = $self->ea; |
|
|
212 | |
|
|
213 | my ($X, $Y) = @{$self->{draw_mode}}[0,1]; |
|
|
214 | my ($x, $y) = $map->coord ($map->get_pointer); |
|
|
215 | |
|
|
216 | while ($x != $X || $y != $Y) { |
|
|
217 | |
|
|
218 | $X++ if $X < $x; |
|
|
219 | $X-- if $X > $x; |
|
|
220 | $Y++ if $Y < $y; |
|
|
221 | $Y-- if $Y > $y; |
|
|
222 | |
|
|
223 | $ea->edit ($map, $X, $Y, $self) |
|
|
224 | if $X >= 0 and $Y >= 0 and $X < $map->{map}{width} and $Y < $map->{map}{height}; |
|
|
225 | } |
|
|
226 | |
|
|
227 | @{$self->{draw_mode}}[0,1] = ($X, $Y); |
|
|
228 | |
|
|
229 | 1 |
|
|
230 | }); |
|
|
231 | |
|
|
232 | $map->signal_connect (button_release_event => sub { |
|
|
233 | my ($map, $event) = @_; |
|
|
234 | |
|
|
235 | if ($self->{draw_mode}) { |
|
|
236 | my ($x, $y) = $map->coord ($map->get_pointer); |
|
|
237 | |
|
|
238 | my $ea = $self->ea; |
|
|
239 | $ea->end ($map, $x, $y, $self); |
|
|
240 | |
|
|
241 | delete $self->{draw_mode}; |
|
|
242 | |
|
|
243 | $ea->want_cursor |
|
|
244 | or $map->enable_tooltip; |
|
|
245 | |
|
|
246 | return 1; |
|
|
247 | } |
|
|
248 | |
|
|
249 | 0 |
|
|
250 | }); |
|
|
251 | } |
|
|
252 | |
|
|
253 | # FIXME: Fix the automatic update of the attribute editor! and also the stack view! |
|
|
254 | sub undo { |
|
|
255 | my ($self) = @_; |
|
|
256 | |
|
|
257 | my $map = $self->{map}; # the Crossfire::MapWidget |
|
|
258 | |
|
|
259 | $map->{undo_stack_pos} |
|
|
260 | or return; |
|
|
261 | |
|
|
262 | $map->change_swap ($map->{undo_stack}[--$map->{undo_stack_pos}]); |
|
|
263 | } |
|
|
264 | |
|
|
265 | sub redo { |
|
|
266 | my ($self) = @_; |
|
|
267 | |
|
|
268 | my $map = $self->{map}; # the Crossfire::MapWidget |
|
|
269 | |
|
|
270 | $map->{undo_stack} |
|
|
271 | and $map->{undo_stack_pos} < @{$map->{undo_stack}} |
|
|
272 | or return; |
|
|
273 | |
|
|
274 | $map->change_swap ($map->{undo_stack}[$map->{undo_stack_pos}++]); |
|
|
275 | } |
|
|
276 | |
|
|
277 | sub delete { |
|
|
278 | my ($self) = @_; |
|
|
279 | |
|
|
280 | # check and modla dialog if "dirty" |
|
|
281 | |
|
|
282 | if ($self->{mapkey}) { |
|
|
283 | # XXX: This should be in a delete event handler in the MainWindow.pm... but it doesnt work |
|
|
284 | delete $::MAINWIN->{loaded_maps}->{$self->{mapkey}}; |
|
|
285 | } |
|
|
286 | |
|
|
287 | $self->destroy; |
|
|
288 | } |
|
|
289 | |
|
|
290 | sub open_map { |
|
|
291 | my ($self, $path, $key) = @_; |
|
|
292 | |
|
|
293 | $self->{mapkey} = $key; |
|
|
294 | |
|
|
295 | if (ref $path) { |
|
|
296 | $self->{map}->set_map ($path); |
|
|
297 | |
|
|
298 | } else { |
|
|
299 | $self->{path} = $path; |
|
|
300 | # print "OPENMAP $path\n"; |
|
|
301 | $self->{map}->set_map (my $m = new_from_file Crossfire::Map $path); |
|
|
302 | require Data::Dumper; |
|
|
303 | # print "FOO:" .Data::Dumper::Dumper ($m) . "\n"; |
|
|
304 | } |
|
|
305 | } |
|
|
306 | |
|
|
307 | sub save_map { |
|
|
308 | my ($self) = @_; |
|
|
309 | |
|
|
310 | if ($self->{path}) { |
|
|
311 | $self->{map}{map}->write_file ($self->{path}); |
|
|
312 | quick_msg ($self, "saved to $self->{path}"); |
|
|
313 | } else { |
|
|
314 | $self->save_map_as; |
|
|
315 | } |
|
|
316 | } |
|
|
317 | |
|
|
318 | sub save_map_as { |
|
|
319 | my ($self) = @_; |
|
|
320 | |
|
|
321 | my $fc = $::MAINWIN->new_filechooser ('gce - save map', 1, $self->{path}); |
|
|
322 | |
|
|
323 | if ('ok' eq $fc->run) { |
|
|
324 | |
|
|
325 | $::MAINWIN->{fc_last_folder} = $fc->get_current_folder; |
|
|
326 | $::MAINWIN->{fc_last_folders}->{$self->{fc_last_folder}}++; |
|
|
327 | |
|
|
328 | $self->{map}{map}->write_file ($self->{path} = $fc->get_filename); |
|
|
329 | quick_msg ($self, "saved to $self->{path}"); |
|
|
330 | } |
|
|
331 | |
|
|
332 | $fc->destroy; |
|
|
333 | } |
|
|
334 | |
|
|
335 | sub _add_prop_entry { |
|
|
336 | my ($self, $table, $idx, $key, $desc, $type, $changecb) = @_; |
|
|
337 | |
|
|
338 | my $edwid; |
|
|
339 | |
|
|
340 | if ($type eq 'string') { |
|
|
341 | $table->attach_defaults (my $lbl = Gtk2::Label->new ($desc), 0, 1, $idx, $idx + 1); |
|
|
342 | $edwid = Gtk2::Entry->new; |
|
|
343 | $edwid->set_text ($self->{map}{map}{info}{$key}); |
|
|
344 | $edwid->signal_connect (changed => sub { |
|
|
345 | $self->{map}{map}{info}{$key} = $_[0]->get_text; |
|
|
346 | if ($changecb) { |
|
|
347 | $changecb->($_[0]->get_text); |
54 | } |
348 | } |
55 | |
|
|
56 | 0 |
|
|
57 | }); |
349 | }); |
|
|
350 | $table->attach_defaults ($edwid, 1, 2, $idx, $idx + 1); |
58 | |
351 | |
59 | $map->signal_connect_after (motion_notify_event => sub { |
352 | } elsif ($type eq 'button') { |
60 | my ($map, $event) = @_; |
353 | $table->attach_defaults (my $b = Gtk2::Button->new_with_label ($desc), 0, 2, $idx, $idx + 1); |
|
|
354 | $b->signal_connect (clicked => ($changecb || sub {})); |
61 | |
355 | |
62 | $self->{draw_mode} |
356 | } elsif ($type eq 'label') { |
63 | or return; |
357 | $table->attach_defaults (my $lbl = Gtk2::Label->new ($desc), 0, 1, $idx, $idx + 1); |
|
|
358 | $edwid = Gtk2::Label->new ($self->{map}{map}{info}{$key}); |
|
|
359 | $table->attach_defaults ($edwid, 1, 2, $idx, $idx + 1); |
64 | |
360 | |
65 | my ($X, $Y) = @{$self->{draw_mode}}[1,2]; |
361 | } elsif ($type eq 'check') { |
66 | my ($x, $y) = $map->coord ($map->get_pointer); |
362 | $table->attach_defaults (my $lbl1 = Gtk2::Label->new ($desc), 0, 1, $idx, $idx + 1); |
|
|
363 | $table->attach_defaults (my $lbl = Gtk2::CheckButton->new, 1, 2, $idx, $idx + 1); |
|
|
364 | $lbl->set_active ($self->{map}{map}{info}{$key}); |
|
|
365 | $lbl->signal_connect (toggled => sub { |
|
|
366 | my ($lbl) = @_; |
|
|
367 | $self->{map}{map}{info}{$key} = $lbl->get_active * 1; |
|
|
368 | ($changecb || sub {})->($lbl->get_active); |
|
|
369 | }); |
67 | |
370 | |
68 | while ($x != $X || $y != $Y) { |
371 | } elsif ($type eq 'sep') { |
|
|
372 | $table->attach_defaults (my $lbl1 = Gtk2::HSeparator->new, 0, 2, $idx, $idx + 1); |
|
|
373 | } else { |
|
|
374 | $edwid = Gtk2::Label->new ("FOO"); |
|
|
375 | } |
|
|
376 | } |
69 | |
377 | |
70 | $X++ if $X < $x; |
378 | sub open_resize_map { |
71 | $X-- if $X > $x; |
379 | my ($self) = @_; |
72 | $Y++ if $Y < $y; |
|
|
73 | $Y-- if $Y > $y; |
|
|
74 | |
380 | |
75 | $self->{draw_mode}[0]->edit ($map, $X, $Y, $self->{draw_mode}[3]); |
381 | my $w = Gtk2::Window->new ('toplevel'); |
|
|
382 | $w->set_default_size (250, 150); |
|
|
383 | $w->add (my $sw = Gtk2::ScrolledWindow->new); |
|
|
384 | $sw->add_with_viewport (my $v = Gtk2::VBox->new); |
|
|
385 | $sw->set_policy ('automatic', 'automatic'); |
|
|
386 | $v->pack_start (my $t = Gtk2::Table->new (2, 10), 0, 0, 0); |
|
|
387 | |
|
|
388 | my $i = 0; |
|
|
389 | for ( |
|
|
390 | [qw/width Width string/], |
|
|
391 | [qw/height Height string/], |
|
|
392 | [qw/save Save button/, |
|
|
393 | sub { |
|
|
394 | $self->{map}{map}->resize ($self->{map}{map}{info}{width}, $self->{map}{map}{info}{height}); |
|
|
395 | $self->{map}->invalidate_all; |
|
|
396 | $w->destroy; |
76 | } |
397 | } |
77 | |
|
|
78 | @{$self->{draw_mode}}[1,2] = ($X, $Y); |
|
|
79 | |
|
|
80 | 1 |
398 | ], |
81 | }); |
399 | ) |
|
|
400 | { |
|
|
401 | $self->_add_prop_entry ($t, $i++, @$_); |
|
|
402 | } |
82 | |
403 | |
83 | $map->signal_connect (button_release_event => sub { |
404 | $w->show_all; |
84 | my ($map, $event) = @_; |
|
|
85 | |
|
|
86 | if ($self->{draw_mode} and my $ea = $self->{draw_mode}[0]) { |
|
|
87 | $ea->end; |
|
|
88 | |
|
|
89 | $ea->want_cursor |
|
|
90 | or $map->enable_tooltip; |
|
|
91 | |
|
|
92 | |
|
|
93 | if ($ea->special_arrow) { |
|
|
94 | |
|
|
95 | # XXX: Get the original cursor and insert it here |
|
|
96 | $map->{window}->set_cursor (Gtk2::Gdk::Cursor->new ('GDK_LEFT_PTR')); |
|
|
97 | } |
|
|
98 | |
|
|
99 | delete $self->{draw_mode}; |
|
|
100 | } |
|
|
101 | |
|
|
102 | 0 |
|
|
103 | }); |
|
|
104 | } |
405 | } |
105 | |
406 | |
106 | sub delete_arch { |
407 | sub follow { |
107 | my ($self, $x, $y) = @_; |
408 | my ($self, $dir) = @_; |
108 | |
409 | |
109 | defined $self->{map} |
410 | my %dir_to_path = ( |
|
|
411 | u => 'tile_path_1', |
|
|
412 | d => 'tile_path_3', |
|
|
413 | r => 'tile_path_2', |
|
|
414 | l => 'tile_path_4', |
|
|
415 | ); |
|
|
416 | |
|
|
417 | defined $dir_to_path{$dir} |
110 | or return 0; |
418 | or return; |
|
|
419 | my $map = $self->{map}{map}{info}{$dir_to_path{$dir}} |
|
|
420 | or return; |
111 | |
421 | |
112 | my $as = $self->{map}->get ($x, $y); |
422 | $map = map2abs ($map, $self); |
113 | pop @$as; |
423 | $::MAINWIN->open_map_editor ($map); |
114 | $self->{map}->set ($x, $y, $as); |
|
|
115 | } |
424 | } |
116 | |
425 | |
117 | sub place_pick { |
|
|
118 | my ($self, $x, $y) = @_; |
|
|
119 | |
|
|
120 | my $pick = $GCE::MainWindow::MAINWIN->get_pick; |
|
|
121 | my $as = $self->{map}->get ($x, $y); |
|
|
122 | |
|
|
123 | my $arch = { _name => $pick->{_name} }; |
|
|
124 | |
|
|
125 | push @$as, $arch |
|
|
126 | unless @$as && $as->[-1]->{_name} eq $arch->{_name}; |
|
|
127 | |
|
|
128 | $self->{map}->set ($x, $y, $as); |
|
|
129 | } |
|
|
130 | |
|
|
131 | sub open_map { |
426 | sub open_map_prop { |
132 | my ($self, $path) = @_; |
427 | my ($self) = @_; |
133 | |
428 | |
134 | $self->{map}->set_map (new_from_file Crossfire::Map $path); |
429 | |
|
|
430 | my $w = Gtk2::Window->new ('toplevel'); |
|
|
431 | $w->set_default_size (500, 500); |
|
|
432 | $w->add (my $sw = Gtk2::ScrolledWindow->new); |
|
|
433 | $sw->add_with_viewport (my $v = Gtk2::VBox->new); |
|
|
434 | $sw->set_policy ('automatic', 'automatic'); |
|
|
435 | $v->pack_start (my $t = Gtk2::Table->new (2, 10), 0, 0, 0); |
|
|
436 | |
|
|
437 | my $i = 0; |
|
|
438 | for ( |
|
|
439 | [qw/name Name string/], |
|
|
440 | [qw/region Region string/], |
|
|
441 | [qw/enter_x Enter-x string/], |
|
|
442 | [qw/enter_y Enter-y string/], |
|
|
443 | [qw/reset_timeout Reset-timeout string/], |
|
|
444 | [qw/swap_time Swap-timeout string/], |
|
|
445 | [qw/x x sep/], |
|
|
446 | [qw/difficulty Difficulty string/], |
|
|
447 | [qw/windspeed Windspeed string/], |
|
|
448 | [qw/pressure Pressure string/], |
|
|
449 | [qw/humid Humid string/], |
|
|
450 | [qw/temp Temp string/], |
|
|
451 | [qw/darkness Darkness string/], |
|
|
452 | [qw/sky Sky string/], |
|
|
453 | [qw/winddir Winddir string/], |
|
|
454 | [qw/x x sep/], |
|
|
455 | [qw/width Width label/], # sub { $self->{map}{map}->resize ($_[0], $self->{map}{map}{height}) }], |
|
|
456 | [qw/height Height label/], # sub { $self->{map}{map}->resize ($self->{map}{map}{width}, $_[0]) }], |
|
|
457 | [qw/x x sep/], |
|
|
458 | [qw/msg Text text/], |
|
|
459 | [qw/maplore Maplore text/], |
|
|
460 | [qw/outdoor Outdoor check/], |
|
|
461 | [qw/unique Unique check/], |
|
|
462 | [qw/fixed_resettime Fixed-resettime check/], |
|
|
463 | [qw/x x sep/], |
|
|
464 | [qw/tile_path_1 Northpath string/], |
|
|
465 | [qw/tile_path_2 Eastpath string/], |
|
|
466 | [qw/tile_path_3 Southpath string/], |
|
|
467 | [qw/tile_path_4 Westpath string/], |
|
|
468 | [qw/tile_path_5 Toppath string/], |
|
|
469 | [qw/tile_path_6 Bottompath string/], |
|
|
470 | ) |
|
|
471 | { |
|
|
472 | $self->_add_prop_entry ($t, $i++, @$_); |
|
|
473 | } |
|
|
474 | |
|
|
475 | $w->show_all; |
135 | } |
476 | } |
136 | |
477 | |
137 | =head1 AUTHOR |
478 | =head1 AUTHOR |
138 | |
479 | |
139 | Marc Lehmann <schmorp@schmorp.de> |
480 | Marc Lehmann <schmorp@schmorp.de> |