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.24 by elmex, Mon May 29 19:30:28 2006 UTC vs.
Revision 1.28 by root, Mon May 29 21:10:47 2006 UTC

101our $DEBUG_STATUS; 101our $DEBUG_STATUS;
102 102
103our $INV_WINDOW; 103our $INV_WINDOW;
104our $INV; 104our $INV;
105our $INVR; 105our $INVR;
106our $INVR_LBL; 106our $INV_RIGHT_HB;
107 107
108our $BIND_WINDOW; 108our $BIND_WINDOW;
109 109
110sub status { 110sub status {
111 $STATUSBOX->add (CFClient::UI::Label::escape $_[0], pri => -10, group => "status", timeout => 10, fg => [1, 1, 0, 1]); 111 $STATUSBOX->add (CFClient::UI::Label::escape $_[0], pri => -10, group => "status", timeout => 10, fg => [1, 1, 0, 1]);
941 $vb1->add (new CFClient::UI::Label align => 0, text => "Player"); 941 $vb1->add (new CFClient::UI::Label align => 0, text => "Player");
942 $vb1->add ($INV = new CFClient::UI::Inventory expand => 1); 942 $vb1->add ($INV = new CFClient::UI::Inventory expand => 1);
943 943
944 $hb->add (my $vb2 = new CFClient::UI::VBox); 944 $hb->add (my $vb2 = new CFClient::UI::VBox);
945 945
946 $vb2->add (my $hb2 = new CFClient::UI::HBox); 946 $vb2->add ($INV_RIGHT_HB = new CFClient::UI::HBox);
947 $hb2->add ($INVR_LBL = new CFClient::UI::Label align => 0, expand => 1, text => "Floor");
948 $hb2->add (new CFClient::UI::Button
949 text => "Close",
950 tooltip => "Close the currently open container (if one is open)",
951 on_activate => sub {
952 $CONN->send ("apply $CONN->{open_container}")
953 if $CONN->{open_container} != 0;
954 },
955 );
956 947
957 $vb2->add ($INVR = new CFClient::UI::Inventory expand => 1); 948 $vb2->add ($INVR = new CFClient::UI::Inventory expand => 1);
949
950 # XXX: Call after $INVR = ... because set_opencont sets the items
951 CFClient::Protocol::set_opencont ($::CONN, 0, "Floor");
958 952
959 $invwin 953 $invwin
960} 954}
961 955
962sub make_binding_window { 956sub make_binding_window {
972 966
973 my $lbl = join "; ", @$cmds; 967 my $lbl = join "; ", @$cmds;
974 my $nam = CFClient::Recorder::keycombo_to_name ($mod, $sym); 968 my $nam = CFClient::Recorder::keycombo_to_name ($mod, $sym);
975 $binding_list->add (my $hb = new CFClient::UI::HBox); 969 $binding_list->add (my $hb = new CFClient::UI::HBox);
976 $hb->add (new CFClient::UI::Button 970 $hb->add (new CFClient::UI::Button
977 text => "del", 971 text => "delete",
978 on_activate => sub { 972 on_activate => sub {
979 $binding_list->remove ($hb); 973 $binding_list->remove ($hb);
980 delete $::CFG->{bindings}->{$mod}->{$sym}; 974 delete $::CFG->{bindings}->{$mod}->{$sym};
981 }); 975 });
982 $hb->add (new CFClient::UI::Label text => "($nam)"); 976 $hb->add (new CFClient::UI::Label text => "($nam)");
1141 $BUTTONBAR->add (new CFClient::UI::Button 1135 $BUTTONBAR->add (new CFClient::UI::Button
1142 text => "Save Config", 1136 text => "Save Config",
1143 tooltip => "Saves the options chosen in the client setting, server settings and the window layout to be restored on later runs.", 1137 tooltip => "Saves the options chosen in the client setting, server settings and the window layout to be restored on later runs.",
1144 on_activate => sub { 1138 on_activate => sub {
1145 $::CFG->{layout} = CFClient::UI::get_layout; 1139 $::CFG->{layout} = CFClient::UI::get_layout;
1146 CFClient::write_cfg "$Crossfire::VARDIR/pclientrc"; 1140 CFClient::write_cfg "$Crossfire::VARDIR/cfplusrc";
1147 status "Configuration Saved"; 1141 status "Configuration Saved";
1148 }, 1142 },
1149 ); 1143 );
1150 1144
1151 $BUTTONBAR->add (new CFClient::UI::Flopper text => "Help!", other => make_help_window, 1145 $BUTTONBAR->add (new CFClient::UI::Flopper text => "Help!", other => make_help_window,
1395$SIG{INT} = $SIG{TERM} = sub { exit }; 1389$SIG{INT} = $SIG{TERM} = sub { exit };
1396 1390
1397{ 1391{
1398 local $SIG{__DIE__} = sub { CFClient::fatal $_[0] }; 1392 local $SIG{__DIE__} = sub { CFClient::fatal $_[0] };
1399 1393
1400 CFClient::read_cfg "$Crossfire::VARDIR/pclientrc"; 1394 CFClient::read_cfg "$Crossfire::VARDIR/cfplusrc";
1401 CFClient::UI::set_layout ($::CFG->{layout}); 1395 CFClient::UI::set_layout ($::CFG->{layout});
1402 1396
1403 my %DEF_CFG = ( 1397 my %DEF_CFG = (
1404 sdl_mode => 0, 1398 sdl_mode => 0,
1405 width => 640, 1399 width => 640,
1483 1477
1484END { CFClient::SDL_Quit } 1478END { CFClient::SDL_Quit }
1485 1479
1486=head1 NAME 1480=head1 NAME
1487 1481
1488pclient - A Crossfire+ and Crossfire game client 1482cfplus - A Crossfire+ and Crossfire game client
1489 1483
1490=head1 SYNOPSIS 1484=head1 SYNOPSIS
1491 1485
1492Just run it - no commandline arguments are supported. 1486Just run it - no commandline arguments are supported.
1493 1487
1494=head1 USAGE 1488=head1 USAGE
1495 1489
1496Pclient utilises OpenGL for all UI elements and the game. It is supposed to be used 1490cfplus utilises OpenGL for all UI elements and the game. It is supposed to be used
1497fullscreen and interactively. 1491fullscreen and interactively.
1498 1492
1499=head1 AUTHOR 1493=head1 AUTHOR
1500 1494
1501Marc Lehmann <crossfire@schmorp.de>, Robin Redeker <elmex@ta-sa.org> 1495Marc Lehmann <crossfire@schmorp.de>, Robin Redeker <elmex@ta-sa.org>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines