--- deliantra/Deliantra-Client/bin/cfplus 2006/05/26 19:14:33 1.12 +++ deliantra/Deliantra-Client/bin/cfplus 2006/05/27 20:26:22 1.17 @@ -99,7 +99,6 @@ our $STATUSBOX; our $DEBUG_STATUS; -our $INVWIN; our $INV; our $INVR; our $INVR_LBL; @@ -180,6 +179,7 @@ sub client_setup { my $dialog = new CFClient::UI::FancyFrame + name => "client_setup", title => "Client Setup", child => (my $vbox = new CFClient::UI::VBox); $vbox->add (my $table = new CFClient::UI::Table expand => 1, col_expand => [0, 1]); @@ -257,7 +257,7 @@ connect_changed => sub { my ($self, $value) = @_; $CFG->{fow_smooth} = $value; - status "Fog of War smoothing requires OpenGL 1.2 or higher" if $CFClient::GL_VERSION < 1.2; + status "Fog of War smoothing requires OpenGL 1.2 or higher" if $CFClient::OpenGL::GL_VERSION < 1.2; } ); @@ -434,7 +434,7 @@ } sub make_stats_window { - my $tgw = new CFClient::UI::FancyFrame title => "Stats"; + my $tgw = new CFClient::UI::FancyFrame title => "Stats", name => "stats_window"; $tgw->add (new CFClient::UI::Window child => my $vb = new CFClient::UI::VBox); $vb->add ($STATWIDS->{title} = new CFClient::UI::Label valign => 0, align => -1, text => "Title:", expand => 1, @@ -447,10 +447,10 @@ $vb->add (my $hb0 = new CFClient::UI::HBox); $hb0->add ($STATWIDS->{weight} = new CFClient::UI::Label valign => 0, align => -1, text => "Weight:", expand => 1, can_hover => 1, can_events => 1, - tooltip => "This is the amount the Player weights."); + tooltip => "The weight of the player including all inventory items."); $hb0->add ($STATWIDS->{m_weight} = new CFClient::UI::Label valign => 0, align => -1, text => "Max weight:", expand => 1, can_hover => 1, can_events => 1, - tooltip => "The weight limit, you can't carry more than this."); + tooltip => "The weight limit: you cannot carry more than this."); $vb->add (my $hb = new CFClient::UI::HBox expand => 1); @@ -707,6 +707,7 @@ sub server_setup { my $dialog = new CFClient::UI::FancyFrame + name => "server_setup", title => "Server Setup", child => (my $vbox = new CFClient::UI::VBox); @@ -818,6 +819,7 @@ sub message_window { my $window = new CFClient::UI::FancyFrame + name => "message_window", title => "Messages", border_bg => [1, 1, 1, 1], bg => [0, 0, 0, 0.75], @@ -902,17 +904,28 @@ sub make_inventory_window { my $invwin = new CFClient::UI::FancyFrame - user_w => $WIDTH * (7/8), user_h => $HEIGHT * (7/8), title => "Inventory"; + user_w => $WIDTH * (7/8), user_h => $HEIGHT * (7/8), title => "Inventory", name => "inventory_window"; $invwin->add (my $hb = new CFClient::UI::HBox expand => 1); $hb->add (my $vb1 = new CFClient::UI::VBox expand => 1); - $vb1->add (my $lbl = new CFClient::UI::Label xalign => 0.5); + $vb1->add (my $lbl = new CFClient::UI::Label align => 0); $lbl->set_text ("Player"); $vb1->add ($INV = new CFClient::UI::Inventory expand => 1); $hb->add (my $vb2 = new CFClient::UI::VBox expand => 1); - $vb2->add ($INVR_LBL = new CFClient::UI::Label xalign => 0.5); + + $vb2->add (my $hb2 = new CFClient::UI::HBox); + $hb2->add ($INVR_LBL = new CFClient::UI::Label align => 0, expand => 1); + $hb2->add (new CFClient::UI::Button + text => "Close", + tooltip => "Close the currently open container (if one is open)", + connect_activate => sub { + $CONN->send ("apply $CONN->{open_container}") + if $CONN->{open_container} != 0; + }, + ); + $INVR_LBL->set_text ("Floor"); $vb2->add ($INVR = new CFClient::UI::Inventory expand => 1); @@ -1057,6 +1070,7 @@ text => "Save Config", tooltip => "Saves the options chosen in the client setting, server settings and the window layout to be restored on later runs.", connect_activate => sub { + $::CFG->{layout} = CFClient::UI::get_layout; CFClient::write_cfg "$Crossfire::VARDIR/pclientrc"; status "Configuration Saved"; }, @@ -1310,6 +1324,7 @@ local $SIG{__DIE__} = sub { CFClient::fatal $_[0] }; CFClient::read_cfg "$Crossfire::VARDIR/pclientrc"; + CFClient::UI::set_layout ($::CFG->{layout}); my %DEF_CFG = ( sdl_mode => 0,