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

Comparing deliantra/Deliantra-Client/DC/Protocol.pm (file contents):
Revision 1.74 by root, Sun Aug 13 18:48:56 2006 UTC vs.
Revision 1.79 by root, Fri Aug 18 01:01:01 2006 UTC

12use base 'Crossfire::Protocol::Base'; 12use base 'Crossfire::Protocol::Base';
13 13
14sub new { 14sub new {
15 my $class = shift; 15 my $class = shift;
16 16
17 my $self = $class->SUPER::new (@_); 17 my $self = $class->SUPER::new (@_, setup_req => { extmap => 1 });
18 18
19 $self->{map_widget}->clr_commands; 19 $self->{map_widget}->clr_commands;
20 20
21 my @cmd_help = map { 21 my @cmd_help = map {
22 $_->{kw}[0] =~ /^(\S+) (?:\s+ \( ([^\)]*) \) )?/x 22 $_->{kw}[0] =~ /^(\S+) (?:\s+ \( ([^\)]*) \) )?/x
34 34
35 map ["$cmd$_", $text], 35 map ["$cmd$_", $text],
36 sort { (length $a) <=> (length $b) } 36 sort { (length $a) <=> (length $b) }
37 @args 37 @args
38 } sort { $a->{par} <=> $b->{par} } 38 } sort { $a->{par} <=> $b->{par} }
39 CFPlus::Pod::find command_help => "*"; 39 CFPlus::Pod::find command => "*";
40 40
41 $self->{map_widget}->add_command (@$_) 41 $self->{map_widget}->add_command (@$_)
42 for @cmd_help; 42 for @cmd_help;
43 43
44 $self->{noface} = new_from_file CFPlus::Texture 44 $self->{noface} = new_from_file CFPlus::Texture
45 CFPlus::find_rcfile "noface.png", minify => 1, mipmap => 1; 45 CFPlus::find_rcfile "noface.png", minify => 1, mipmap => 1;
46 46
47 $self->{open_container} = 0; 47 $self->{open_container} = 0;
48 48
49 # "global" 49 # "global"
50 $self->{tilecache} = CFPlus::db_table "tilecache"; 50 $self->{tilecache} = CFPlus::db_table "tilecache"
51 or die "tilecache: unable to open database table";
51 $self->{facemap} = CFPlus::db_table "facemap"; 52 $self->{facemap} = CFPlus::db_table "facemap"
53 or die "facemap: unable to open database table";
52 54
53 # per server 55 # per server
54 $self->{mapcache} = CFPlus::db_table "mapcache_$self->{host}_$self->{port}"; 56 $self->{mapcache} = CFPlus::db_table "mapcache_$self->{host}_$self->{port}"
57 or die "mapcache_$self->{host}_$self->{port}: unable to open database table";
55 58
56 $self 59 $self
57} 60}
58 61
59sub logprint { 62sub logprint {
339} 342}
340 343
341sub feed_map1a { 344sub feed_map1a {
342 my ($self, $data) = @_; 345 my ($self, $data) = @_;
343 346
344 $self->{map}->map1a_update ($data); 347 $self->{map}->map1a_update ($data, $self->{setup}{extmap});
345 $self->{map_widget}->update; 348 $self->{map_widget}->update;
346} 349}
347 350
348sub magicmap { 351sub magicmap {
349 my ($self, $w, $h, $x, $y, $data) = @_; 352 my ($self, $w, $h, $x, $y, $data) = @_;
922} 925}
923 926
924sub destroy { 927sub destroy {
925 my ($self) = @_; 928 my ($self) = @_;
926 929
927 $self->{npc_dialog}->destroy 930 (delete $self->{npc_dialog})->destroy
928 if $self->{npc_dialog}; 931 if $self->{npc_dialog};
929 932
930 $self->SUPER::destroy; 933 $self->SUPER::destroy;
931} 934}
932 935
933package CFPlus::NPCDialog; 936package CFPlus::NPCDialog;
934 937
935our @ISA = 'CFPlus::UI::FancyFrame'; 938our @ISA = 'CFPlus::UI::Toplevel';
936 939
937sub new { 940sub new {
938 my $class = shift; 941 my $class = shift;
939 942
940 my $self = $class->SUPER::new ( 943 my $self = $class->SUPER::new (
1044 padding_y => 0, 1047 padding_y => 0,
1045 on_button_up => sub { 1048 on_button_up => sub {
1046 $self->send ($kw); 1049 $self->send ($kw);
1047 }; 1050 };
1048 1051
1049 chr 0xfffc 1052 "\x{fffc}"
1050 }giex; 1053 }giex;
1051 1054
1052 $self->{textview}->add_paragraph ({ markup => $text, widget => \@link }); 1055 $self->{textview}->add_paragraph ({ markup => $text, widget => \@link });
1053 $self->{textview}->scroll_to_bottom; 1056 $self->{textview}->scroll_to_bottom;
1054 $self->update_options; 1057 $self->update_options;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines