… | |
… | |
227 | |
227 | |
228 | $w->show_all; |
228 | $w->show_all; |
229 | } |
229 | } |
230 | |
230 | |
231 | sub update_attr_editor { |
231 | sub update_attr_editor { |
232 | my ($self, $ar, $map, $x, $y) = @_; |
232 | my ($self, $map, $x, $y, $z) = @_; |
233 | |
233 | |
234 | if (ref ($ar) ne 'GCE::ArchRef') { require Carp; Carp::confess ("$ar no ARCHREF!") } |
234 | # if (ref ($ar) ne 'GCE::ArchRef') { require Carp; Carp::confess ("$ar no ARCHREF!") } |
235 | |
235 | |
236 | $self->{attr_edit} |
236 | $self->{attr_edit} |
237 | or return; |
237 | or return; |
238 | |
238 | |
239 | $self->{attr_edit}->set_arch ($ar, 1); |
239 | my $ar = $self->{attr_edit}->set_from_map ($map, $x, $y, $z); |
240 | $self->{attr_edit_win}->set_title ("deliantra editor - edit " . $ar->longname); |
240 | $self->{attr_edit_win}->set_title ("deliantra editor - edit " . $ar->longname); |
241 | } |
241 | } |
242 | |
242 | |
243 | sub update_map_pos { |
243 | #sub update_map_pos { |
244 | my ($self, $mapedit, $x, $y) = @_; |
244 | # my ($self, $mapedit, $x, $y) = @_; |
245 | $self->{sv}->maybe_update_stack_for ($mapedit, $x, $y) |
245 | # $self->{sv}->maybe_update_stack_for ($mapedit, $x, $y) |
246 | if $self->{sv}; |
246 | # if $self->{sv}; |
247 | } |
247 | #} |
248 | |
248 | |
249 | sub update_stack_view { |
249 | sub update_stack_view { |
250 | my ($self, $mapedit, $x, $y) = @_; |
250 | my ($self, $mapedit, $x, $y) = @_; |
251 | |
251 | |
252 | return unless $self->{sv}; |
252 | return unless $self->{sv}; |
… | |
… | |
535 | close $fh; |
535 | close $fh; |
536 | } |
536 | } |
537 | |
537 | |
538 | $::MAINWIN = $self; |
538 | $::MAINWIN = $self; |
539 | |
539 | |
540 | $self->Object::Event::init; |
540 | $self->Object::Event::init_object_events; |
541 | |
541 | |
542 | $self->set_title ("deliantra editor - toolbox"); |
542 | $self->set_title ("deliantra editor - toolbox"); |
543 | |
543 | |
544 | $self->{edit_tool} = Gtk2::Label->new; |
544 | $self->{edit_tool} = Gtk2::Label->new; |
545 | $self->{edit_tool_cont} = Gtk2::VBox->new; |
545 | $self->{edit_tool_cont} = Gtk2::VBox->new; |
… | |
… | |
698 | sub cursor { |
698 | sub cursor { |
699 | my ($self, $map, @a) = @_; |
699 | my ($self, $map, @a) = @_; |
700 | $map->cursor (@a) |
700 | $map->cursor (@a) |
701 | } |
701 | } |
702 | |
702 | |
703 | |
703 | sub broadcast_cursor_changes { |
|
|
704 | my ($self, $map, $x, $y) = @_; |
|
|
705 | my $cursors = $map->cursors_at ($x, $y); |
|
|
706 | warn "CURSOR UPDTEAD! " |
|
|
707 | . join (',', map { "$_: $_->{owner}" } @$cursors) |
|
|
708 | . "\n"; |
|
|
709 | $self->Object::Event::event (cursor_updates => $cursors); |
|
|
710 | } |
704 | |
711 | |
705 | =head1 AUTHOR |
712 | =head1 AUTHOR |
706 | |
713 | |
707 | Marc Lehmann <schmorp@schmorp.de> |
714 | Marc Lehmann <schmorp@schmorp.de> |
708 | http://home.schmorp.de/ |
715 | http://home.schmorp.de/ |