--- deliantra/Deliantra-Client/DC.pm 2006/06/01 05:04:34 1.85 +++ deliantra/Deliantra-Client/DC.pm 2006/06/05 05:31:13 1.88 @@ -26,6 +26,7 @@ use Carp (); use AnyEvent (); use BerkeleyDB; +use Pod::POM; sub find_rcfile($) { my $path; @@ -70,13 +71,27 @@ close CFG; } -mkdir "$Crossfire::VARDIR/cfplus", 0777; +my %POD_CACHE; + +sub load_pod($) { + $POD_CACHE{$_[0]} ||= do { + my $pod = do { + local $/; + open my $pod, "<:utf8", $_[0] + or die "$_[0]: $!"; + <$pod> + }; + + Pod::POM->new->parse_text ($pod) + } +} our $DB_ENV; { use strict; + mkdir "$Crossfire::VARDIR/cfplus", 0777; my $recover = $BerkeleyDB::db_version >= 4.4 ? eval "DB_REGISTER | DB_RECOVER" : 0; @@ -278,6 +293,10 @@ if (($ev->{mod} & CFClient::KMOD_SHIFT) && $ev->{button} == 1) { $::CONN->send ("move $targ $self->{tag} 0") if $targ || !($self->{flags} & F_LOCKED); + } elsif (($ev->{mod} & CFClient::KMOD_SHIFT) && $ev->{button} == 2) { + $self->{flags} & F_LOCKED + ? $::CONN->send ("lock " . pack "CN", 0, $self->{tag}) + : $::CONN->send ("lock " . pack "CN", 1, $self->{tag}) } elsif ($ev->{button} == 1) { $::CONN->send ("examine $self->{tag}"); } elsif ($ev->{button} == 2) { @@ -314,6 +333,7 @@ . "Left click - examine item\n" . "Shift-Left click - " . ($self->{container} ? "move or drop" : "take") . " item\n" . "Middle click - apply\n" + . "Shift-Middle click - lock/unlock\n" . "Right click - further options" . "\n"; @@ -469,6 +489,47 @@ return $mods . CFClient::SDL_GetKeyName ($sym); } +package CFClient::Pickup; +# some pickup constants +sub PU_NOTHING { 0x00000000 } + +sub PU_DEBUG { 0x10000000 } +sub PU_INHIBIT { 0x20000000 } +sub PU_STOP { 0x40000000 } +sub PU_NEWMODE { 0x80000000 } + +sub PU_RATIO { 0x0000000F } + +sub PU_FOOD { 0x00000010 } +sub PU_DRINK { 0x00000020 } +sub PU_VALUABLES { 0x00000040 } +sub PU_BOW { 0x00000080 } + +sub PU_ARROW { 0x00000100 } +sub PU_HELMET { 0x00000200 } +sub PU_SHIELD { 0x00000400 } +sub PU_ARMOUR { 0x00000800 } + +sub PU_BOOTS { 0x00001000 } +sub PU_GLOVES { 0x00002000 } +sub PU_CLOAK { 0x00004000 } +sub PU_KEY { 0x00008000 } + +sub PU_MISSILEWEAPON { 0x00010000 } +sub PU_ALLWEAPON { 0x00020000 } +sub PU_MAGICAL { 0x00040000 } +sub PU_POTION { 0x00080000 } + +sub PU_SPELLBOOK { 0x00100000 } +sub PU_SKILLSCROLL { 0x00200000 } +sub PU_READABLES { 0x00400000 } +sub PU_MAGIC_DEVICE { 0x00800000 } + +sub PU_NOT_CURSED { 0x01000000 } + +sub PU_JEWELS { 0x02000000 } + + 1; =back