… | |
… | |
11 | use DC::Pod; |
11 | use DC::Pod; |
12 | use DC::Macro; |
12 | use DC::Macro; |
13 | use DC::Item; |
13 | use DC::Item; |
14 | |
14 | |
15 | use base 'Deliantra::Protocol::Base'; |
15 | use base 'Deliantra::Protocol::Base'; |
|
|
16 | |
|
|
17 | our $TEX_DIALOGUE = new_from_resource DC::Texture |
|
|
18 | "dialogue.png", minify => 1, mipmap => 1; |
|
|
19 | |
|
|
20 | our $TEX_NOFACE = new_from_resource DC::Texture |
|
|
21 | "noface.png", minify => 1, mipmap => 1; |
16 | |
22 | |
17 | sub new { |
23 | sub new { |
18 | my ($class, %arg) = @_; |
24 | my ($class, %arg) = @_; |
19 | |
25 | |
20 | my $self = $class->SUPER::new (%arg, |
26 | my $self = $class->SUPER::new (%arg, |
… | |
… | |
27 | ); |
33 | ); |
28 | |
34 | |
29 | $self->{map_widget}->clr_commands; |
35 | $self->{map_widget}->clr_commands; |
30 | |
36 | |
31 | my @cmd_help = map { |
37 | my @cmd_help = map { |
32 | $_->{kw}[0] =~ /^(\S+) (?:\s+ \( ([^\)]*) \) )?/x |
38 | $_->[DC::Pod::N_KW][0] =~ /^(\S+) (?:\s+ \( ([^\)]*) \) )?/x |
33 | or die "unparseable command help: $_->{kw}[0]"; |
39 | or die "unparseable command help: $_->[DC::Pod::N_KW][0]"; |
34 | |
40 | |
35 | my $cmd = $1; |
41 | my $cmd = $1; |
36 | my @args = split /\|/, $2; |
42 | my @args = split /\|/, $2; |
37 | @args = (".*") unless @args; |
43 | @args = (".*") unless @args; |
38 | |
44 | |
… | |
… | |
43 | for @args; |
49 | for @args; |
44 | |
50 | |
45 | map ["$cmd$_", $text], |
51 | map ["$cmd$_", $text], |
46 | sort { (length $a) <=> (length $b) } |
52 | sort { (length $a) <=> (length $b) } |
47 | @args |
53 | @args |
48 | } sort { $a->{par} <=> $b->{par} } |
54 | } sort { $a->[DC::Pod::N_PAR] <=> $b->[DC::Pod::N_PAR] } |
49 | DC::Pod::find command => "*"; |
55 | DC::Pod::find command => "*"; |
50 | |
56 | |
51 | $self->{json_coder} |
57 | $self->{json_coder} |
52 | ->convert_blessed |
58 | ->convert_blessed |
53 | ->filter_json_single_key_object ("\fw" => sub { |
59 | ->filter_json_single_key_object ("\fw" => sub { |
… | |
… | |
64 | $self->{on_stop_game_guard} = $self->{map_widget}{root}->connect (stop_game => sub { |
70 | $self->{on_stop_game_guard} = $self->{map_widget}{root}->connect (stop_game => sub { |
65 | for my $ws (values %{delete $self->{widgetset} || {}}) { |
71 | for my $ws (values %{delete $self->{widgetset} || {}}) { |
66 | $_->destroy |
72 | $_->destroy |
67 | for values %{delete $ws->{w} || {}}; |
73 | for values %{delete $ws->{w} || {}}; |
68 | } |
74 | } |
|
|
75 | |
|
|
76 | delete $self->{items}; |
|
|
77 | $::INV->clear; |
|
|
78 | $::INVR_HB->clear; |
|
|
79 | $::FLOORBOX->clear; |
69 | }); |
80 | }); |
70 | |
81 | |
71 | $self->{map_widget}->add_command (@$_) |
82 | $self->{map_widget}->add_command (@$_) |
72 | for @cmd_help; |
83 | for @cmd_help; |
73 | |
84 | |
74 | { |
85 | { |
75 | $self->{dialogue} = my $tex = new_from_file DC::Texture |
86 | $self->{dialogue} = my $tex = $TEX_DIALOGUE; |
76 | DC::find_rcfile "dialogue.png", minify => 1, mipmap => 1; |
|
|
77 | $self->{map}->set_texture (1, @$tex{qw(name w h s t)}, @{$tex->{minified}}); |
87 | $self->{map}->set_texture (1, @$tex{qw(name w h s t)}, @{$tex->{minified}}); |
78 | } |
88 | } |
79 | |
89 | |
80 | { |
90 | { |
81 | $self->{noface} = my $tex = new_from_file DC::Texture |
91 | $self->{noface} = my $tex = $TEX_NOFACE; |
82 | DC::find_rcfile "noface.png", minify => 1, mipmap => 1; |
|
|
83 | $self->{map}->set_texture (2, @$tex{qw(name w h s t)}, @{$tex->{minified}}); |
92 | $self->{map}->set_texture (2, @$tex{qw(name w h s t)}, @{$tex->{minified}}); |
84 | } |
93 | } |
85 | |
94 | |
86 | $self->{open_container} = 0; |
95 | $self->{open_container} = 0; |
87 | |
96 | |
… | |
… | |
275 | spell_list => $::SPELL_LIST, |
284 | spell_list => $::SPELL_LIST, |
276 | |
285 | |
277 | floorbox => $::FLOORBOX, |
286 | floorbox => $::FLOORBOX, |
278 | help_window => $::HELP_WINDOW, |
287 | help_window => $::HELP_WINDOW, |
279 | message_window => $::MESSAGE_WINDOW, |
288 | message_window => $::MESSAGE_WINDOW, |
|
|
289 | message_dist => $::MESSAGE_DIST, |
280 | statusbox => $::SDTATUSBOX, |
290 | statusbox => $::SDTATUSBOX, |
281 | |
291 | |
282 | inv => $::INV, |
292 | inv => $::INV, |
283 | invr => $::INVR, |
293 | invr => $::INVR, |
284 | invr_hb => $::INVR_HB, |
294 | invr_hb => $::INVR_HB, |
… | |
… | |
333 | |
343 | |
334 | # message window |
344 | # message window |
335 | sub ext_channel_info { |
345 | sub ext_channel_info { |
336 | my ($self, $info) = @_; |
346 | my ($self, $info) = @_; |
337 | $self->{channels}->{$info->{id}} = $info; |
347 | $self->{channels}->{$info->{id}} = $info; |
338 | $::MESSAGE_WINDOW->add_channel ($info); |
348 | $::MESSAGE_DIST->add_channel ($info); |
339 | } |
349 | } |
340 | |
350 | |
341 | ############################################################################# |
351 | ############################################################################# |
342 | |
352 | |
343 | sub logprint { |
353 | sub logprint { |
… | |
… | |
525 | $sktbl->clear; |
535 | $sktbl->clear; |
526 | |
536 | |
527 | my $sw = $self->{skillwid}{""} ||= [ |
537 | my $sw = $self->{skillwid}{""} ||= [ |
528 | 0, 0, (new DC::UI::Label text => "Experience", align => 1), |
538 | 0, 0, (new DC::UI::Label text => "Experience", align => 1), |
529 | 1, 0, (new DC::UI::Label text => "Lvl.", align => 1), |
539 | 1, 0, (new DC::UI::Label text => "Lvl.", align => 1), |
530 | 2, 0, (new DC::UI::Label text => "Progress", align => 0), |
540 | 2, 0, (new DC::UI::Label text => "Progress"), |
531 | 3, 0, (new DC::UI::Label text => "Skill", expand => 1), |
541 | 3, 0, (new DC::UI::Label text => "Skill", expand => 1, align => 0), |
532 | 4, 0, (new DC::UI::Label text => "Experience", align => 1), |
542 | 4, 0, (new DC::UI::Label text => "Experience", align => 1), |
533 | 5, 0, (new DC::UI::Label text => "Lvl.", align => 1), |
543 | 5, 0, (new DC::UI::Label text => "Lvl.", align => 1), |
534 | 6, 0, (new DC::UI::Label text => "Progress", align => 0), |
544 | 6, 0, (new DC::UI::Label text => "Progress"), |
535 | 7, 0, (new DC::UI::Label text => "Skill", expand => 1), |
545 | 7, 0, (new DC::UI::Label text => "Skill", expand => 1, align => 0), |
536 | ]; |
546 | ]; |
537 | |
547 | |
538 | my @add = @$sw; |
548 | my @add = @$sw; |
539 | |
549 | |
540 | my $TOOLTIP_ALL = "\n\n<small>Left click - ready skill\nMiddle click - use spell\nRight click - further options</small>"; |
550 | my $TOOLTIP_ALL = "\n\n<small>Left click - ready skill\nMiddle click - use spell\nRight click - further options</small>"; |
… | |
… | |
579 | |
589 | |
580 | # progress |
590 | # progress |
581 | (new DC::UI::ExperienceProgress), |
591 | (new DC::UI::ExperienceProgress), |
582 | |
592 | |
583 | # label |
593 | # label |
584 | (new DC::UI::Label text => $name, on_button_down => $spell_cb, |
594 | (new DC::UI::Label text => $name, on_button_down => $spell_cb, align => 0, |
585 | can_events => 1, can_hover => 1, tooltip => (DC::Pod::section_label skill_description => $name) . $TOOLTIP_ALL), |
595 | can_events => 1, can_hover => 1, tooltip => (DC::Pod::section_label skill_description => $name) . $TOOLTIP_ALL), |
586 | ]; |
596 | ]; |
587 | |
597 | |
588 | push @add, |
598 | push @add, |
589 | $x * 4 + 0, $y, $sw->[0], |
599 | $x * 4 + 0, $y, $sw->[0], |
… | |
… | |
631 | } |
641 | } |
632 | |
642 | |
633 | sub map_scroll { |
643 | sub map_scroll { |
634 | my ($self, $dx, $dy) = @_; |
644 | my ($self, $dx, $dy) = @_; |
635 | |
645 | |
636 | $self->{map}->scroll ($dx, $dy); |
646 | $self->{map_widget}->scroll ($dx, $dy); |
637 | } |
647 | } |
638 | |
648 | |
639 | sub feed_map1a { |
649 | sub feed_map1a { |
640 | my ($self, $data) = @_; |
650 | my ($self, $data) = @_; |
641 | |
651 | |
… | |
… | |
678 | } |
688 | } |
679 | |
689 | |
680 | sub flush_map { |
690 | sub flush_map { |
681 | my ($self) = @_; |
691 | my ($self) = @_; |
682 | |
692 | |
683 | my $map_info = delete $self->{map_info} |
693 | return unless $self->{map_info}; |
684 | or return; |
|
|
685 | |
694 | |
|
|
695 | for my $map_info (values %{ $self->{map_cache} || {} }) { |
686 | my ($hash, $x, $y, $w, $h) = @$map_info; |
696 | my ($hash, $rdata, $x, $y, $w, $h) = @$map_info; |
687 | |
697 | |
688 | my $data = Compress::LZF::compress $self->{map}->get_rect ($x, $y, $w, $h); |
698 | my $data = $self->{map}->get_rect ($x, $y, $w, $h); |
689 | $self->{map_cache_new}{$hash} = \$data; |
699 | |
|
|
700 | if ($data ne $$rdata) { |
|
|
701 | $map_info->[1] = \$data; |
|
|
702 | my $cdata = Compress::LZF::compress $data; |
690 | DC::DB::put $self->{mapcache} => $hash => $data, sub { }; |
703 | DC::DB::put $self->{mapcache} => $hash => $cdata, sub { }; |
|
|
704 | } |
|
|
705 | } |
691 | } |
706 | } |
692 | |
707 | |
693 | sub map_clear { |
708 | sub map_clear { |
694 | my ($self) = @_; |
709 | my ($self) = @_; |
695 | |
710 | |
696 | $self->flush_map; |
711 | $self->flush_map; |
|
|
712 | delete $self->{map_info}; |
697 | delete $self->{neigh_map}; |
713 | delete $self->{neigh_map}; |
698 | |
714 | |
699 | $self->{map}->clear; |
715 | $self->{map}->clear; |
700 | delete $self->{map_widget}{magicmap}; |
716 | delete $self->{map_widget}{magicmap}; |
701 | } |
717 | } |
… | |
… | |
722 | |
738 | |
723 | $self->bg_fetch; |
739 | $self->bg_fetch; |
724 | }; |
740 | }; |
725 | } |
741 | } |
726 | |
742 | |
727 | sub load_map($$$) { |
743 | sub load_map($$$$$$) { |
728 | my ($self, $hash, $x, $y) = @_; |
744 | my ($self, $hash, $x, $y, $w, $h) = @_; |
729 | |
745 | |
730 | my $gen = $self->{map_change_gen}; |
746 | my $map_info = $self->{map_cache}{$hash} = [$hash, \"", $x, $y, $w, $h]; |
731 | |
747 | |
732 | my $cb = sub { |
748 | my $cb = sub { |
733 | return unless $gen == $self->{map_change_gen}; |
749 | $map_info->[1] = \$_[0]; |
734 | |
750 | |
735 | my ($data) = @_; |
|
|
736 | |
|
|
737 | if (defined $data) { |
|
|
738 | $self->{map_cache_new}{$hash} = \$data; |
|
|
739 | |
|
|
740 | my $data = Compress::LZF::decompress $data; |
|
|
741 | |
|
|
742 | my $inprogress = @{ $self->{bg_fetch} || [] }; |
751 | my $inprogress = @{ $self->{bg_fetch} || [] }; |
743 | unshift @{ $self->{bg_fetch} }, $self->{map}->set_rect ($x, $y, $data); |
752 | unshift @{ $self->{bg_fetch} }, $self->{map}->set_rect ($x, $y, $_[0]); |
744 | $self->bg_fetch unless $inprogress; |
753 | $self->bg_fetch unless $inprogress; |
745 | } |
|
|
746 | }; |
754 | }; |
747 | |
755 | |
748 | if (my $rdata = $self->{map_cache_old}{$hash}) { |
756 | if (my $map_info = $self->{map_cache_old}{$hash}) { |
749 | $cb->($$rdata); |
757 | $cb->(${ $map_info->[1] }); |
750 | } else { |
758 | } else { |
|
|
759 | my $gen = $self->{map_change_gen}; |
|
|
760 | |
751 | DC::DB::get $self->{mapcache} => $hash, $cb; |
761 | DC::DB::get $self->{mapcache} => $hash, sub { |
|
|
762 | return unless $gen == $self->{map_change_gen}; |
|
|
763 | return unless defined $_[0]; |
|
|
764 | $cb->(Compress::LZF::decompress $_[0]); |
|
|
765 | }; |
752 | } |
766 | } |
753 | } |
767 | } |
754 | |
768 | |
755 | # hardcode /world/world_xxx_xxx map names, the savings are enourmous, |
769 | # hardcode /world/world_xxx_xxx map names, the savings are enourmous, |
756 | # (server resource,s latency, bandwidth), so this hack is warranted. |
770 | # (server resources, latency, bandwidth), so this hack is warranted. |
757 | # the right fix is to make real tiled maps with an overview file |
771 | # the right fix is to make real tiled maps with an overview file |
758 | sub send_mapinfo { |
772 | sub send_mapinfo { |
759 | my ($self, $data, $cb) = @_; |
773 | my ($self, $data, $cb) = @_; |
760 | |
774 | |
761 | if ($self->{map_info}[0] =~ m%^/world/world_(\d\d\d)_(\d\d\d)$%) { |
775 | if ($self->{map_info}[0] =~ m%^/world/world_(\d\d\d)_(\d\d\d)$%) { |
… | |
… | |
786 | } |
800 | } |
787 | |
801 | |
788 | # this method does a "flood fill" into every tile direction |
802 | # this method does a "flood fill" into every tile direction |
789 | # it assumes that tiles are arranged in a rectangular grid, |
803 | # it assumes that tiles are arranged in a rectangular grid, |
790 | # i.e. a map is the same as the left of the right map etc. |
804 | # i.e. a map is the same as the left of the right map etc. |
791 | # failure to comply are harmless and result in display errors |
805 | # failure to comply is harmless and results in display errors |
792 | # at worst. |
806 | # at worst. |
793 | sub flood_fill { |
807 | sub flood_fill { |
794 | my ($self, $block, $gx, $gy, $path, $hash, $flags) = @_; |
808 | my ($self, $block, $gx, $gy, $path, $hash, $flags) = @_; |
795 | |
809 | |
796 | # the server does not allow map paths > 6 |
810 | # the server does not allow map paths > 6 |
… | |
… | |
832 | return if $mode ne "spatial"; |
846 | return if $mode ne "spatial"; |
833 | |
847 | |
834 | $x += $self->{map}->ox; |
848 | $x += $self->{map}->ox; |
835 | $y += $self->{map}->oy; |
849 | $y += $self->{map}->oy; |
836 | |
850 | |
837 | $self->load_map ($hash, $x, $y) |
851 | $self->load_map ($hash, $x, $y, $w, $h) |
838 | unless $self->{neigh_map}{$hash}[5]++;#d# |
852 | unless $self->{neigh_map}{$hash}[5]++;#d# |
839 | |
853 | |
840 | $neigh->[$tile] = [$flags, $x, $y, $w, $h, $hash]; |
854 | $neigh->[$tile] = [$flags, $x, $y, $w, $h, $hash]; |
841 | |
855 | |
842 | $self->flood_fill ($block, $gx, $gy, "$path$tile", $hash, $flags) |
856 | $self->flood_fill ($block, $gx, $gy, "$path$tile", $hash, $flags) |
… | |
… | |
850 | my ($self, $mode, $flags, $x, $y, $w, $h, $hash) = @_; |
864 | my ($self, $mode, $flags, $x, $y, $w, $h, $hash) = @_; |
851 | |
865 | |
852 | $self->flush_map; |
866 | $self->flush_map; |
853 | |
867 | |
854 | ++$self->{map_change_gen}; |
868 | ++$self->{map_change_gen}; |
855 | $self->{map_cache_old} = delete $self->{map_cache_new}; |
869 | $self->{map_cache_old} = delete $self->{map_cache}; |
856 | |
870 | |
857 | my ($ox, $oy) = ($::MAP->ox, $::MAP->oy); |
871 | my ($ox, $oy) = ($::MAP->ox, $::MAP->oy); |
858 | |
872 | |
859 | my $mapmapw = $self->{mapmap}->{w}; |
873 | my $mapmapw = $self->{mapmap}->{w}; |
860 | my $mapmaph = $self->{mapmap}->{h}; |
874 | my $mapmaph = $self->{mapmap}->{h}; |
… | |
… | |
872 | $self->{map_info} = [$hash, $x, $y, $w, $h]; |
886 | $self->{map_info} = [$hash, $x, $y, $w, $h]; |
873 | |
887 | |
874 | (my $map = $hash) =~ s/^.*?\/([^\/]+)$/\1/; |
888 | (my $map = $hash) =~ s/^.*?\/([^\/]+)$/\1/; |
875 | $::STATWIDS->{map}->set_text ("Map: " . $map); |
889 | $::STATWIDS->{map}->set_text ("Map: " . $map); |
876 | |
890 | |
877 | $self->load_map ($hash, $x, $y); |
891 | $self->load_map ($hash, $x, $y, $w, $h); |
878 | $self->flood_fill (0, 0, 0, "", $hash, $flags); |
892 | $self->flood_fill (0, 0, 0, "", $hash, $flags); |
879 | } |
893 | } |
880 | |
894 | |
881 | sub face_find { |
895 | sub face_find { |
882 | my ($self, $facenum, $face, $cb) = @_; |
896 | my ($self, $facenum, $face, $cb) = @_; |
… | |
… | |
1024 | s/&(?!amp;|lt;|gt;|apos;|quot;|#[0-9]+;|#x[0-9a-fA-F]+;)/&/g; |
1038 | s/&(?!amp;|lt;|gt;|apos;|quot;|#[0-9]+;|#x[0-9a-fA-F]+;)/&/g; |
1025 | |
1039 | |
1026 | # handle some elements |
1040 | # handle some elements |
1027 | s/<fg name='([^']*)'>(.*?)<\/fg>/<span foreground='$1'>$2<\/span>/gs; |
1041 | s/<fg name='([^']*)'>(.*?)<\/fg>/<span foreground='$1'>$2<\/span>/gs; |
1028 | s/<fg name="([^"]*)">(.*?)<\/fg>/<span foreground="$1">$2<\/span>/gs; |
1042 | s/<fg name="([^"]*)">(.*?)<\/fg>/<span foreground="$1">$2<\/span>/gs; |
|
|
1043 | |
|
|
1044 | s/\s+$//; |
1029 | |
1045 | |
1030 | $_ |
1046 | $_ |
1031 | } |
1047 | } |
1032 | |
1048 | |
1033 | our %NAME_TO_COLOR = ( |
1049 | our %NAME_TO_COLOR = ( |
… | |
… | |
1139 | |
1155 | |
1140 | my %skill_help; |
1156 | my %skill_help; |
1141 | |
1157 | |
1142 | for my $node (DC::Pod::find skill_description => "*") { |
1158 | for my $node (DC::Pod::find skill_description => "*") { |
1143 | my (undef, @par) = DC::Pod::section_of $node; |
1159 | my (undef, @par) = DC::Pod::section_of $node; |
1144 | $skill_help{$node->{kw}[0]} = DC::Pod::as_label @par; |
1160 | $skill_help{$node->[DC::Pod::N_KW][0]} = DC::Pod::as_label @par; |
1145 | }; |
1161 | }; |
1146 | |
1162 | |
1147 | for my $skill (values %{$self->{skill_info}}) { |
1163 | for my $skill (values %{$self->{skill_info}}) { |
1148 | $self->{map_widget}->add_command ("ready_skill $skill", |
1164 | $self->{map_widget}->add_command ("ready_skill $skill", |
1149 | (DC::asxml "Ready the skill '$skill'\n\n") |
1165 | (DC::asxml "Ready the skill '$skill'\n\n") |
… | |
… | |
1169 | $::FLOORBOX->clear; |
1185 | $::FLOORBOX->clear; |
1170 | |
1186 | |
1171 | my @add; |
1187 | my @add; |
1172 | |
1188 | |
1173 | my $row; |
1189 | my $row; |
1174 | for (sort { $a->{count} <=> $b->{count} } values %{ $::CONN->{container}{$::CONN->{open_container} || 0} }) { |
1190 | for (sort { $b->{count} <=> $a->{count} } values %{ $::CONN->{container}{$::CONN->{open_container} || 0} }) { |
|
|
1191 | next if $_->{tag} & 0x80000000; |
1175 | if ($row < 6) { |
1192 | if ($row < 6) { |
1176 | local $_->{face_widget}; # hack to force recreation of widget |
1193 | local $_->{face_widget}; # hack to force recreation of widget |
1177 | local $_->{desc_widget}; # hack to force recreation of widget |
1194 | local $_->{desc_widget}; # hack to force recreation of widget |
1178 | DC::Item::update_widgets $_; |
1195 | DC::Item::update_widgets $_; |
1179 | |
1196 | |
… | |
… | |
1206 | sub set_opencont { |
1223 | sub set_opencont { |
1207 | my ($conn, $tag, $name) = @_; |
1224 | my ($conn, $tag, $name) = @_; |
1208 | $conn->{open_container} = $tag; |
1225 | $conn->{open_container} = $tag; |
1209 | update_floorbox; |
1226 | update_floorbox; |
1210 | |
1227 | |
1211 | $::INVR_HB->clear (); |
1228 | $::INVR_HB->clear; |
1212 | $::INVR_HB->add (new DC::UI::Label align => 0, expand => 1, text => $name); |
1229 | $::INVR_HB->add (new DC::UI::Label expand => 1, text => $name); |
1213 | |
1230 | |
1214 | if ($tag != 0) { # Floor isn't closable, is it? |
1231 | if ($tag != 0) { # Floor isn't closable, is it? |
1215 | $::INVR_HB->add (new DC::UI::Button |
1232 | $::INVR_HB->add (new DC::UI::Button |
1216 | text => "Close container", |
1233 | text => "Close container", |
1217 | tooltip => "Close the currently open container (if one is open)", |
1234 | tooltip => "Close the currently open container (if one is open)", |
… | |
… | |
1272 | } |
1289 | } |
1273 | |
1290 | |
1274 | sub item_update { |
1291 | sub item_update { |
1275 | my ($self, $item) = @_; |
1292 | my ($self, $item) = @_; |
1276 | |
1293 | |
1277 | #d# print "item_update: $item->{tag} in $item->{container} ($self->{player}{tag}) ($::CONN->{open_container})\n"; |
1294 | #print "item_update: $item->{tag} in $item->{container} pt($self->{player}{tag}) oc($::CONN->{open_container}) f($item->{flags})\n"; |
1278 | |
1295 | |
1279 | DC::Item::update_widgets $item; |
1296 | DC::Item::update_widgets $item; |
1280 | |
1297 | |
1281 | if ($item->{tag} == $::CONN->{open_container} && not ($item->{flags} & F_OPEN)) { |
1298 | if ($item->{tag} == $::CONN->{open_container} && not ($item->{flags} & F_OPEN)) { |
1282 | set_opencont ($::CONN, 0, "Floor"); |
1299 | set_opencont ($::CONN, 0, "Floor"); |
1283 | |
1300 | |
1284 | } elsif ($item->{flags} & F_OPEN) { |
1301 | } elsif ($item->{flags} & F_OPEN) { |
1285 | set_opencont ($::CONN, $item->{tag}, DC::Item::desc_string $item); |
1302 | set_opencont ($::CONN, $item->{tag}, DC::Item::desc_string $item); |
… | |
… | |
1301 | |
1318 | |
1302 | my $weight = .001 * $self->{player}{weight}; |
1319 | my $weight = .001 * $self->{player}{weight}; |
1303 | my $limit = .001 * $self->{stat}{+CS_STAT_WEIGHT_LIM}; |
1320 | my $limit = .001 * $self->{stat}{+CS_STAT_WEIGHT_LIM}; |
1304 | |
1321 | |
1305 | $::STATWIDS->{weight}->set_text (sprintf "Weight: %.1fkg", $weight); |
1322 | $::STATWIDS->{weight}->set_text (sprintf "Weight: %.1fkg", $weight); |
1306 | $::STATWIDS->{m_weight}->set_text (sprintf "%.1fkg", $limit); |
1323 | $::STATWIDS->{m_weight}->set_text (sprintf "Max Weight: %.1fkg", $limit); |
1307 | $::STATWIDS->{i_weight}->set_text (sprintf "%.1f/%.1fkg", $weight, $limit); |
1324 | $::STATWIDS->{i_weight}->set_text (sprintf "%.1f/%.1fkg", $weight, $limit); |
1308 | } |
1325 | } |
1309 | |
1326 | |
1310 | sub update_server_info { |
1327 | sub update_server_info { |
1311 | my ($self) = @_; |
1328 | my ($self) = @_; |
… | |
… | |
1319 | . "extended command support $yesno[$self->{setup}{extcmd} > 0]\n" |
1336 | . "extended command support $yesno[$self->{setup}{extcmd} > 0]\n" |
1320 | . "examine command support $yesno[$self->{setup}{excmd} > 0]\n" |
1337 | . "examine command support $yesno[$self->{setup}{excmd} > 0]\n" |
1321 | . "editing support $yesno[!!$self->{editor_support}]\n" |
1338 | . "editing support $yesno[!!$self->{editor_support}]\n" |
1322 | . "map attributes $yesno[$self->{setup}{extmap} > 0]\n" |
1339 | . "map attributes $yesno[$self->{setup}{extmap} > 0]\n" |
1323 | . "big image protocol support $yesno[$self->{setup}{fxix} > 0]\n" |
1340 | . "big image protocol support $yesno[$self->{setup}{fxix} > 0]\n" |
1324 | . "cfplus support $yesno[$self->{cfplus_ext} > 0]" |
1341 | . "client support $yesno[$self->{cfplus_ext} > 0]" |
1325 | . ($self->{cfplus_ext} > 0 ? ", version $self->{cfplus_ext}" : "") ."\n" |
1342 | . ($self->{cfplus_ext} > 0 ? ", version $self->{cfplus_ext}" : "") ."\n" |
1326 | . "map size $self->{mapw}×$self->{maph}\n" |
1343 | . "map size $self->{mapw}×$self->{maph}\n" |
1327 | ); |
1344 | ); |
1328 | |
1345 | |
1329 | } |
1346 | } |
… | |
… | |
1351 | |
1368 | |
1352 | $self->update_server_info; |
1369 | $self->update_server_info; |
1353 | |
1370 | |
1354 | $self->send_command ("output-rate $::CFG->{output_rate}") if $::CFG->{output_rate} > 0; |
1371 | $self->send_command ("output-rate $::CFG->{output_rate}") if $::CFG->{output_rate} > 0; |
1355 | $self->send_command ("pickup $::CFG->{pickup}"); |
1372 | $self->send_command ("pickup $::CFG->{pickup}"); |
|
|
1373 | |
|
|
1374 | $self->send_exti_msg (clientlog => sprintf "OpenGL Info: %s [%s]", |
|
|
1375 | DC::OpenGL::gl_vendor, DC::OpenGL::gl_version);#d# |
1356 | } |
1376 | } |
1357 | |
1377 | |
1358 | sub lookat { |
1378 | sub lookat { |
1359 | my ($self, $x, $y) = @_; |
1379 | my ($self, $x, $y) = @_; |
1360 | |
1380 | |