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

Comparing deliantra/Deliantra-Client/DC/UI.pm (file contents):
Revision 1.298 by root, Wed Jun 7 07:00:30 2006 UTC vs.
Revision 1.299 by root, Wed Jun 7 07:17:37 2006 UTC

3557 ) 3557 )
3558} 3558}
3559 3559
3560my $TOOLTIP_ALL = "\n\n<small>Left click - ready spell\nMiddle click - invoke spell\nRight click - further options</small>"; 3560my $TOOLTIP_ALL = "\n\n<small>Left click - ready spell\nMiddle click - invoke spell\nRight click - further options</small>";
3561 3561
3562my @TOOLTIP_NAME = (align => 0, can_events => 1, can_hover => 1, tooltip => 3562my @TOOLTIP_NAME = (align => -1, can_events => 1, can_hover => 1, tooltip =>
3563 "<b>Name</b>. The name of the spell.$TOOLTIP_ALL"); 3563 "<b>Name</b>. The name of the spell.$TOOLTIP_ALL");
3564my @TOOLTIP_SKILL = (align => -1, can_events => 1, can_hover => 1, tooltip =>
3565 "<b>Skill</b>. The skill (or magic school) required to be able to attempt casting this spell.$TOOLTIP_ALL");
3564my @TOOLTIP_LVL = (align => 1, can_events => 1, can_hover => 1, tooltip => 3566my @TOOLTIP_LVL = (align => 1, can_events => 1, can_hover => 1, tooltip =>
3565 "<b>Level</b>. Minimum level the caster needs in the associated skill to be able to attempt casting this spell.$TOOLTIP_ALL"); 3567 "<b>Level</b>. Minimum level the caster needs in the associated skill to be able to attempt casting this spell.$TOOLTIP_ALL");
3566my @TOOLTIP_SP = (align => 1, can_events => 1, can_hover => 1, tooltip => 3568my @TOOLTIP_SP = (align => 1, can_events => 1, can_hover => 1, tooltip =>
3567 "<b>Spell points / Grace points</b>. Amount of spell or grace points used by each invocation.$TOOLTIP_ALL"); 3569 "<b>Spell points / Grace points</b>. Amount of spell or grace points used by each invocation.$TOOLTIP_ALL");
3568my @TOOLTIP_DMG = (align => 1, can_events => 1, can_hover => 1, tooltip => 3570my @TOOLTIP_DMG = (align => 1, can_events => 1, can_hover => 1, tooltip =>
3573 3575
3574 $CFClient::UI::ROOT->on_refresh ($self => sub { 3576 $CFClient::UI::ROOT->on_refresh ($self => sub {
3575 $self->clear; 3577 $self->clear;
3576 3578
3577 $self->add (1, 0, new CFClient::UI::Label text => "Spell Name", @TOOLTIP_NAME); 3579 $self->add (1, 0, new CFClient::UI::Label text => "Spell Name", @TOOLTIP_NAME);
3580 $self->add (2, 0, new CFClient::UI::Label text => "Skill", @TOOLTIP_SKILL);
3578 $self->add (2, 0, new CFClient::UI::Label text => "Lvl" , @TOOLTIP_LVL); 3581 $self->add (3, 0, new CFClient::UI::Label text => "Lvl" , @TOOLTIP_LVL);
3579 $self->add (3, 0, new CFClient::UI::Label text => "Sp/Gp", @TOOLTIP_SP); 3582 $self->add (4, 0, new CFClient::UI::Label text => "Sp/Gp", @TOOLTIP_SP);
3580 $self->add (4, 0, new CFClient::UI::Label text => "Dmg" , @TOOLTIP_DMG); 3583 $self->add (5, 0, new CFClient::UI::Label text => "Dmg" , @TOOLTIP_DMG);
3581 3584
3582 my $row = 0; 3585 my $row = 0;
3583 3586
3584 for (sort { $a cmp $b } keys %{ $self->{spell} }) { 3587 for (sort { $a cmp $b } keys %{ $self->{spell} }) {
3585 my $spell = $self->{spell}{$_}; 3588 my $spell = $self->{spell}{$_};
3605 } 3608 }
3606 3609
3607 1 3610 1
3608 }; 3611 };
3609 3612
3613 my $tooltip = "$spell->{message}$TOOLTIP_ALL";
3614
3615 #TODO: add path info to tooltip
3616 #$self->add (6, $row, new CFClient::UI::Label text => $spell->{path});
3617
3610 $self->add (0, $row, new CFClient::UI::Face 3618 $self->add (0, $row, new CFClient::UI::Face
3611 face => $spell->{face}, 3619 face => $spell->{face},
3612 can_hover => 1, 3620 can_hover => 1,
3613 can_events => 1, 3621 can_events => 1,
3614 tooltip => $spell->{message}, 3622 tooltip => $tooltip,
3615 on_button_down => $spell_cb, 3623 on_button_down => $spell_cb,
3616 ); 3624 );
3617 3625
3618 $self->add (1, $row, new CFClient::UI::Label 3626 $self->add (1, $row, new CFClient::UI::Label
3619 expand => 1, 3627 expand => 1,
3620 text => $spell->{name}, 3628 text => $spell->{name},
3621 can_hover => 1, 3629 can_hover => 1,
3622 can_events => 1, 3630 can_events => 1,
3623 tooltip => "$spell->{message}$TOOLTIP_ALL", 3631 tooltip => $tooltip,
3624 on_button_down => $spell_cb, 3632 on_button_down => $spell_cb,
3625 ); 3633 );
3626 3634
3635 $self->add (2, $row, new CFClient::UI::Label text => $::CONN->{skill_info}{$spell->{skill}}, @TOOLTIP_SKILL);
3627 $self->add (2, $row, new CFClient::UI::Label text => $spell->{level}, @TOOLTIP_LVL); 3636 $self->add (3, $row, new CFClient::UI::Label text => $spell->{level}, @TOOLTIP_LVL);
3628 $self->add (3, $row, new CFClient::UI::Label text => $spell->{mana} || $spell->{grace}, @TOOLTIP_SP); 3637 $self->add (4, $row, new CFClient::UI::Label text => $spell->{mana} || $spell->{grace}, @TOOLTIP_SP);
3629 $self->add (4, $row, new CFClient::UI::Label text => $spell->{damage}, @TOOLTIP_DMG); 3638 $self->add (5, $row, new CFClient::UI::Label text => $spell->{damage}, @TOOLTIP_DMG);
3630 } 3639 }
3631 }); 3640 });
3632} 3641}
3633 3642
3634sub add_spell { 3643sub add_spell {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines