ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/bin/cfplus
(Generate patch)

Comparing deliantra/Deliantra-Client/bin/cfplus (file contents):
Revision 1.75 by root, Sun Jun 18 17:23:36 2006 UTC vs.
Revision 1.78 by root, Fri Jun 23 20:28:20 2006 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines