… | |
… | |
68 | } |
68 | } |
69 | |
69 | |
70 | close CFG; |
70 | close CFG; |
71 | } |
71 | } |
72 | |
72 | |
73 | mkdir "$Crossfire::VARDIR/pclient", 0777; |
73 | mkdir "$Crossfire::VARDIR/cfplus", 0777; |
74 | |
74 | |
75 | our $DB_ENV = new BerkeleyDB::Env |
75 | our $DB_ENV = new BerkeleyDB::Env |
76 | -Home => "$Crossfire::VARDIR/pclient", |
76 | -Home => "$Crossfire::VARDIR/cfplus", |
77 | -Cachesize => 1_000_000, |
77 | -Cachesize => 1_000_000, |
78 | -ErrFile => "$Crossfire::VARDIR/pclient/errorlog.txt", |
78 | -ErrFile => "$Crossfire::VARDIR/cfplus/errorlog.txt", |
79 | # -ErrPrefix => "DATABASE", |
79 | # -ErrPrefix => "DATABASE", |
80 | -Verbose => 1, |
80 | -Verbose => 1, |
81 | -Flags => DB_CREATE | DB_RECOVER | DB_INIT_MPOOL | DB_INIT_LOCK | DB_INIT_TXN, |
81 | -Flags => DB_CREATE | DB_RECOVER | DB_INIT_MPOOL | DB_INIT_LOCK | DB_INIT_TXN, |
82 | or die "unable to create/open database home $Crossfire::VARDIR/pclient: $BerkeleyDB::Error"; |
82 | or die "unable to create/open database home $Crossfire::VARDIR/cfplus: $BerkeleyDB::Error"; |
83 | |
83 | |
84 | sub db_table($) { |
84 | sub db_table($) { |
85 | my ($table) = @_; |
85 | my ($table) = @_; |
86 | |
86 | |
87 | $table =~ s/([^a-zA-Z0-9_\-])/sprintf "=%x=", ord $1/ge; |
87 | $table =~ s/([^a-zA-Z0-9_\-])/sprintf "=%x=", ord $1/ge; |
… | |
… | |
413 | } |
413 | } |
414 | |
414 | |
415 | $entry->focus_out; |
415 | $entry->focus_out; |
416 | |
416 | |
417 | $::CFG->{bindings}->{$mod}->{$sym} = $cmd; |
417 | $::CFG->{bindings}->{$mod}->{$sym} = $cmd; |
418 | $::STATUSBOX->add ("Bound actions to '".keycombo_to_name ($mod, $sym)."'. Don't forget Save Layout!"); |
418 | $::STATUSBOX->add ("Bound actions to '".keycombo_to_name ($mod, $sym)."'. Don't forget 'Save Config'!"); |
419 | |
419 | |
420 | $w->destroy |
420 | $w->destroy |
421 | }); |
421 | }); |
422 | |
422 | |
423 | $entry->focus_in; |
423 | $entry->focus_in; |
… | |
… | |
454 | for (@$list) { |
454 | for (@$list) { |
455 | $CMDBOX->add (my $hb = new CFClient::UI::HBox); |
455 | $CMDBOX->add (my $hb = new CFClient::UI::HBox); |
456 | |
456 | |
457 | my $i = $idx; |
457 | my $i = $idx; |
458 | $hb->add (new CFClient::UI::Button |
458 | $hb->add (new CFClient::UI::Button |
459 | text => "del", |
459 | text => "delete", |
460 | tooltip => "Deletes the action from the record", |
460 | tooltip => "Deletes the action from the record", |
461 | on_activate => sub { |
461 | on_activate => sub { |
462 | $CMDBOX->remove ($hb); |
462 | $CMDBOX->remove ($hb); |
463 | $list->[$i] = undef; |
463 | $list->[$i] = undef; |
464 | }); |
464 | }); |
… | |
… | |
507 | |
507 | |
508 | $RECORD_WINDOW->add (my $vb = new CFClient::UI::VBox); |
508 | $RECORD_WINDOW->add (my $vb = new CFClient::UI::VBox); |
509 | $vb->add ($REC_BTN = new CFClient::UI::Button |
509 | $vb->add ($REC_BTN = new CFClient::UI::Button |
510 | text => "start recording", |
510 | text => "start recording", |
511 | tooltip => "Start/Stops recording of actions." |
511 | tooltip => "Start/Stops recording of actions." |
512 | ."(CTRL+INS Starts the recorder, INS Stops recorder and binds automatically)" |
512 | ."(CTRL+Insert Starts the recorder, Insert Stops recorder and binds automatically)" |
513 | ."All subsequent actions after the recording started will be captured." |
513 | ."All subsequent actions after the recording started will be captured." |
514 | ."The actions are displayed after the record was stopped." |
514 | ."The actions are displayed after the record was stopped." |
515 | ."To bind the action you have to click on the 'Bind' button", |
515 | ."To bind the action you have to click on the 'Bind' button", |
516 | on_activate => sub { |
516 | on_activate => sub { |
517 | my ($btn) = @_; |
517 | my ($btn) = @_; |