… | |
… | |
85 | our $CONSOLE; |
85 | our $CONSOLE; |
86 | our $METASERVER; |
86 | our $METASERVER; |
87 | our $LOGIN_BUTTON; |
87 | our $LOGIN_BUTTON; |
88 | our $QUIT_DIALOG; |
88 | our $QUIT_DIALOG; |
89 | our $HOST_ENTRY; |
89 | our $HOST_ENTRY; |
|
|
90 | our $PICKUP_ENABLE; |
90 | our $SERVER_INFO; |
91 | our $SERVER_INFO; |
91 | |
92 | |
92 | our $SETUP_DIALOG; |
93 | our $SETUP_DIALOG; |
93 | our $SETUP_NOTEBOOK; |
94 | our $SETUP_NOTEBOOK; |
94 | our $SETUP_SERVER; |
95 | our $SETUP_SERVER; |
95 | our $SETUP_KEYBOARD; |
96 | our $SETUP_KEYBOARD; |
96 | our $SETUP_SPELLS; |
|
|
97 | |
97 | |
|
|
98 | our $PL_NOTEBOOK; |
98 | our $STATS_WINDOW; |
99 | our $PL_WINDOW; |
|
|
100 | |
|
|
101 | our $INVENTORY_PAGE; |
|
|
102 | our $STATS_PAGE; |
|
|
103 | our $SPELL_PAGE; |
|
|
104 | |
|
|
105 | our $HELP_WINDOW; |
99 | our $MESSAGE_WINDOW; |
106 | our $MESSAGE_WINDOW; |
100 | our $FLOORBOX; |
107 | our $FLOORBOX; |
101 | our $GAUGES; |
108 | our $GAUGES; |
102 | our $STATWIDS; |
109 | our $STATWIDS; |
103 | |
110 | |
… | |
… | |
113 | our $DEBUG_STATUS; |
120 | our $DEBUG_STATUS; |
114 | |
121 | |
115 | our $INV; |
122 | our $INV; |
116 | our $INVR; |
123 | our $INVR; |
117 | our $INV_RIGHT_HB; |
124 | our $INV_RIGHT_HB; |
118 | |
|
|
119 | our $PL_NOTEBOOK; |
|
|
120 | our $PL_WINDOW; |
|
|
121 | |
125 | |
122 | our $BIND_EDITOR; |
126 | our $BIND_EDITOR; |
123 | our $BIND_UPD_CB; |
127 | our $BIND_UPD_CB; |
124 | |
128 | |
125 | our $PICKUP_CFG; |
129 | our $PICKUP_CFG; |
… | |
… | |
223 | $conn->send ("reply $stat"); |
227 | $conn->send ("reply $stat"); |
224 | destroy_query_dialog $conn; |
228 | destroy_query_dialog $conn; |
225 | return; |
229 | return; |
226 | } |
230 | } |
227 | |
231 | |
228 | $STATS_WINDOW->show; |
232 | $STATS_PAGE->show; |
229 | $MESSAGE_WINDOW->hide; |
233 | $MESSAGE_WINDOW->hide; |
230 | |
234 | |
231 | unshift @dialog, new CFClient::UI::Label |
235 | unshift @dialog, new CFClient::UI::Label |
232 | max_w => $::WIDTH * 0.4, |
236 | max_w => $::WIDTH * 0.4, |
233 | ellipsise => 0, |
237 | ellipsise => 0, |
… | |
… | |
273 | # right: accept |
277 | # right: accept |
274 | $table->add (4, 0, new CFClient::UI::Button |
278 | $table->add (4, 0, new CFClient::UI::Button |
275 | text => "Accept", |
279 | text => "Accept", |
276 | on_activate => sub { |
280 | on_activate => sub { |
277 | $conn->send ("reply n"); |
281 | $conn->send ("reply n"); |
278 | $STATS_WINDOW->hide; |
282 | $STATS_PAGE->hide; |
279 | destroy_query_dialog $conn; |
283 | destroy_query_dialog $conn; |
280 | 0 |
284 | 0 |
281 | }, |
285 | }, |
282 | ); |
286 | ); |
283 | |
287 | |
… | |
… | |
376 | sub stop_game { |
380 | sub stop_game { |
377 | $LOGIN_BUTTON->set_text ("Login"); |
381 | $LOGIN_BUTTON->set_text ("Login"); |
378 | $SETUP_NOTEBOOK->set_current_page ($SETUP_SERVER); |
382 | $SETUP_NOTEBOOK->set_current_page ($SETUP_SERVER); |
379 | $SETUP_DIALOG->show; |
383 | $SETUP_DIALOG->show; |
380 | $PL_WINDOW->hide; |
384 | $PL_WINDOW->hide; |
381 | $SETUP_SPELLS->clear_spells; |
385 | $SPELL_PAGE->clear_spells; |
382 | |
386 | |
383 | return unless $CONN; |
387 | return unless $CONN; |
384 | |
388 | |
385 | status "connection closed"; |
389 | status "connection closed"; |
386 | |
390 | |
… | |
… | |
1186 | sub autopickup_setup { |
1190 | sub autopickup_setup { |
1187 | my $table = new CFClient::UI::Table; |
1191 | my $table = new CFClient::UI::Table; |
1188 | |
1192 | |
1189 | for ( |
1193 | for ( |
1190 | ["General", 0, 0, |
1194 | ["General", 0, 0, |
1191 | ["Enable autopickup" => PICKUP_NEWMODE], |
1195 | ["Enable autopickup" => PICKUP_NEWMODE, \$PICKUP_ENABLE], |
1192 | ["Inhibit autopickup" => PICKUP_INHIBIT], |
1196 | ["Inhibit autopickup" => PICKUP_INHIBIT], |
1193 | ["Stop before pickup" => PICKUP_STOP], |
1197 | ["Stop before pickup" => PICKUP_STOP], |
1194 | ["Debug autopickup" => PICKUP_DEBUG], |
1198 | ["Debug autopickup" => PICKUP_DEBUG], |
1195 | ], |
1199 | ], |
1196 | ["Weapons", 0, 6, |
1200 | ["Weapons", 0, 6, |
… | |
… | |
1233 | for (@bits) { |
1237 | for (@bits) { |
1234 | ++$y; |
1238 | ++$y; |
1235 | |
1239 | |
1236 | my $mask = $_->[1]; |
1240 | my $mask = $_->[1]; |
1237 | $table->add ($x , $y, new CFClient::UI::Label text => $_->[0], align => 1, expand => 1); |
1241 | $table->add ($x , $y, new CFClient::UI::Label text => $_->[0], align => 1, expand => 1); |
1238 | $table->add ($x+1, $y, new CFClient::UI::CheckBox |
1242 | $table->add ($x+1, $y, my $checkbox = new CFClient::UI::CheckBox |
1239 | state => $::CFG->{pickup} & $mask, |
1243 | state => $::CFG->{pickup} & $mask, |
1240 | on_changed => sub { |
1244 | on_changed => sub { |
1241 | my ($box, $value) = @_; |
1245 | my ($box, $value) = @_; |
1242 | |
1246 | |
1243 | if ($value) { |
1247 | if ($value) { |
… | |
… | |
1249 | $::CONN->send_command ("pickup $::CFG->{pickup}") |
1253 | $::CONN->send_command ("pickup $::CFG->{pickup}") |
1250 | if defined $::CONN; |
1254 | if defined $::CONN; |
1251 | |
1255 | |
1252 | 0 |
1256 | 0 |
1253 | }); |
1257 | }); |
|
|
1258 | |
|
|
1259 | ${$_->[2]} = $checkbox if $_->[2]; |
1254 | } |
1260 | } |
1255 | } |
1261 | } |
1256 | |
1262 | |
1257 | $table->add (2, 18, new CFClient::UI::ValSlider |
1263 | $table->add (2, 18, new CFClient::UI::ValSlider |
1258 | range => [$::CFG->{pickup} & 0xF, 0, 16, 1, 1], |
1264 | range => [$::CFG->{pickup} & 0xF, 0, 16, 1, 1], |
… | |
… | |
1293 | |
1299 | |
1294 | # XXX: Call after $INVR = ... because set_opencont sets the items |
1300 | # XXX: Call after $INVR = ... because set_opencont sets the items |
1295 | CFClient::Protocol::set_opencont ($::CONN, 0, "Floor"); |
1301 | CFClient::Protocol::set_opencont ($::CONN, 0, "Floor"); |
1296 | |
1302 | |
1297 | $hb |
1303 | $hb |
|
|
1304 | } |
|
|
1305 | |
|
|
1306 | sub toggle_player_page { |
|
|
1307 | my ($widget) = @_; |
|
|
1308 | |
|
|
1309 | if ($PL_WINDOW->{visible} && $PL_NOTEBOOK->get_current_page == $widget) { |
|
|
1310 | $PL_WINDOW->hide; |
|
|
1311 | } else { |
|
|
1312 | $PL_NOTEBOOK->set_current_page ($widget); |
|
|
1313 | $PL_WINDOW->show; |
|
|
1314 | } |
1298 | } |
1315 | } |
1299 | |
1316 | |
1300 | sub player_window { |
1317 | sub player_window { |
1301 | my $plwin = $PL_WINDOW = new CFClient::UI::FancyFrame |
1318 | my $plwin = $PL_WINDOW = new CFClient::UI::FancyFrame |
1302 | x => "center", |
1319 | x => "center", |
… | |
… | |
1312 | new CFClient::UI::Notebook |
1329 | new CFClient::UI::Notebook |
1313 | expand => 1, |
1330 | expand => 1, |
1314 | debug => 1, |
1331 | debug => 1, |
1315 | filter => (new CFClient::UI::ScrolledWindow expand => 1, scroll_y => 1), |
1332 | filter => (new CFClient::UI::ScrolledWindow expand => 1, scroll_y => 1), |
1316 | ; |
1333 | ; |
|
|
1334 | |
1317 | $ntb->add ( |
1335 | $ntb->add ( |
|
|
1336 | "Stats & Skills" => $STATS_PAGE = stats_window, |
|
|
1337 | "Shows statistics and skill window, where all your Stats, Resistances and Skills are shown." |
|
|
1338 | ); |
|
|
1339 | $ntb->add ( |
|
|
1340 | Spells => $SPELL_PAGE = new CFClient::UI::SpellList, |
|
|
1341 | "Displays all spells you have and lets you edit keyboard shortcuts for them." |
|
|
1342 | ); |
|
|
1343 | $ntb->add ( |
1318 | Inventory => inventory_widget, |
1344 | Inventory => $INVENTORY_PAGE = inventory_widget, |
1319 | "Toggles the inventory window, where you can manage your loot (or treasures :). " |
1345 | "Toggles the inventory window, where you can manage your loot (or treasures :). " |
1320 | . "You can also hit the <b>Tab</b>-key to show/hide the Inventory." |
1346 | . "You can also hit the <b>Tab</b>-key to show/hide the Inventory." |
1321 | ); |
1347 | ); |
1322 | |
1348 | |
1323 | $ntb->add ( |
|
|
1324 | Stats => $STATS_WINDOW = stats_window, |
|
|
1325 | "Toggles the statistics window, where all your Stats and Resistances are being displayed at all times." |
|
|
1326 | ); |
|
|
1327 | $ntb->add ( |
|
|
1328 | Spells => $SETUP_SPELLS = new CFClient::UI::SpellList, |
|
|
1329 | "Displays all spells you have and lets you edit keyboard shortcuts for them." |
|
|
1330 | ); |
|
|
1331 | |
1349 | |
1332 | $plwin->add ($ntb); |
1350 | $plwin->add ($ntb); |
1333 | $plwin |
1351 | $plwin |
1334 | } |
1352 | } |
1335 | |
1353 | |
… | |
… | |
1652 | status "Configuration Saved"; |
1670 | status "Configuration Saved"; |
1653 | 0 |
1671 | 0 |
1654 | }, |
1672 | }, |
1655 | ); |
1673 | ); |
1656 | |
1674 | |
1657 | $BUTTONBAR->add (new CFClient::UI::Flopper text => "Help!", other => help_window, |
1675 | $BUTTONBAR->add (new CFClient::UI::Flopper text => "Help!", other => $HELP_WINDOW = help_window, |
1658 | tooltip => "View Documentation"); |
1676 | tooltip => "View Documentation"); |
1659 | |
1677 | |
1660 | $BUTTONBAR->add (new CFClient::UI::Button |
1678 | $BUTTONBAR->add (new CFClient::UI::Button |
1661 | text => "Quit", |
1679 | text => "Quit", |
1662 | tooltip => "Terminates the program", |
1680 | tooltip => "Terminates the program", |