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

Comparing deliantra/Deliantra-Client/DC.pm (file contents):
Revision 1.76 by root, Mon May 29 21:20:15 2006 UTC vs.
Revision 1.80 by elmex, Tue May 30 08:12:50 2006 UTC

70 close CFG; 70 close CFG;
71} 71}
72 72
73mkdir "$Crossfire::VARDIR/cfplus", 0777; 73mkdir "$Crossfire::VARDIR/cfplus", 0777;
74 74
75our $DB_ENV;
76
75{ 77{
76 use strict; 78 use strict;
77 79
80 my $recover = $BerkeleyDB::db_version >= 4.4
81 ? eval "DB_REGISTER | DB_RECOVER"
82 : 0;
83
78 our $DB_ENV = new BerkeleyDB::Env 84 $DB_ENV = new BerkeleyDB::Env
79 -Home => "$Crossfire::VARDIR/cfplus", 85 -Home => "$Crossfire::VARDIR/cfplus",
80 -Cachesize => 1_000_000, 86 -Cachesize => 1_000_000,
81 -ErrFile => "$Crossfire::VARDIR/cfplus/errorlog.txt", 87 -ErrFile => "$Crossfire::VARDIR/cfplus/errorlog.txt",
82# -ErrPrefix => "DATABASE", 88# -ErrPrefix => "DATABASE",
83 -Verbose => 1, 89 -Verbose => 1,
84 -Flags => DB_CREATE | DB_RECOVER | DB_INIT_MPOOL | DB_INIT_LOCK | DB_INIT_TXN, 90 -Flags => DB_CREATE | DB_RECOVER | DB_INIT_MPOOL | DB_INIT_LOCK | DB_INIT_TXN | $recover,
85 -SetFlags => DB_AUTO_COMMIT | DB_LOG_AUTOREMOVE | DB_TXN_WRITE_NOSYNC, 91 -SetFlags => DB_AUTO_COMMIT | DB_LOG_AUTOREMOVE,
86 or die "unable to create/open database home $Crossfire::VARDIR/cfplus: $BerkeleyDB::Error"; 92 or die "unable to create/open database home $Crossfire::VARDIR/cfplus: $BerkeleyDB::Error";
87} 93}
88 94
89sub db_table($) { 95sub db_table($) {
90 my ($table) = @_; 96 my ($table) = @_;
245 251
246 if ($self->{container} == $::CONN->{player}{tag}) { 252 if ($self->{container} == $::CONN->{player}{tag}) {
247 $targ = $::CONN->{open_container}; 253 $targ = $::CONN->{open_container};
248 } 254 }
249 255
250 $::CONN->send ("move $targ $self->{tag} 0"); 256 $::CONN->send ("move $targ $self->{tag} 0")
257 if $targ || !($self->{flags} & F_LOCKED);
251 } elsif ($ev->{button} == 1) { 258 } elsif ($ev->{button} == 1) {
252 $::CONN->send ("examine $self->{tag}"); 259 $::CONN->send ("examine $self->{tag}");
253 } elsif ($ev->{button} == 2) { 260 } elsif ($ev->{button} == 2) {
254 $::CONN->send ("apply $self->{tag}"); 261 $::CONN->send ("apply $self->{tag}");
255 } elsif ($ev->{button} == 3) { 262 } elsif ($ev->{button} == 3) {
384# (Bindings are stored in $::CFG->{bindings}->{$mod}->{$sym}) 391# (Bindings are stored in $::CFG->{bindings}->{$mod}->{$sym})
385sub open_binding_dialog { 392sub open_binding_dialog {
386 my ($cmd) = @_; 393 my ($cmd) = @_;
387 394
388 my $w = new CFClient::UI::FancyFrame 395 my $w = new CFClient::UI::FancyFrame
389 title => "Bind Action"; 396 title => "Bind Action",
397 x => "center",
398 y => "center";
390 399
391 $w->add (my $vb = new CFClient::UI::VBox); 400 $w->add (my $vb = new CFClient::UI::VBox);
392 $vb->add (new CFClient::UI::Label 401 $vb->add (new CFClient::UI::Label
393 text => "Press a modifier (CTRL, ALT and/or SHIFT) and a key." 402 text => "Press a modifier (CTRL, ALT and/or SHIFT) and a key."
394 ."You can only bind 0-9 and F1-F15 without modifiers." 403 ."You can only bind 0-9 and F1-F15 without modifiers."
424 433
425 $w->destroy 434 $w->destroy
426 }); 435 });
427 436
428 $entry->focus_in; 437 $entry->focus_in;
429 $w->center;
430 $w->show; 438 $w->show;
431} 439}
432 440
433sub keycombo_to_name { 441sub keycombo_to_name {
434 my ($mod, $sym) = @_; 442 my ($mod, $sym) = @_;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines