--- deliantra/Deliantra-Client/DC.pm 2006/06/05 21:10:03 1.89 +++ deliantra/Deliantra-Client/DC.pm 2006/06/28 09:45:10 1.94 @@ -27,6 +27,7 @@ use AnyEvent (); use BerkeleyDB; use Pod::POM (); +use Scalar::Util (); use Storable (); # finally package CFClient::PodToPango; @@ -53,7 +54,7 @@ sub view_item { ("\t" x ($indent / 4)) . $_[1]->title->present ($_[0]) - . "\n" + . "\n\n" . $_[1]->content->present ($_[0]) } @@ -293,7 +294,7 @@ $w = undef; } ); - $entry->focus_in; + $entry->grab_focus; $w->show; } @@ -301,6 +302,9 @@ sub update_widgets { my ($self) = @_; + # necessary to avoid cyclic references + Scalar::Util::weaken $self; + my $button_cb = sub { my (undef, $ev, $x, $y) = @_; @@ -455,7 +459,8 @@ my $w = new CFClient::UI::FancyFrame title => "Bind Action", x => "center", - y => "center"; + y => "center", + z => 1000; $w->add (my $vb = new CFClient::UI::VBox); $vb->add (new CFClient::UI::Label @@ -486,14 +491,14 @@ return; } - $entry->focus_out; + $entry->grab_focus; $cb->($mod, $sym); $w->destroy }); - $entry->focus_in; + $entry->grab_focus; $w->show; } @@ -509,47 +514,6 @@ 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