… | |
… | |
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 | |
… | |
… | |
1189 | make_gauge_window->show; # XXX: this has to be set before make_stats_window as make_stats_window calls update_stats_window which updated the gauges also X-D |
1197 | make_gauge_window->show; # XXX: this has to be set before make_stats_window as make_stats_window calls update_stats_window which updated the gauges also X-D |
1190 | |
1198 | |
1191 | $BUTTONBAR->add (new CFClient::UI::Flopper text => "Stats Window", other => make_stats_window, |
1199 | $BUTTONBAR->add (new CFClient::UI::Flopper text => "Stats Window", other => make_stats_window, |
1192 | tooltip => "Toggles the statistics window, where all your Stats and Resistances are being displayed at all times."); |
1200 | tooltip => "Toggles the statistics window, where all your Stats and Resistances are being displayed at all times."); |
1193 | $BUTTONBAR->add (new CFClient::UI::Flopper text => "Inventory", other => make_inventory_window, |
1201 | $BUTTONBAR->add (new CFClient::UI::Flopper text => "Inventory", other => make_inventory_window, |
1194 | tooltip => "Toggles the inventory window, where you can manage your loot (or treaures :)."); |
1202 | tooltip => "Toggles the inventory window, where you can manage your loot (or treaures :)." |
|
|
1203 | ."You can also hit the Tab-key to show/hide the Inventory."); |
1195 | |
1204 | |
1196 | $BUTTONBAR->add (new CFClient::UI::Button |
1205 | $BUTTONBAR->add (new CFClient::UI::Button |
1197 | text => "Save Config", |
1206 | text => "Save Config", |
1198 | tooltip => "Saves the options chosen in the client setting, server settings and the window layout to be restored on later runs.", |
1207 | tooltip => "Saves the options chosen in the client setting, server settings and the window layout to be restored on later runs.", |
1199 | on_activate => sub { |
1208 | on_activate => sub { |
… | |
… | |
1213 | "Lets you define, edit and delete bindings." |
1222 | "Lets you define, edit and delete bindings." |
1214 | ."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 " |
1215 | ."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 " |
1216 | ."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." |
1217 | ."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 " |
1218 | ."binding editor closes" |
1227 | ."binding editor closes"); |
1219 | ); |
1228 | |
|
|
1229 | $BUTTONBAR->add (new CFClient::UI::Flopper |
|
|
1230 | text => "Spells", |
|
|
1231 | other => make_spell_list, |
|
|
1232 | tooltip => "The spell list"); |
1220 | |
1233 | |
1221 | $BUTTONBAR->add (new CFClient::UI::Button |
1234 | $BUTTONBAR->add (new CFClient::UI::Button |
1222 | text => "Quit", |
1235 | text => "Quit", |
1223 | tooltip => "Terminates the program", |
1236 | tooltip => "Terminates the program", |
1224 | on_activate => sub { |
1237 | on_activate => sub { |
… | |
… | |
1552 | =head1 USAGE |
1565 | =head1 USAGE |
1553 | |
1566 | |
1554 | 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 |
1555 | fullscreen and interactively. |
1568 | fullscreen and interactively. |
1556 | |
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 | |
1557 | =head1 AUTHOR |
1580 | =head1 AUTHOR |
1558 | |
1581 | |
1559 | Marc Lehmann <crossfire@schmorp.de>, Robin Redeker <elmex@ta-sa.org> |
1582 | Marc Lehmann <crossfire@schmorp.de>, Robin Redeker <elmex@ta-sa.org> |
1560 | |
1583 | |
1561 | |
1584 | |