--- deliantra/Deliantra-Client/DC/Protocol.pm 2008/09/09 10:27:26 1.202
+++ deliantra/Deliantra-Client/DC/Protocol.pm 2008/12/20 19:45:50 1.207
@@ -20,6 +20,11 @@
our $TEX_NOFACE = new_from_resource DC::Texture
"noface.png", minify => 1, mipmap => 1;
+our $TEX_HIDDEN = new_from_resource DC::Texture
+ "hidden.png", minify => 1, mipmap => 1;
+
+sub MIN_TEXTURE_UNUSED() { 1 }#d#
+
sub new {
my ($class, %arg) = @_;
@@ -75,6 +80,7 @@
delete $self->{items};
$::INV->clear;
+ $::INVR->clear;
$::INVR_HB->clear;
$::FLOORBOX->clear;
});
@@ -92,6 +98,26 @@
$self->{map}->set_texture (2, @$tex{qw(name w h s t)}, @{$tex->{minified}});
}
+ {
+ $self->{hidden} = my $tex = $TEX_HIDDEN;
+ $self->{map}->set_texture (3, @$tex{qw(name w h s t)}, @{$tex->{minified}});
+ }
+
+# $self->{expire_count} = DC::DB::FIRST_TILE_ID; # minimum non-fixed tile id
+# $self->{expire_w} = EV::timer 1, 1, sub {
+# my $count = (int @{ $self->{texture} } / MIN_TEXTURE_UNUSED) || 1;
+#
+# for ($self->{map}->expire_textures ($self->{expire_count}, $count)) {
+# warn DC::SvREFCNT $self->{texture}[$_];
+# $self->{texture}[$_]->unload;
+# warn "expire texture $_\n";#d#
+# }
+#
+# ($self->{expire_count} += $count) < @{ $self->{texture} }
+# or $self->{expire_count} = DC::DB::FIRST_TILE_ID;
+# warn "count is $count\n";#d#
+# };
+
$self->{open_container} = 0;
# per server
@@ -547,7 +573,7 @@
my @add = @$sw;
- my $TOOLTIP_ALL = "\n\nLeft click - ready skill\nMiddle click - use spell\nRight click - further options";
+ my $TOOLTIP_ALL = "\n\nLeft click - ready skill\nMiddle click - use skill\nRight click - further options";
my @TOOLTIP_LVL = (tooltip => "Level. The level of the skill.$TOOLTIP_ALL", can_events => 1, can_hover => 1);
my @TOOLTIP_EXP = (tooltip => "Experience. The experience points you have in this skill.$TOOLTIP_ALL", can_events => 1, can_hover => 1);
@@ -657,12 +683,12 @@
$delay = 1;
- if (my $tex = $::CONN->{texture}[$tile]) {
+ if (my $tex = $self->{texture}[$tile]) {
$tex->upload;
} else {
$self->{delay}{$tile} = 1;
- # we assume the face is in-flight and will eventually come
+ # we assume the face is in-flight and will eventually arrive
push @{$self->{tile_cb}{$tile}}, sub {
delete $self->{delay}{$tile};
$_[0]->upload;
@@ -671,7 +697,7 @@
}
if ($delay) {
- # delay the map drawing a tiny bit in the hope of getting the missing fetched
+ # delay the map drawing a tiny bit in the hope of getting the missing tiles fetched
EV::once undef, 0, 0.03, sub {
$self->{map_widget}->update
if $self->{map_widget};
@@ -1544,7 +1570,12 @@
sub send {
my ($self, $msg) = @_;
- $self->{textview}->add_paragraph ({ markup => "\n" . DC::asxml $msg });
+ $self->{textview}->add_paragraph ({
+ markup =>
+ "\n"
+ . (DC::asxml $msg)
+ . ""
+ });
$self->{textview}->scroll_to_bottom;
$self->{conn}->send_ext_msg (npc_dialog_tell => $self->{id}, $msg);