… | |
… | |
115 | our $INV; |
115 | our $INV; |
116 | our $INVR; |
116 | our $INVR; |
117 | our $INV_RIGHT_HB; |
117 | our $INV_RIGHT_HB; |
118 | |
118 | |
119 | our $BIND_EDITOR; |
119 | our $BIND_EDITOR; |
|
|
120 | our $BIND_UPD_CB; |
120 | |
121 | |
121 | our $PICKUP_CFG; |
122 | our $PICKUP_CFG; |
122 | |
123 | |
123 | sub status { |
124 | sub status { |
124 | $STATUSBOX->add (CFClient::UI::Label::escape $_[0], pri => -10, group => "status", timeout => 10, fg => [1, 1, 0, 1]); |
125 | $STATUSBOX->add (CFClient::UI::Label::escape $_[0], pri => -10, group => "status", timeout => 10, fg => [1, 1, 0, 1]); |
… | |
… | |
748 | ); |
749 | ); |
749 | $tbl2->add ($col + 1, $row, new CFClient::UI::Image |
750 | $tbl2->add ($col + 1, $row, new CFClient::UI::Image |
750 | font => $FONT_FIXED, |
751 | font => $FONT_FIXED, |
751 | can_hover => 1, |
752 | can_hover => 1, |
752 | can_events => 1, |
753 | can_events => 1, |
753 | image => "ui/resist/resist_$_.png", |
754 | path => "ui/resist/resist_$_.png", |
754 | tooltip => $resist_names{$_}, |
755 | tooltip => $resist_names{$_}, |
755 | ); |
756 | ); |
756 | |
757 | |
757 | $row++; |
758 | $row++; |
758 | if ($row % 6 == 0) { |
759 | if ($row % 6 == 0) { |
… | |
… | |
1301 | |
1302 | |
1302 | sub spell_setup { |
1303 | sub spell_setup { |
1303 | new CFClient::UI::SpellList |
1304 | new CFClient::UI::SpellList |
1304 | } |
1305 | } |
1305 | |
1306 | |
|
|
1307 | sub update_bindings { |
|
|
1308 | $BIND_UPD_CB->() if $BIND_UPD_CB; |
|
|
1309 | } |
|
|
1310 | |
1306 | sub keyboard_setup { |
1311 | sub keyboard_setup { |
1307 | my $binding_list = new CFClient::UI::VBox; |
1312 | my $binding_list = new CFClient::UI::VBox; |
1308 | |
1313 | |
1309 | my $refresh; |
1314 | my $refresh; |
1310 | $refresh = sub { |
1315 | $refresh = $BIND_UPD_CB = sub { |
1311 | $binding_list->clear (); |
1316 | $binding_list->clear (); |
1312 | |
1317 | |
1313 | for my $mod (keys %{$::CFG->{profile}{default}{bindings}}) { |
1318 | for my $mod (keys %{$::CFG->{profile}{default}{bindings}}) { |
1314 | for my $sym (keys %{$::CFG->{profile}{default}{bindings}{$mod}}) { |
1319 | for my $sym (keys %{$::CFG->{profile}{default}{bindings}{$mod}}) { |
1315 | my $cmds = $::CFG->{profile}{default}{bindings}{$mod}{$sym}; |
1320 | my $cmds = $::CFG->{profile}{default}{bindings}{$mod}{$sym}; |
… | |
… | |
1333 | on_activate => sub { |
1338 | on_activate => sub { |
1334 | $::BIND_EDITOR->set_binding ( |
1339 | $::BIND_EDITOR->set_binding ( |
1335 | $mod, $sym, $::CFG->{profile}{default}{bindings}{$mod}{$sym}, |
1340 | $mod, $sym, $::CFG->{profile}{default}{bindings}{$mod}{$sym}, |
1336 | sub { |
1341 | sub { |
1337 | my ($nmod, $nsym, $ncmds) = @_; |
1342 | my ($nmod, $nsym, $ncmds) = @_; |
1338 | delete $::CFG->{profile}{default}{bindings}{$mod}{$sym}; |
1343 | $::BIND_EDITOR->cfg_unbind ($mod, $sym); |
1339 | $::CFG->{profile}{default}{bindings}{$nmod}{$nsym} = $ncmds; |
1344 | $::BIND_EDITOR->cfg_bind ($nmod, $nsym, $ncmds); |
1340 | $refresh->(); |
1345 | $refresh->(); |
1341 | $SETUP_NOTEBOOK->set_current_page ($SETUP_KEYBOARD); |
1346 | $SETUP_NOTEBOOK->set_current_page ($SETUP_KEYBOARD); |
1342 | $SETUP_DIALOG->show; |
1347 | $SETUP_DIALOG->show; |
1343 | }, |
1348 | }, |
1344 | sub { |
1349 | sub { |
… | |
… | |
1378 | tooltip => "This button opens the binding editor with an empty binding.", |
1383 | tooltip => "This button opens the binding editor with an empty binding.", |
1379 | on_activate => sub { |
1384 | on_activate => sub { |
1380 | $::BIND_EDITOR->set_binding (undef, undef, [], |
1385 | $::BIND_EDITOR->set_binding (undef, undef, [], |
1381 | sub { |
1386 | sub { |
1382 | my ($mod, $sym, $cmds) = @_; |
1387 | my ($mod, $sym, $cmds) = @_; |
1383 | $::CFG->{profile}{default}{bindings}{$mod}{$sym} = $cmds; |
1388 | $::BIND_EDITOR->cfg_bind ($mod, $sym, $cmds); |
1384 | $refresh->(); |
1389 | $refresh->(); |
1385 | $SETUP_NOTEBOOK->set_current_page ($SETUP_KEYBOARD); |
1390 | $SETUP_NOTEBOOK->set_current_page ($SETUP_KEYBOARD); |
1386 | $SETUP_DIALOG->show; |
1391 | $SETUP_DIALOG->show; |
1387 | }, |
1392 | }, |
1388 | sub { |
1393 | sub { |
… | |
… | |
1430 | $buttons->add (new CFClient::UI::Label text => "Choose a document to display: "); |
1435 | $buttons->add (new CFClient::UI::Label text => "Choose a document to display: "); |
1431 | $buttons->add (my $combo = new CFClient::UI::Combobox |
1436 | $buttons->add (my $combo = new CFClient::UI::Combobox |
1432 | value => undef, |
1437 | value => undef, |
1433 | options => [ |
1438 | options => [ |
1434 | [intro => "Introduction"], |
1439 | [intro => "Introduction"], |
1435 | [manual => "Manual"], |
1440 | [manual => "Main Manual"], |
1436 | [skill_help => "Skills"], |
1441 | [skill_help => "Skill Reference"], |
1437 | [command_help => "Commands"], |
1442 | [command_help => "Command Reference"], |
1438 | [dmcommand_help => "DM Commands"], |
1443 | [dmcommand_help => "DM Commands"], |
1439 | [COPYING => "License Terms"], |
1444 | [COPYING => "License Terms"], |
1440 | ], |
1445 | ], |
1441 | on_changed => sub { |
1446 | on_changed => sub { |
1442 | my ($self, $pod) = @_; |
1447 | my ($self, $pod) = @_; |
1443 | |
1448 | |
1444 | my $pom = CFClient::load_pod CFClient::find_rcfile "pod/$pod.pod", |
1449 | my $pom = CFClient::load_pod CFClient::find_rcfile "pod/$pod.pod", |
1445 | doc_viewer => 1, sub { CFClient::pod_to_pango_list $_[0] }; |
1450 | doc_viewer => 1, sub { CFClient::pod_to_pango_list $_[0] }; |
1446 | |
1451 | |
1447 | $viewer->clear; |
1452 | $viewer->clear; |
|
|
1453 | |
|
|
1454 | # $viewer->add_paragraph ([1, 1, 1, 1], ["<big>Test</big>\n\n \x{fffc} \x{fffc}\n", |
|
|
1455 | # (new CFClient::UI::Image path => "x.png", can_hover => 1, can_events => 1), |
|
|
1456 | # (new CFClient::UI::Label text => "üüüü", can_hover => 1, can_events => 1, tooltip => "??"), |
|
|
1457 | # ]);#d# |
1448 | |
1458 | |
1449 | $viewer->add_paragraph ([1, 1, 1, 1], $_->[1], $_->[0]) |
1459 | $viewer->add_paragraph ([1, 1, 1, 1], $_->[1], $_->[0]) |
1450 | for @$pom; |
1460 | for @$pom; |
1451 | |
1461 | |
1452 | $viewer->set_offset (0); |
1462 | $viewer->set_offset (0); |
|
|
1463 | |
1453 | 0 |
1464 | 0 |
1454 | }, |
1465 | }, |
1455 | on_visibility_change => sub { |
1466 | on_visibility_change => sub { |
1456 | my ($self, $visible) = @_; |
1467 | my ($self, $visible) = @_; |
1457 | return unless $visible; |
1468 | return unless $visible; |