ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/gde/GCE/EditAction.pm
(Generate patch)

Comparing deliantra/gde/GCE/EditAction.pm (file contents):
Revision 1.51.2.1 by elmex, Tue Jul 7 15:42:18 2009 UTC vs.
Revision 1.51.2.2 by elmex, Mon Dec 21 15:51:30 2009 UTC

118# 118#
119# $self->{widget} = $vb; 119# $self->{widget} = $vb;
120} 120}
121 121
122package GCE::EditAction::Pick; 122package GCE::EditAction::Pick;
123use GCE::ArchRef;
124use GCE::Util; 123use GCE::Util;
125use strict; 124use strict;
126 125
127our @ISA = qw/GCE::EditAction::RadioModed/; 126our @ISA = qw/GCE::EditAction::RadioModed/;
128 127
155 154
156 my $arch = $cstack->[-1]; 155 my $arch = $cstack->[-1];
157 my $z; 156 my $z;
158 ($x, $y, $arch, $cstack, $z) = devirtualize ($map, $x, $y, $arch, $cstack); 157 ($x, $y, $arch, $cstack, $z) = devirtualize ($map, $x, $y, $arch, $cstack);
159 158
160 $::MAINWIN->update_attr_editor ($map->{editor}, $x, $y, $z); 159 my $sr = $::MAINWIN->cursor ($map->{editor}, $x, $y);
161 $::MAINWIN->update_stack_view ($map->{editor}, $x, $y, $z);
162
163 #my $aref = 160 my $ar;
164 # GCE::ArchRef->new ( 161 $ar = $sr->cursor ($z) if $sr;
165 # arch => $arch, 162 $::MAINWIN->update_attr_editor ($ar) if $ar;
166 # source => 'map', 163 $::MAINWIN->update_stack_view ($sr) if $sr;
167 # cb => sub {
168 # $map->change_begin ('attredit');
169 # $map->change_stack ($x, $y, $cstack);
170
171 # if (my $changeset = $map->change_end) {
172 # splice @{ $map->{undo_stack} ||= [] },
173 # $map->{undo_stack_pos}++, 1e6,
174 # $changeset;
175 # }
176 # }
177 # );
178
179} 164}
180 165
181package GCE::EditAction::Perl; 166package GCE::EditAction::Perl;
182 167
183use GCE::Util; 168use GCE::Util;
391 $map->change_stack ($x, $y, $as); 376 $map->change_stack ($x, $y, $as);
392 autojoin $map, $pick, $x, $y, @{$self->{last_pos}} 377 autojoin $map, $pick, $x, $y, @{$self->{last_pos}}
393 if $autojoin && $self->{last_pos}; 378 if $autojoin && $self->{last_pos};
394 } 379 }
395 380
381 $::MAINWIN->broadcast_cursor_changes ($map->{editor}, $x, $y, 'placed_arch', 1);
382
396 $self->{last_pos} = [$x, $y]; 383 $self->{last_pos} = [$x, $y];
397} 384}
398 385
399sub end { 386sub end {
400 my ($self, $map, $x, $y, $mape) = @_; 387 my ($self, $map, $x, $y, $mape) = @_;
401
402 # now actualize stack and attr editor
403 $::MAINWIN->update_stack_view ($map, $x, $y);
404 388
405 my $cstack = $map->get ($x, $y); 389 my $cstack = $map->get ($x, $y);
406 390
407 my $arch = $cstack->[-1]; 391 my $arch = $cstack->[-1];
408 392
416 $arch = $arch->{_virtual}; 400 $arch = $arch->{_virtual};
417 $cstack = $map->get ($x, $y); 401 $cstack = $map->get ($x, $y);
418 } 402 }
419 403
420 $self->SUPER::end ($map, $x, $y, $mape); 404 $self->SUPER::end ($map, $x, $y, $mape);
405
406 # now actualize stack and attr editor
407 my $sr = $::MAINWIN->cursor ($map->{editor}, $x, $y);
408 $::MAINWIN->update_stack_view ($sr);
421} 409}
422 410
423sub stack_action { 411sub stack_action {
424 my ($self, $stack, $arch) = @_; 412 my ($self, $stack, $arch) = @_;
425 413

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines