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.67 by root, Mon Jul 24 08:23:28 2006 UTC vs.
Revision 1.68 by elmex, Sun Jul 30 12:51:32 2006 UTC

261 $sktbl->add (2, 0, new CFClient::UI::Label text => "Skill", expand => 1); 261 $sktbl->add (2, 0, new CFClient::UI::Label text => "Skill", expand => 1);
262 $sktbl->add (3, 0, new CFClient::UI::Label text => "Experience", align => 1); 262 $sktbl->add (3, 0, new CFClient::UI::Label text => "Experience", align => 1);
263 $sktbl->add (4, 0, new CFClient::UI::Label text => "Lvl.", align => 1); 263 $sktbl->add (4, 0, new CFClient::UI::Label text => "Lvl.", align => 1);
264 $sktbl->add (5, 0, new CFClient::UI::Label text => "Skill", expand => 1); 264 $sktbl->add (5, 0, new CFClient::UI::Label text => "Skill", expand => 1);
265 265
266 my $TOOLTIP_ALL = "\n\n<small>Left click - ready skill\nMiddle click - use spell\nRight click - further options</small>";
267
268 my @TOOLTIP_LVL = (tooltip => "<b>Level</b>. The level of the skill.$TOOLTIP_ALL", can_events => 1, can_hover => 1);
269 my @TOOLTIP_EXP = (tooltip => "<b>Experience</b>. The experience points you have in this skill.$TOOLTIP_ALL", can_events => 1, can_hover => 1);
270 my @TOOLTIP_NAME = (tooltip => "<b>Name</b>. The name of the skill.$TOOLTIP_ALL", can_events => 1, can_hover => 1);
271
266 my ($x, $y) = (0, 1); 272 my ($x, $y) = (0, 1);
267 for ( 273 for (
268 sort { $stats->{$b->[0]}[1] <=> $stats->{$a->[0]}[1] or $a->[1] cmp $b->[1] } 274 sort { $stats->{$b->[0]}[1] <=> $stats->{$a->[0]}[1] or $a->[1] cmp $b->[1] }
269 map [$_, $self->{skill_info}{$_}], 275 map [$_, $self->{skill_info}{$_}],
270 grep exists $stats->{$_}, 276 grep exists $stats->{$_},
271 @skills 277 @skills
272 ) { 278 ) {
273 my ($idx, $name) = @$_; 279 my ($idx, $name) = @$_;
274 280
281 my $spell_cb = sub {
282 my ($widget, $ev) = @_;
283
284 if ($ev->{button} == 1) {
285 $::CONN->user_send ("ready_skill $name");
286 } elsif ($ev->{button} == 2) {
287 $::CONN->user_send ("use_skill $name");
288 } elsif ($ev->{button} == 3) {
289 (new CFClient::UI::Menu
290 items => [
291 ["bind <i>ready_skill $name</i> to a key" => sub { $::BIND_EDITOR->do_quick_binding (["ready_skill $name"]) }],
292 ["bind <i>use_skill $name</i> to a key" => sub { $::BIND_EDITOR->do_quick_binding (["use_skill $name"]) }],
293 ],
294 )->popup ($ev);
295 } else {
296 return 0;
297 }
298
299 1
300 };
301
275 $sktbl->add ($x * 3 + 0, $y, $self->{stat_widget_exp}{$idx} = new CFClient::UI::Label 302 $sktbl->add ($x * 3 + 0, $y, $self->{stat_widget_exp}{$idx} = new CFClient::UI::Label
276 text => "0", align => 1, font => $::FONT_FIXED, fg => [1, 1, 0]); 303 text => "0", align => 1, font => $::FONT_FIXED, fg => [1, 1, 0], on_button_down => $spell_cb, @TOOLTIP_EXP);
277 $sktbl->add ($x * 3 + 1, $y, $self->{stat_widget_lvl}{$idx} = new CFClient::UI::Label 304 $sktbl->add ($x * 3 + 1, $y, $self->{stat_widget_lvl}{$idx} = new CFClient::UI::Label
278 text => "0", align => 1, font => $::FONT_FIXED, fg => [0, 1, 0], padding_x => 4); 305 text => "0", align => 1, font => $::FONT_FIXED, fg => [0, 1, 0], padding_x => 4, on_button_down => $spell_cb, @TOOLTIP_LVL);
279 $sktbl->add ($x * 3 + 2, $y, new CFClient::UI::Label text => $name); 306 $sktbl->add ($x * 3 + 2, $y, new CFClient::UI::Label text => $name, on_button_down => $spell_cb, @TOOLTIP_NAME);
280 307
281 $x++ and ($x, $y) = (0, $y + 1); 308 $x++ and ($x, $y) = (0, $y + 1);
282 } 309 }
283 } 310 }
284 311

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines