ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/bin/cfplus
(Generate patch)

Comparing deliantra/Deliantra-Client/bin/cfplus (file contents):
Revision 1.12 by root, Fri May 26 19:14:33 2006 UTC vs.
Revision 1.16 by elmex, Sat May 27 20:00:40 2006 UTC

97 97
98our $ALT_ENTER_MESSAGE; 98our $ALT_ENTER_MESSAGE;
99our $STATUSBOX; 99our $STATUSBOX;
100our $DEBUG_STATUS; 100our $DEBUG_STATUS;
101 101
102our $INVWIN;
103our $INV; 102our $INV;
104our $INVR; 103our $INVR;
105our $INVR_LBL; 104our $INVR_LBL;
106 105
107sub status { 106sub status {
178 unless $BUTTONBAR->{children}[1]->{state}; 177 unless $BUTTONBAR->{children}[1]->{state};
179} 178}
180 179
181sub client_setup { 180sub client_setup {
182 my $dialog = new CFClient::UI::FancyFrame 181 my $dialog = new CFClient::UI::FancyFrame
182 name => "client_setup",
183 title => "Client Setup", 183 title => "Client Setup",
184 child => (my $vbox = new CFClient::UI::VBox); 184 child => (my $vbox = new CFClient::UI::VBox);
185 $vbox->add (my $table = new CFClient::UI::Table expand => 1, col_expand => [0, 1]); 185 $vbox->add (my $table = new CFClient::UI::Table expand => 1, col_expand => [0, 1]);
186 186
187 $table->add (0, 0, new CFClient::UI::Label valign => 0, align => 1, text => "Video Mode"); 187 $table->add (0, 0, new CFClient::UI::Label valign => 0, align => 1, text => "Video Mode");
255 state => $CFG->{fow_smooth}, 255 state => $CFG->{fow_smooth},
256 tooltip => "Smooth the Fog-of-War a bit to make it more realistic. Changes are instant.", 256 tooltip => "Smooth the Fog-of-War a bit to make it more realistic. Changes are instant.",
257 connect_changed => sub { 257 connect_changed => sub {
258 my ($self, $value) = @_; 258 my ($self, $value) = @_;
259 $CFG->{fow_smooth} = $value; 259 $CFG->{fow_smooth} = $value;
260 status "Fog of War smoothing requires OpenGL 1.2 or higher" if $CFClient::GL_VERSION < 1.2; 260 status "Fog of War smoothing requires OpenGL 1.2 or higher" if $CFClient::OpenGL::GL_VERSION < 1.2;
261 } 261 }
262 ); 262 );
263 263
264 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "GUI Fontsize"); 264 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "GUI Fontsize");
265 $table->add (1, $row++, new CFClient::UI::Slider 265 $table->add (1, $row++, new CFClient::UI::Slider
432 432
433 $win 433 $win
434} 434}
435 435
436sub make_stats_window { 436sub make_stats_window {
437 my $tgw = new CFClient::UI::FancyFrame title => "Stats"; 437 my $tgw = new CFClient::UI::FancyFrame title => "Stats", name => "stats_window";
438 438
439 $tgw->add (new CFClient::UI::Window child => my $vb = new CFClient::UI::VBox); 439 $tgw->add (new CFClient::UI::Window child => my $vb = new CFClient::UI::VBox);
440 $vb->add ($STATWIDS->{title} = new CFClient::UI::Label valign => 0, align => -1, text => "Title:", expand => 1, 440 $vb->add ($STATWIDS->{title} = new CFClient::UI::Label valign => 0, align => -1, text => "Title:", expand => 1,
441 can_hover => 1, can_events => 1, 441 can_hover => 1, can_events => 1,
442 tooltip => "Your name and title. You can change your title by using the <b>title</b> command, if supported by the server."); 442 tooltip => "Your name and title. You can change your title by using the <b>title</b> command, if supported by the server.");
445 tooltip => "The map you are currently on (if supported by the server)."); 445 tooltip => "The map you are currently on (if supported by the server).");
446 446
447 $vb->add (my $hb0 = new CFClient::UI::HBox); 447 $vb->add (my $hb0 = new CFClient::UI::HBox);
448 $hb0->add ($STATWIDS->{weight} = new CFClient::UI::Label valign => 0, align => -1, text => "Weight:", expand => 1, 448 $hb0->add ($STATWIDS->{weight} = new CFClient::UI::Label valign => 0, align => -1, text => "Weight:", expand => 1,
449 can_hover => 1, can_events => 1, 449 can_hover => 1, can_events => 1,
450 tooltip => "This is the amount the Player weights."); 450 tooltip => "The weight of the player including all inventory items.");
451 $hb0->add ($STATWIDS->{m_weight} = new CFClient::UI::Label valign => 0, align => -1, text => "Max weight:", expand => 1, 451 $hb0->add ($STATWIDS->{m_weight} = new CFClient::UI::Label valign => 0, align => -1, text => "Max weight:", expand => 1,
452 can_hover => 1, can_events => 1, 452 can_hover => 1, can_events => 1,
453 tooltip => "The weight limit, you can't carry more than this."); 453 tooltip => "The weight limit: you cannot carry more than this.");
454 454
455 455
456 $vb->add (my $hb = new CFClient::UI::HBox expand => 1); 456 $vb->add (my $hb = new CFClient::UI::HBox expand => 1);
457 $hb->add (my $tbl = new CFClient::UI::Table expand => 1); 457 $hb->add (my $tbl = new CFClient::UI::Table expand => 1);
458 458
705 }); 705 });
706} 706}
707 707
708sub server_setup { 708sub server_setup {
709 my $dialog = new CFClient::UI::FancyFrame 709 my $dialog = new CFClient::UI::FancyFrame
710 name => "server_setup",
710 title => "Server Setup", 711 title => "Server Setup",
711 child => (my $vbox = new CFClient::UI::VBox); 712 child => (my $vbox = new CFClient::UI::VBox);
712 713
713 $vbox->add (my $table = new CFClient::UI::Table expand => 1, col_expand => [0, 1]); 714 $vbox->add (my $table = new CFClient::UI::Table expand => 1, col_expand => [0, 1]);
714 $table->add (0, 2, new CFClient::UI::Label valign => 0, align => 1, text => "Host:Port"); 715 $table->add (0, 2, new CFClient::UI::Label valign => 0, align => 1, text => "Host:Port");
816 $dialog 817 $dialog
817} 818}
818 819
819sub message_window { 820sub message_window {
820 my $window = new CFClient::UI::FancyFrame 821 my $window = new CFClient::UI::FancyFrame
822 name => "message_window",
821 title => "Messages", 823 title => "Messages",
822 border_bg => [1, 1, 1, 1], 824 border_bg => [1, 1, 1, 1],
823 bg => [0, 0, 0, 0.75], 825 bg => [0, 0, 0, 0.75],
824 user_w => int $::WIDTH / 3, 826 user_w => int $::WIDTH / 3,
825 user_h => int $::HEIGHT / 5, 827 user_h => int $::HEIGHT / 5,
900 } 902 }
901} 903}
902 904
903sub make_inventory_window { 905sub make_inventory_window {
904 my $invwin = new CFClient::UI::FancyFrame 906 my $invwin = new CFClient::UI::FancyFrame
905 user_w => $WIDTH * (7/8), user_h => $HEIGHT * (7/8), title => "Inventory"; 907 user_w => $WIDTH * (7/8), user_h => $HEIGHT * (7/8), title => "Inventory", name => "inventory_window";
906 908
907 $invwin->add (my $hb = new CFClient::UI::HBox expand => 1); 909 $invwin->add (my $hb = new CFClient::UI::HBox expand => 1);
908 910
909 $hb->add (my $vb1 = new CFClient::UI::VBox expand => 1); 911 $hb->add (my $vb1 = new CFClient::UI::VBox expand => 1);
910 $vb1->add (my $lbl = new CFClient::UI::Label xalign => 0.5); 912 $vb1->add (my $lbl = new CFClient::UI::Label align => 0);
911 $lbl->set_text ("Player"); 913 $lbl->set_text ("Player");
912 $vb1->add ($INV = new CFClient::UI::Inventory expand => 1); 914 $vb1->add ($INV = new CFClient::UI::Inventory expand => 1);
913 915
914 $hb->add (my $vb2 = new CFClient::UI::VBox expand => 1); 916 $hb->add (my $vb2 = new CFClient::UI::VBox expand => 1);
917 $vb2->add (my $hb2 = new CFClient::UI::HBox);
918 $hb2->add (new CFClient::UI::Button
919 text => "Close",
920 tooltip => "Close the currently open container (if one is open)",
921 connect_activate => sub {
922 $CONN->send ("apply $CONN->{open_container}")
923 if $CONN->{open_container} != 0;
924 },
925 );
915 $vb2->add ($INVR_LBL = new CFClient::UI::Label xalign => 0.5); 926 $hb2->add ($INVR_LBL = new CFClient::UI::Label align => 0);
927
916 $INVR_LBL->set_text ("Floor"); 928 $INVR_LBL->set_text ("Floor");
917 $vb2->add ($INVR = new CFClient::UI::Inventory expand => 1); 929 $vb2->add ($INVR = new CFClient::UI::Inventory expand => 1);
918 930
919 $invwin 931 $invwin
920} 932}
1055 1067
1056 $BUTTONBAR->add (new CFClient::UI::Button 1068 $BUTTONBAR->add (new CFClient::UI::Button
1057 text => "Save Config", 1069 text => "Save Config",
1058 tooltip => "Saves the options chosen in the client setting, server settings and the window layout to be restored on later runs.", 1070 tooltip => "Saves the options chosen in the client setting, server settings and the window layout to be restored on later runs.",
1059 connect_activate => sub { 1071 connect_activate => sub {
1072 $::CFG->{layout} = CFClient::UI::get_layout;
1060 CFClient::write_cfg "$Crossfire::VARDIR/pclientrc"; 1073 CFClient::write_cfg "$Crossfire::VARDIR/pclientrc";
1061 status "Configuration Saved"; 1074 status "Configuration Saved";
1062 }, 1075 },
1063 ); 1076 );
1064 1077
1308 1321
1309{ 1322{
1310 local $SIG{__DIE__} = sub { CFClient::fatal $_[0] }; 1323 local $SIG{__DIE__} = sub { CFClient::fatal $_[0] };
1311 1324
1312 CFClient::read_cfg "$Crossfire::VARDIR/pclientrc"; 1325 CFClient::read_cfg "$Crossfire::VARDIR/pclientrc";
1326 CFClient::UI::set_layout ($::CFG->{layout});
1313 1327
1314 my %DEF_CFG = ( 1328 my %DEF_CFG = (
1315 sdl_mode => 0, 1329 sdl_mode => 0,
1316 width => 640, 1330 width => 640,
1317 height => 480, 1331 height => 480,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines