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.82 by elmex, Mon Oct 15 13:20:26 2007 UTC vs.
Revision 1.83 by root, Thu Dec 27 22:28:01 2007 UTC

9use Cwd qw/abs_path getcwd/; 9use Cwd qw/abs_path getcwd/;
10use Gtk2; 10use Gtk2;
11use Gtk2::Gdk::Keysyms; 11use Gtk2::Gdk::Keysyms;
12use Gtk2::SimpleMenu; 12use Gtk2::SimpleMenu;
13 13
14use Crossfire; 14use Deliantra;
15use Crossfire::Map; 15use Deliantra::Map;
16use Crossfire::MapWidget; 16use Deliantra::MapWidget;
17 17
18use GCE::AttrEdit; 18use GCE::AttrEdit;
19use GCE::MapEditor; 19use GCE::MapEditor;
20use GCE::StackView; 20use GCE::StackView;
21use GCE::EditAction; 21use GCE::EditAction;
27use GCE::Util; 27use GCE::Util;
28use GCE::DragHelper; 28use GCE::DragHelper;
29 29
30use strict; 30use strict;
31 31
32my $recentfile = "$Crossfire::VARDIR/gcerecent"; 32my $recentfile = "$Deliantra::VARDIR/gcerecent";
33 33
34# XXX: make a recursive call from save_layout to all (interesting) sub-widgets 34# XXX: make a recursive call from save_layout to all (interesting) sub-widgets
35sub save_layout { 35sub save_layout {
36 my ($self) = @_; 36 my ($self) = @_;
37 37
64 }; 64 };
65 } 65 }
66 66
67 $self->{attr_edit}->save_layout; 67 $self->{attr_edit}->save_layout;
68 68
69 main::write_cfg ("$Crossfire::VARDIR/gdeconfig"); 69 main::write_cfg ("$Deliantra::VARDIR/gdeconfig");
70} 70}
71 71
72sub load_layout { 72sub load_layout {
73 my ($self) = @_; 73 my ($self) = @_;
74 74
193 $::CFG->{LIBDIR} = $lib->get_text; 193 $::CFG->{LIBDIR} = $lib->get_text;
194 $::CFG->{MAPDIR} = $map->get_text; 194 $::CFG->{MAPDIR} = $map->get_text;
195 $::LIBDIR = $::CFG->{LIBDIR} if $::CFG->{LIBDIR}; 195 $::LIBDIR = $::CFG->{LIBDIR} if $::CFG->{LIBDIR};
196 $::MAPDIR = $::CFG->{MAPDIR} if $::CFG->{MAPDIR}; 196 $::MAPDIR = $::CFG->{MAPDIR} if $::CFG->{MAPDIR};
197 $::CFG->{username} = $usern->get_text; 197 $::CFG->{username} = $usern->get_text;
198 Crossfire::set_libdir ($::LIBDIR); 198 Deliantra::set_libdir ($::LIBDIR);
199 Crossfire::load_archetypes; 199 Deliantra::load_archetypes;
200 Crossfire::load_tilecache; 200 Deliantra::load_tilecache;
201 main::write_cfg ("$Crossfire::VARDIR/gdeconfig"); 201 main::write_cfg ("$Deliantra::VARDIR/gdeconfig");
202 $w->destroy; 202 $w->destroy;
203 }); 203 });
204 $t->attach_defaults (my $close = Gtk2::Button->new ('close'), 0, 2, 4, 5); 204 $t->attach_defaults (my $close = Gtk2::Button->new ('close'), 0, 2, 4, 5);
205 $close->signal_connect (clicked => sub { $w->destroy }); 205 $close->signal_connect (clicked => sub { $w->destroy });
206 206
510 510
511sub update_pick_view { 511sub update_pick_view {
512 my ($self, $arch) = @_; 512 my ($self, $arch) = @_;
513 513
514 defined $arch->{_face} 514 defined $arch->{_face}
515 or $arch = $Crossfire::ARCH{$arch->{_name}}; 515 or $arch = $Deliantra::ARCH{$arch->{_name}};
516 516
517 fill_pb_from_arch ($self->{pick_view_pb}, $arch); 517 fill_pb_from_arch ($self->{pick_view_pb}, $arch);
518 $self->{pick_view_img}->set_from_pixbuf ($self->{pick_view_pb}); 518 $self->{pick_view_img}->set_from_pixbuf ($self->{pick_view_pb});
519 519
520 $self->{pick_view_btn}->set_label ($arch->{_name}); 520 $self->{pick_view_btn}->set_label ($arch->{_name});
571 $w->add (my $tbl = Gtk2::Table->new (2, 3)); 571 $w->add (my $tbl = Gtk2::Table->new (2, 3));
572 add_table_widget ($tbl, 0, $width, 'string'); 572 add_table_widget ($tbl, 0, $width, 'string');
573 add_table_widget ($tbl, 1, $height, 'string'); 573 add_table_widget ($tbl, 1, $height, 'string');
574 add_table_widget ($tbl, 2, 'new', 'button', sub { 574 add_table_widget ($tbl, 2, 'new', 'button', sub {
575 if ($width->[1] > 0 and $height->[1] > 0) { 575 if ($width->[1] > 0 and $height->[1] > 0) {
576 my $map = Crossfire::Map->new ($width->[1], $height->[1]); 576 my $map = Deliantra::Map->new ($width->[1], $height->[1]);
577 $map->{info}->{width} = $width->[1]; 577 $map->{info}->{width} = $width->[1];
578 $map->{info}->{height} = $height->[1]; 578 $map->{info}->{height} = $height->[1];
579 $map->resize ($width->[1], $height->[1]); 579 $map->resize ($width->[1], $height->[1]);
580 $self->open_map_editor ($map); 580 $self->open_map_editor ($map);
581 } 581 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines