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.89 by root, Mon Jun 5 21:10:03 2006 UTC vs.
Revision 1.94 by elmex, Wed Jun 28 09:45:10 2006 UTC

25 25
26use Carp (); 26use Carp ();
27use AnyEvent (); 27use AnyEvent ();
28use BerkeleyDB; 28use BerkeleyDB;
29use Pod::POM (); 29use Pod::POM ();
30use Scalar::Util ();
30use Storable (); # finally 31use Storable (); # finally
31 32
32package CFClient::PodToPango; 33package CFClient::PodToPango;
33 34
34use base Pod::POM::View::Text; 35use base Pod::POM::View::Text;
51} 52}
52 53
53sub view_item { 54sub view_item {
54 ("\t" x ($indent / 4)) 55 ("\t" x ($indent / 4))
55 . $_[1]->title->present ($_[0]) 56 . $_[1]->title->present ($_[0])
56 . "\n" 57 . "\n\n"
57 . $_[1]->content->present ($_[0]) 58 . $_[1]->content->present ($_[0])
58} 59}
59 60
60sub view_verbatim { 61sub view_verbatim {
61 (join "", 62 (join "",
291 $cb->($last_enter_count); 292 $cb->($last_enter_count);
292 $w->hide; 293 $w->hide;
293 $w = undef; 294 $w = undef;
294 } 295 }
295 ); 296 );
296 $entry->focus_in; 297 $entry->grab_focus;
297 $w->show; 298 $w->show;
298 299
299} 300}
300 301
301sub update_widgets { 302sub update_widgets {
302 my ($self) = @_; 303 my ($self) = @_;
304
305 # necessary to avoid cyclic references
306 Scalar::Util::weaken $self;
303 307
304 my $button_cb = sub { 308 my $button_cb = sub {
305 my (undef, $ev, $x, $y) = @_; 309 my (undef, $ev, $x, $y) = @_;
306 310
307 my $targ = $::CONN->{player}{tag}; 311 my $targ = $::CONN->{player}{tag};
453 my ($cb) = @_; 457 my ($cb) = @_;
454 458
455 my $w = new CFClient::UI::FancyFrame 459 my $w = new CFClient::UI::FancyFrame
456 title => "Bind Action", 460 title => "Bind Action",
457 x => "center", 461 x => "center",
458 y => "center"; 462 y => "center",
463 z => 1000;
459 464
460 $w->add (my $vb = new CFClient::UI::VBox); 465 $w->add (my $vb = new CFClient::UI::VBox);
461 $vb->add (new CFClient::UI::Label 466 $vb->add (new CFClient::UI::Label
462 text => "Press a modifier (CTRL, ALT and/or SHIFT) and a key." 467 text => "Press a modifier (CTRL, ALT and/or SHIFT) and a key."
463 ."You can only bind 0-9 and F1-F15 without modifiers." 468 ."You can only bind 0-9 and F1-F15 without modifiers."
484 ." directly without modifier! It would damage the completer handling." 489 ." directly without modifier! It would damage the completer handling."
485 ); 490 );
486 return; 491 return;
487 } 492 }
488 493
489 $entry->focus_out; 494 $entry->grab_focus;
490 495
491 $cb->($mod, $sym); 496 $cb->($mod, $sym);
492 497
493 $w->destroy 498 $w->destroy
494 }); 499 });
495 500
496 $entry->focus_in; 501 $entry->grab_focus;
497 $w->show; 502 $w->show;
498} 503}
499 504
500sub keycombo_to_name { 505sub keycombo_to_name {
501 my ($mod, $sym) = @_; 506 my ($mod, $sym) = @_;
507 $mods .= "+" if $mods ne ''; 512 $mods .= "+" if $mods ne '';
508 513
509 return $mods . CFClient::SDL_GetKeyName ($sym); 514 return $mods . CFClient::SDL_GetKeyName ($sym);
510} 515}
511 516
512package CFClient::Pickup;
513# some pickup constants
514sub PU_NOTHING { 0x00000000 }
515
516sub PU_DEBUG { 0x10000000 }
517sub PU_INHIBIT { 0x20000000 }
518sub PU_STOP { 0x40000000 }
519sub PU_NEWMODE { 0x80000000 }
520
521sub PU_RATIO { 0x0000000F }
522
523sub PU_FOOD { 0x00000010 }
524sub PU_DRINK { 0x00000020 }
525sub PU_VALUABLES { 0x00000040 }
526sub PU_BOW { 0x00000080 }
527
528sub PU_ARROW { 0x00000100 }
529sub PU_HELMET { 0x00000200 }
530sub PU_SHIELD { 0x00000400 }
531sub PU_ARMOUR { 0x00000800 }
532
533sub PU_BOOTS { 0x00001000 }
534sub PU_GLOVES { 0x00002000 }
535sub PU_CLOAK { 0x00004000 }
536sub PU_KEY { 0x00008000 }
537
538sub PU_MISSILEWEAPON { 0x00010000 }
539sub PU_ALLWEAPON { 0x00020000 }
540sub PU_MAGICAL { 0x00040000 }
541sub PU_POTION { 0x00080000 }
542
543sub PU_SPELLBOOK { 0x00100000 }
544sub PU_SKILLSCROLL { 0x00200000 }
545sub PU_READABLES { 0x00400000 }
546sub PU_MAGIC_DEVICE { 0x00800000 }
547
548sub PU_NOT_CURSED { 0x01000000 }
549
550sub PU_JEWELS { 0x02000000 }
551
552
5531; 5171;
554 518
555=back 519=back
556 520
557=head1 AUTHOR 521=head1 AUTHOR

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines