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

Comparing deliantra/gde/GCE/MainWindow.pm (file contents):
Revision 1.19 by elmex, Mon Feb 20 23:43:55 2006 UTC vs.
Revision 1.20 by root, Mon Feb 20 23:48:15 2006 UTC

164 164
165sub undo { 165sub undo {
166 my ($self) = @_; 166 my ($self) = @_;
167 167
168 # XXX: Move to GCE::MapEdior in a popup-menu or real menu 168 # XXX: Move to GCE::MapEdior in a popup-menu or real menu
169 my $map = $self->{last_map_window}->{mapedit}; # the Crossfire::MapWidget 169 my $map = $self->{last_map_window}{mapedit}; # the Crossfire::MapWidget
170 170
171 # revert map to last state 171 warn $map;
172 warn "USI: $map->{undo_stack_pos} @{$map->{undo_stack} || []}\n";#d#
173 $map->{undo_stack_pos}
174 or return;
175
176 $map->change_swap ($map->{undo_stack}[--$map->{undo_stack_pos}]);
172} 177}
173 178
174sub redo { 179sub redo {
175 my ($self) = @_; 180 my ($self) = @_;
176 181
177 # XXX: Move to GCE::MapEdior in a popup-menu or real menu 182 # XXX: Move to GCE::MapEdior in a popup-menu or real menu
178 my $map = $self->{last_map_window}->{mapedit}; # the Crossfire::MapWidget 183 my $map = $self->{last_map_window}{mapedit}; # the Crossfire::MapWidget
179 184
180 # re-revert map to state after last state? :-) 185 warn "RSI: $map->{undo_stack_pos} @{$map->{undo_stack}}\n";#d#
186
187 $map->{undo_stack_pos} < @{$map->{undo_stack}}
188 or return;
189
190 $map->change_swap ($map->{undo_stack}[$map->{undo_stack_pos}++]);
181} 191}
182 192
183sub build_menu { 193sub build_menu {
184 my ($self) = @_; 194 my ($self) = @_;
185 195

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines