ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/Item.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/Item.pm (file contents):
Revision 1.3 by root, Sat Dec 9 21:50:00 2006 UTC vs.
Revision 1.4 by root, Mon Apr 23 19:17:41 2007 UTC

153 } 153 }
154 154
155 1 155 1
156 }; 156 };
157 157
158 my $tooltip_std = "<small>" 158 my $tooltip_std =
159 "<small>"
159 . "Left click - examine item\n" 160 . "Left click - examine item\n"
160 . "Shift-Left click - " . ($self->{container} ? "move or drop" : "take") . " item\n" 161 . "Shift-Left click - " . ($self->{container} ? "move or drop" : "take") . " item\n"
161 . "Middle click - apply\n" 162 . "Middle click - apply\n"
162 . "Shift-Middle click - lock/unlock\n" 163 . "Shift-Middle click - lock/unlock\n"
163 . "Right click - further options" 164 . "Right click - further options"
164 . "</small>\n"; 165 . "</small>\n";
165 166
166 my $bg = $self->{flags} & F_CURSED ? [1 , 0 , 0, 0.5] 167 my $bg = $self->{flags} & F_CURSED ? [1 , 0 , 0, 0.5]
167 : $self->{flags} & F_MAGIC ? [0.2, 0.2, 1, 0.5] 168 : $self->{flags} & F_MAGIC ? [0.2, 0.2, 1, 0.5]
168 : undef; 169 : undef;
169 170
188 $self->{desc_widget} ||= new CFPlus::UI::Label 189 $self->{desc_widget} ||= new CFPlus::UI::Label
189 can_events => 1, 190 can_events => 1,
190 can_hover => 1, 191 can_hover => 1,
191 ellipsise => 2, 192 ellipsise => 2,
192 align => -1, 193 align => -1,
194
193 on_button_down => $button_cb, 195 on_button_down => $button_cb,
196 on_tooltip_show => sub {
197 my ($widget) = @_;
198
199 $::CONN->ex ($self->{tag}, sub {
200 my ($long_desc) = @_;
201
202 $long_desc =~ s/\s+$//;
203
204 $self->{long_desc} = $long_desc;
205 $widget->set_tooltip ("<b>$long_desc</b>\n\n$tooltip_std");
206 });
207 },
194 ; 208 ;
209
195 my $desc = CFPlus::Item::desc_string $self; 210 my $desc = CFPlus::Item::desc_string $self;
196 $self->{desc_widget}{bg} = $bg; 211 $self->{desc_widget}{bg} = $bg;
197 $self->{desc_widget}->set_text ($desc); 212 $self->{desc_widget}->set_text ($desc);
213
214 my $long_desc = $self->{long_desc} || "<b>$desc</b>.";
198 $self->{desc_widget}->set_tooltip ("<b>$desc</b>.\n$tooltip_std"); 215 $self->{desc_widget}->set_tooltip ("$long_desc\n$tooltip_std");
199 216
200 $self->{weight_widget} ||= new CFPlus::UI::Label 217 $self->{weight_widget} ||= new CFPlus::UI::Label
201 can_events => 1, 218 can_events => 1,
202 can_hover => 1, 219 can_hover => 1,
203 ellipsise => 0, 220 ellipsise => 0,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines