… | |
… | |
105 | our $INVR; |
105 | our $INVR; |
106 | our $INV_RIGHT_HB; |
106 | our $INV_RIGHT_HB; |
107 | |
107 | |
108 | our $BIND_WINDOW; |
108 | our $BIND_WINDOW; |
109 | our $BIND_EDITOR; |
109 | our $BIND_EDITOR; |
|
|
110 | |
|
|
111 | our $SPELL_LIST; |
110 | |
112 | |
111 | sub status { |
113 | sub status { |
112 | $STATUSBOX->add (CFClient::UI::Label::escape $_[0], pri => -10, group => "status", timeout => 10, fg => [1, 1, 0, 1]); |
114 | $STATUSBOX->add (CFClient::UI::Label::escape $_[0], pri => -10, group => "status", timeout => 10, fg => [1, 1, 0, 1]); |
113 | } |
115 | } |
114 | |
116 | |
… | |
… | |
930 | x => "center", |
932 | x => "center", |
931 | y => "center", |
933 | y => "center", |
932 | force_w => $WIDTH * 9/10, |
934 | force_w => $WIDTH * 9/10, |
933 | force_h => $HEIGHT * 9/10, |
935 | force_h => $HEIGHT * 9/10, |
934 | title => "Inventory", |
936 | title => "Inventory", |
935 | name => "inventory_window", |
|
|
936 | ; |
937 | ; |
937 | |
938 | |
938 | $invwin->add (my $hb = new CFClient::UI::HBox homogeneous => 1); |
939 | $invwin->add (my $hb = new CFClient::UI::HBox homogeneous => 1); |
939 | |
940 | |
940 | $hb->add (my $vb1 = new CFClient::UI::VBox); |
941 | $hb->add (my $vb1 = new CFClient::UI::VBox); |
… | |
… | |
949 | |
950 | |
950 | # XXX: Call after $INVR = ... because set_opencont sets the items |
951 | # XXX: Call after $INVR = ... because set_opencont sets the items |
951 | CFClient::Protocol::set_opencont ($::CONN, 0, "Floor"); |
952 | CFClient::Protocol::set_opencont ($::CONN, 0, "Floor"); |
952 | |
953 | |
953 | $invwin |
954 | $invwin |
|
|
955 | } |
|
|
956 | |
|
|
957 | sub make_spell_list { |
|
|
958 | $SPELL_LIST = new CFClient::UI::SpellList |
|
|
959 | force_w => $WIDTH * (9/10), |
|
|
960 | force_h => $HEIGHT * (9/10); |
|
|
961 | $SPELL_LIST |
954 | } |
962 | } |
955 | |
963 | |
956 | sub make_binding_window { |
964 | sub make_binding_window { |
957 | my $binding_list = new CFClient::UI::VBox; |
965 | my $binding_list = new CFClient::UI::VBox; |
958 | |
966 | |
… | |
… | |
1214 | "Lets you define, edit and delete bindings." |
1222 | "Lets you define, edit and delete bindings." |
1215 | ."There is a shortcut for making bindings: LCTRL+Insert opens the binding editor " |
1223 | ."There is a shortcut for making bindings: LCTRL+Insert opens the binding editor " |
1216 | ."with nothing set and the recording started. After doing the actions you " |
1224 | ."with nothing set and the recording started. After doing the actions you " |
1217 | ."want to record press Insert and you will be asked to press a key-combo." |
1225 | ."want to record press Insert and you will be asked to press a key-combo." |
1218 | ."After pressing the combo the binding will be saved automatically and the " |
1226 | ."After pressing the combo the binding will be saved automatically and the " |
1219 | ."binding editor closes" |
1227 | ."binding editor closes"); |
1220 | ); |
1228 | |
|
|
1229 | $BUTTONBAR->add (new CFClient::UI::Flopper |
|
|
1230 | text => "Spells", |
|
|
1231 | other => make_spell_list, |
|
|
1232 | tooltip => "The spell list"); |
1221 | |
1233 | |
1222 | $BUTTONBAR->add (new CFClient::UI::Button |
1234 | $BUTTONBAR->add (new CFClient::UI::Button |
1223 | text => "Quit", |
1235 | text => "Quit", |
1224 | tooltip => "Terminates the program", |
1236 | tooltip => "Terminates the program", |
1225 | on_activate => sub { |
1237 | on_activate => sub { |
… | |
… | |
1553 | =head1 USAGE |
1565 | =head1 USAGE |
1554 | |
1566 | |
1555 | cfplus utilises OpenGL for all UI elements and the game. It is supposed to be used |
1567 | cfplus utilises OpenGL for all UI elements and the game. It is supposed to be used |
1556 | fullscreen and interactively. |
1568 | fullscreen and interactively. |
1557 | |
1569 | |
|
|
1570 | =head1 DEBUGGING |
|
|
1571 | |
|
|
1572 | |
|
|
1573 | CFPLUS_DEBUG - environment variable |
|
|
1574 | |
|
|
1575 | 1 draw borders around widgets |
|
|
1576 | 2 add low-level widget info to tooltips |
|
|
1577 | 4 show fps |
|
|
1578 | 8 suppress tooltips |
|
|
1579 | |
1558 | =head1 AUTHOR |
1580 | =head1 AUTHOR |
1559 | |
1581 | |
1560 | Marc Lehmann <crossfire@schmorp.de>, Robin Redeker <elmex@ta-sa.org> |
1582 | Marc Lehmann <crossfire@schmorp.de>, Robin Redeker <elmex@ta-sa.org> |
1561 | |
1583 | |
1562 | |
1584 | |