--- deliantra/Deliantra-Client/DC/UI.pm 2007/08/22 21:32:09 1.434 +++ deliantra/Deliantra-Client/DC/UI.pm 2007/08/22 21:40:43 1.435 @@ -32,10 +32,6 @@ return if $ENV{CFPLUS_DEBUG} & 8; - my $tip = $widget->{tooltip}; - - $tip = $tip->($widget) if CODE:: eq ref $tip; - $TOOLTIP->set_tooltip_from ($widget); $TOOLTIP->show; } @@ -2875,10 +2871,11 @@ tooltip => sub { my ($self) = @_; - sprintf "%s points experience (level %d).\n%s points to next level %s.", - ::formsep $self->{exp}, + sprintf "level %d\n%s points\n%s next level\n%s to go", $self->{lvl}, - ::formsep $self->{nxt} + ::formsep ($self->{exp}), + ::formsep ($self->{nxt}), + ::formsep ($self->{nxt} - $self->{exp}), }, %arg ); @@ -2901,9 +2898,15 @@ sub set_value { my ($self, $lvl, $exp) = @_; +<<<<<<< UI.pm + $self->{lvl} = $lvl; + $self->{exp} = $exp; + +======= $self->{lvl} = $exp; $self->{exp} = $exp; +>>>>>>> 1.434 my $v = -1; if ($::CONN && (my $table = $::CONN->{exp_table})) { @@ -3558,23 +3561,24 @@ sub set_tooltip_from { my ($self, $widget) = @_; - $widget->{tooltip} = CFPlus::Pod::section_label tooltip => $1 - if $widget->{tooltip} =~ /^#(.*)$/; - - my $tooltip = $widget->{tooltip}; + my $tip = $widget->{tooltip}; + $tip = $tip->($widget) if "CODE" eq ref $tip; + + $tip = CFPlus::Pod::section_label tooltip => $1 + if $tip =~ /^#(.*)$/; if ($ENV{CFPLUS_DEBUG} & 2) { - $tooltip .= "\n\n" . (ref $widget) . "\n" - . "$widget->{x} $widget->{y} $widget->{w} $widget->{h}\n" - . "req $widget->{req_w} $widget->{req_h}\n" - . "visible $widget->{visible}"; + $tip .= "\n\n" . (ref $widget) . "\n" + . "$widget->{x} $widget->{y} $widget->{w} $widget->{h}\n" + . "req $widget->{req_w} $widget->{req_h}\n" + . "visible $widget->{visible}"; } - $tooltip =~ s/^\n+//; - $tooltip =~ s/\n+$//; + $tip =~ s/^\n+//; + $tip =~ s/\n+$//; $self->add (new CFPlus::UI::Label - markup => $tooltip, + markup => $tip, max_w => ($widget->{tooltip_width} || 0.25) * $::WIDTH, fontsize => 0.8, style => 1, # FLAG_INVERSE