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.193 by root, Thu Apr 24 00:08:33 2008 UTC vs.
Revision 1.196 by root, Thu May 8 21:30:23 2008 UTC

64 $self->{on_stop_game_guard} = $self->{map_widget}{root}->connect (stop_game => sub { 64 $self->{on_stop_game_guard} = $self->{map_widget}{root}->connect (stop_game => sub {
65 for my $ws (values %{delete $self->{widgetset} || {}}) { 65 for my $ws (values %{delete $self->{widgetset} || {}}) {
66 $_->destroy 66 $_->destroy
67 for values %{delete $ws->{w} || {}}; 67 for values %{delete $ws->{w} || {}};
68 } 68 }
69
70 delete $self->{items};
71 $::INV->clear;
72 $::INVR_HB->clear;
73 $::FLOORBOX->clear;
69 }); 74 });
70 75
71 $self->{map_widget}->add_command (@$_) 76 $self->{map_widget}->add_command (@$_)
72 for @cmd_help; 77 for @cmd_help;
73 78
1026 1031
1027 # handle some elements 1032 # handle some elements
1028 s/<fg name='([^']*)'>(.*?)<\/fg>/<span foreground='$1'>$2<\/span>/gs; 1033 s/<fg name='([^']*)'>(.*?)<\/fg>/<span foreground='$1'>$2<\/span>/gs;
1029 s/<fg name="([^"]*)">(.*?)<\/fg>/<span foreground="$1">$2<\/span>/gs; 1034 s/<fg name="([^"]*)">(.*?)<\/fg>/<span foreground="$1">$2<\/span>/gs;
1030 1035
1036 s/\s+$//;
1037
1031 $_ 1038 $_
1032} 1039}
1033 1040
1034our %NAME_TO_COLOR = ( 1041our %NAME_TO_COLOR = (
1035 black => 0, 1042 black => 0,
1170 $::FLOORBOX->clear; 1177 $::FLOORBOX->clear;
1171 1178
1172 my @add; 1179 my @add;
1173 1180
1174 my $row; 1181 my $row;
1175 for (sort { $a->{count} <=> $b->{count} } values %{ $::CONN->{container}{$::CONN->{open_container} || 0} }) { 1182 for (sort { $b->{count} <=> $a->{count} } values %{ $::CONN->{container}{$::CONN->{open_container} || 0} }) {
1183 next if $_->{tag} & 0x80000000;
1176 if ($row < 6) { 1184 if ($row < 6) {
1177 local $_->{face_widget}; # hack to force recreation of widget 1185 local $_->{face_widget}; # hack to force recreation of widget
1178 local $_->{desc_widget}; # hack to force recreation of widget 1186 local $_->{desc_widget}; # hack to force recreation of widget
1179 DC::Item::update_widgets $_; 1187 DC::Item::update_widgets $_;
1180 1188
1207sub set_opencont { 1215sub set_opencont {
1208 my ($conn, $tag, $name) = @_; 1216 my ($conn, $tag, $name) = @_;
1209 $conn->{open_container} = $tag; 1217 $conn->{open_container} = $tag;
1210 update_floorbox; 1218 update_floorbox;
1211 1219
1212 $::INVR_HB->clear (); 1220 $::INVR_HB->clear;
1213 $::INVR_HB->add (new DC::UI::Label expand => 1, text => $name); 1221 $::INVR_HB->add (new DC::UI::Label expand => 1, text => $name);
1214 1222
1215 if ($tag != 0) { # Floor isn't closable, is it? 1223 if ($tag != 0) { # Floor isn't closable, is it?
1216 $::INVR_HB->add (new DC::UI::Button 1224 $::INVR_HB->add (new DC::UI::Button
1217 text => "Close container", 1225 text => "Close container",

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines