--- deliantra/Deliantra-Client/DC/Protocol.pm 2007/12/27 19:35:09 1.186 +++ deliantra/Deliantra-Client/DC/Protocol.pm 2008/05/08 21:30:23 1.196 @@ -29,8 +29,8 @@ $self->{map_widget}->clr_commands; my @cmd_help = map { - $_->{kw}[0] =~ /^(\S+) (?:\s+ \( ([^\)]*) \) )?/x - or die "unparseable command help: $_->{kw}[0]"; + $_->[DC::Pod::N_KW][0] =~ /^(\S+) (?:\s+ \( ([^\)]*) \) )?/x + or die "unparseable command help: $_->[DC::Pod::N_KW][0]"; my $cmd = $1; my @args = split /\|/, $2; @@ -45,7 +45,7 @@ map ["$cmd$_", $text], sort { (length $a) <=> (length $b) } @args - } sort { $a->{par} <=> $b->{par} } + } sort { $a->[DC::Pod::N_PAR] <=> $b->[DC::Pod::N_PAR] } DC::Pod::find command => "*"; $self->{json_coder} @@ -66,6 +66,11 @@ $_->destroy for values %{delete $ws->{w} || {}}; } + + delete $self->{items}; + $::INV->clear; + $::INVR_HB->clear; + $::FLOORBOX->clear; }); $self->{map_widget}->add_command (@$_) @@ -277,6 +282,7 @@ floorbox => $::FLOORBOX, help_window => $::HELP_WINDOW, message_window => $::MESSAGE_WINDOW, + message_dist => $::MESSAGE_DIST, statusbox => $::SDTATUSBOX, inv => $::INV, @@ -335,7 +341,7 @@ sub ext_channel_info { my ($self, $info) = @_; $self->{channels}->{$info->{id}} = $info; - $::MESSAGE_WINDOW->add_channel ($info); + $::MESSAGE_DIST->add_channel ($info); } ############################################################################# @@ -527,12 +533,12 @@ my $sw = $self->{skillwid}{""} ||= [ 0, 0, (new DC::UI::Label text => "Experience", align => 1), 1, 0, (new DC::UI::Label text => "Lvl.", align => 1), - 2, 0, (new DC::UI::Label text => "Progress", align => 0), - 3, 0, (new DC::UI::Label text => "Skill", expand => 1), + 2, 0, (new DC::UI::Label text => "Progress"), + 3, 0, (new DC::UI::Label text => "Skill", expand => 1, align => 0), 4, 0, (new DC::UI::Label text => "Experience", align => 1), 5, 0, (new DC::UI::Label text => "Lvl.", align => 1), - 6, 0, (new DC::UI::Label text => "Progress", align => 0), - 7, 0, (new DC::UI::Label text => "Skill", expand => 1), + 6, 0, (new DC::UI::Label text => "Progress"), + 7, 0, (new DC::UI::Label text => "Skill", expand => 1, align => 0), ]; my @add = @$sw; @@ -581,7 +587,7 @@ (new DC::UI::ExperienceProgress), # label - (new DC::UI::Label text => $name, on_button_down => $spell_cb, + (new DC::UI::Label text => $name, on_button_down => $spell_cb, align => 0, can_events => 1, can_hover => 1, tooltip => (DC::Pod::section_label skill_description => $name) . $TOOLTIP_ALL), ]; @@ -1027,6 +1033,8 @@ s/(.*?)<\/fg>/$2<\/span>/gs; s/(.*?)<\/fg>/$2<\/span>/gs; + s/\s+$//; + $_ } @@ -1141,7 +1149,7 @@ for my $node (DC::Pod::find skill_description => "*") { my (undef, @par) = DC::Pod::section_of $node; - $skill_help{$node->{kw}[0]} = DC::Pod::as_label @par; + $skill_help{$node->[DC::Pod::N_KW][0]} = DC::Pod::as_label @par; }; for my $skill (values %{$self->{skill_info}}) { @@ -1171,7 +1179,8 @@ my @add; my $row; - for (sort { $a->{count} <=> $b->{count} } values %{ $::CONN->{container}{$::CONN->{open_container} || 0} }) { + for (sort { $b->{count} <=> $a->{count} } values %{ $::CONN->{container}{$::CONN->{open_container} || 0} }) { + next if $_->{tag} & 0x80000000; if ($row < 6) { local $_->{face_widget}; # hack to force recreation of widget local $_->{desc_widget}; # hack to force recreation of widget @@ -1208,8 +1217,8 @@ $conn->{open_container} = $tag; update_floorbox; - $::INVR_HB->clear (); - $::INVR_HB->add (new DC::UI::Label align => 0, expand => 1, text => $name); + $::INVR_HB->clear; + $::INVR_HB->add (new DC::UI::Label expand => 1, text => $name); if ($tag != 0) { # Floor isn't closable, is it? $::INVR_HB->add (new DC::UI::Button @@ -1274,10 +1283,10 @@ sub item_update { my ($self, $item) = @_; - #d# print "item_update: $item->{tag} in $item->{container} ($self->{player}{tag}) ($::CONN->{open_container})\n"; + #print "item_update: $item->{tag} in $item->{container} pt($self->{player}{tag}) oc($::CONN->{open_container}) f($item->{flags})\n"; DC::Item::update_widgets $item; - + if ($item->{tag} == $::CONN->{open_container} && not ($item->{flags} & F_OPEN)) { set_opencont ($::CONN, 0, "Floor"); @@ -1303,7 +1312,7 @@ my $limit = .001 * $self->{stat}{+CS_STAT_WEIGHT_LIM}; $::STATWIDS->{weight}->set_text (sprintf "Weight: %.1fkg", $weight); - $::STATWIDS->{m_weight}->set_text (sprintf "%.1fkg", $limit); + $::STATWIDS->{m_weight}->set_text (sprintf "Max Weight: %.1fkg", $limit); $::STATWIDS->{i_weight}->set_text (sprintf "%.1f/%.1fkg", $weight, $limit); } @@ -1321,7 +1330,7 @@ . "editing support $yesno[!!$self->{editor_support}]\n" . "map attributes $yesno[$self->{setup}{extmap} > 0]\n" . "big image protocol support $yesno[$self->{setup}{fxix} > 0]\n" - . "cfplus support $yesno[$self->{cfplus_ext} > 0]" + . "client support $yesno[$self->{cfplus_ext} > 0]" . ($self->{cfplus_ext} > 0 ? ", version $self->{cfplus_ext}" : "") ."\n" . "map size $self->{mapw}×$self->{maph}\n" );