… | |
… | |
101 | our $DEBUG_STATUS; |
101 | our $DEBUG_STATUS; |
102 | |
102 | |
103 | our $INV_WINDOW; |
103 | our $INV_WINDOW; |
104 | our $INV; |
104 | our $INV; |
105 | our $INVR; |
105 | our $INVR; |
106 | our $INVR_LBL; |
106 | our $INV_RIGHT_HB; |
107 | |
107 | |
108 | our $BIND_WINDOW; |
108 | our $BIND_WINDOW; |
109 | |
109 | |
110 | sub status { |
110 | sub 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 container", |
|
|
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 | |
962 | sub make_binding_window { |
956 | sub make_binding_window { |
… | |
… | |
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, |
… | |
… | |
1393 | ############################################################################# |
1387 | ############################################################################# |
1394 | |
1388 | |
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] if defined $^S && !$^S }; |
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 | |
1484 | END { CFClient::SDL_Quit } |
1478 | END { CFClient::SDL_Quit } |
1485 | |
1479 | |
1486 | =head1 NAME |
1480 | =head1 NAME |
1487 | |
1481 | |
1488 | pclient - A Crossfire+ and Crossfire game client |
1482 | cfplus - A Crossfire+ and Crossfire game client |
1489 | |
1483 | |
1490 | =head1 SYNOPSIS |
1484 | =head1 SYNOPSIS |
1491 | |
1485 | |
1492 | Just run it - no commandline arguments are supported. |
1486 | Just run it - no commandline arguments are supported. |
1493 | |
1487 | |
1494 | =head1 USAGE |
1488 | =head1 USAGE |
1495 | |
1489 | |
1496 | Pclient utilises OpenGL for all UI elements and the game. It is supposed to be used |
1490 | cfplus utilises OpenGL for all UI elements and the game. It is supposed to be used |
1497 | fullscreen and interactively. |
1491 | fullscreen and interactively. |
1498 | |
1492 | |
1499 | =head1 AUTHOR |
1493 | =head1 AUTHOR |
1500 | |
1494 | |
1501 | Marc Lehmann <crossfire@schmorp.de>, Robin Redeker <elmex@ta-sa.org> |
1495 | Marc Lehmann <crossfire@schmorp.de>, Robin Redeker <elmex@ta-sa.org> |