… | |
… | |
644 | |
644 | |
645 | $table |
645 | $table |
646 | } |
646 | } |
647 | |
647 | |
648 | sub stats_window { |
648 | sub stats_window { |
|
|
649 | my $r = |
|
|
650 | new CFClient::UI::ScrolledWindow ( |
|
|
651 | expand => 1, |
|
|
652 | scroll_y => 1 |
|
|
653 | ); |
649 | my $vb = new CFClient::UI::VBox; |
654 | $r->add (my $vb = new CFClient::UI::VBox); |
650 | |
655 | |
651 | $vb->add ($STATWIDS->{title} = new CFClient::UI::Label valign => 0, align => -1, text => "Title:", expand => 1, |
656 | $vb->add ($STATWIDS->{title} = new CFClient::UI::Label valign => 0, align => -1, text => "Title:", expand => 1, |
652 | can_hover => 1, can_events => 1, |
657 | can_hover => 1, can_events => 1, |
653 | tooltip => "Your name and title. You can change your title by using the <b>title</b> command, if supported by the server."); |
658 | tooltip => "Your name and title. You can change your title by using the <b>title</b> command, if supported by the server."); |
654 | $vb->add ($STATWIDS->{map} = new CFClient::UI::Label valign => 0, align => -1, text => "Map:", expand => 1, |
659 | $vb->add ($STATWIDS->{map} = new CFClient::UI::Label valign => 0, align => -1, text => "Map:", expand => 1, |
… | |
… | |
773 | } |
778 | } |
774 | } |
779 | } |
775 | |
780 | |
776 | #update_stats_window ({}); |
781 | #update_stats_window ({}); |
777 | |
782 | |
778 | $vb |
783 | $r |
779 | } |
784 | } |
780 | |
785 | |
781 | sub skill_window { |
786 | sub skill_window { |
|
|
787 | my $sw = new CFClient::UI::ScrolledWindow (expand => 1); |
782 | $STATWIDS->{skill_tbl} = new CFClient::UI::Table expand => 1, col_expand => [0, 0, 1, 0, 0, 1] |
788 | $sw->add ($STATWIDS->{skill_tbl} = new CFClient::UI::Table expand => 1, col_expand => [0, 0, 1, 0, 0, 1]); |
|
|
789 | $sw |
783 | } |
790 | } |
784 | |
791 | |
785 | sub formsep($) { |
792 | sub formsep($) { |
786 | scalar reverse join ",", unpack "(A3)*", reverse $_[0] * 1 |
793 | scalar reverse join ",", unpack "(A3)*", reverse $_[0] * 1 |
787 | } |
794 | } |
… | |
… | |
1229 | sub inventory_widget { |
1236 | sub inventory_widget { |
1230 | my $hb = new CFClient::UI::HBox homogeneous => 1; |
1237 | my $hb = new CFClient::UI::HBox homogeneous => 1; |
1231 | |
1238 | |
1232 | $hb->add (my $vb1 = new CFClient::UI::VBox); |
1239 | $hb->add (my $vb1 = new CFClient::UI::VBox); |
1233 | $vb1->add (new CFClient::UI::Label align => 0, text => "Player"); |
1240 | $vb1->add (new CFClient::UI::Label align => 0, text => "Player"); |
|
|
1241 | $vb1->add (my $sw1 = new CFClient::UI::ScrolledWindow expand => 1, scroll_y => 1); |
1234 | $vb1->add ($INV = new CFClient::UI::Inventory); |
1242 | $sw1->add ($INV = new CFClient::UI::Inventory); |
1235 | |
1243 | |
1236 | $hb->add (my $vb2 = new CFClient::UI::VBox); |
1244 | $hb->add (my $vb2 = new CFClient::UI::VBox); |
1237 | |
1245 | |
1238 | $vb2->add ($INV_RIGHT_HB = new CFClient::UI::HBox); |
1246 | $vb2->add ($INV_RIGHT_HB = new CFClient::UI::HBox); |
1239 | |
1247 | |
|
|
1248 | $vb2->add (my $sw2 = new CFClient::UI::ScrolledWindow expand => 1, scroll_y => 1); |
1240 | $vb2->add ($INVR = new CFClient::UI::Inventory); |
1249 | $sw2->add ($INVR = new CFClient::UI::Inventory); |
1241 | |
1250 | |
1242 | # XXX: Call after $INVR = ... because set_opencont sets the items |
1251 | # XXX: Call after $INVR = ... because set_opencont sets the items |
1243 | CFClient::Protocol::set_opencont ($::CONN, 0, "Floor"); |
1252 | CFClient::Protocol::set_opencont ($::CONN, 0, "Floor"); |
1244 | |
1253 | |
1245 | $hb |
1254 | $hb |
… | |
… | |
1267 | has_close_button => 1 |
1276 | has_close_button => 1 |
1268 | ; |
1277 | ; |
1269 | |
1278 | |
1270 | my $ntb = |
1279 | my $ntb = |
1271 | $PL_NOTEBOOK = |
1280 | $PL_NOTEBOOK = |
1272 | new CFClient::UI::Notebook |
1281 | new CFClient::UI::Notebook expand => 1, debug => 1; |
1273 | expand => 1, |
|
|
1274 | debug => 1, |
|
|
1275 | filter => (new CFClient::UI::ScrolledWindow expand => 1, scroll_y => 1), |
|
|
1276 | ; |
|
|
1277 | |
1282 | |
1278 | $ntb->add ( |
1283 | $ntb->add ( |
1279 | "Statistics (F2)" => $STATS_PAGE = stats_window, |
1284 | "Statistics (F2)" => $STATS_PAGE = stats_window, |
1280 | "Shows statistics, where all your Stats and Resistances are shown." |
1285 | "Shows statistics, where all your Stats and Resistances are shown." |
1281 | ); |
1286 | ); |
1282 | $ntb->add ( |
1287 | $ntb->add ( |
1283 | "Skills (F3)" => $SKILL_PAGE = skill_window, |
1288 | "Skills (F3)" => $SKILL_PAGE = skill_window, |
1284 | "Shows all your Skills." |
1289 | "Shows all your Skills." |
1285 | ); |
1290 | ); |
|
|
1291 | |
|
|
1292 | my $spellsw = new CFClient::UI::ScrolledWindow (expand => 1, scroll_y => 1); |
|
|
1293 | $spellsw->add ($SPELL_PAGE = new CFClient::UI::SpellList); |
1286 | $ntb->add ( |
1294 | $ntb->add ( |
1287 | "Spellbook (F4)" => $SPELL_PAGE = new CFClient::UI::SpellList, |
1295 | "Spellbook (F4)" => $spellsw, |
1288 | "Displays all spells you have and lets you edit keyboard shortcuts for them." |
1296 | "Displays all spells you have and lets you edit keyboard shortcuts for them." |
1289 | ); |
1297 | ); |
1290 | $ntb->add ( |
1298 | $ntb->add ( |
1291 | "Inventory (F5)" => $INVENTORY_PAGE = inventory_widget, |
1299 | "Inventory (F5)" => $INVENTORY_PAGE = inventory_widget, |
1292 | "Toggles the inventory window, where you can manage your loot (or treasures :). " |
1300 | "Toggles the inventory window, where you can manage your loot (or treasures :). " |