--- deliantra/Deliantra-Client/DC/Protocol.pm 2007/08/21 00:59:34 1.156 +++ deliantra/Deliantra-Client/DC/Protocol.pm 2007/08/21 02:39:17 1.157 @@ -68,8 +68,7 @@ my ($face) = @_; $self->{exp_table} = $self->{json_coder}->decode (delete $face->{data}); - - #TODO: update all interested parties + $_->() for values %{ $self->{on_exp_update} || {} }; }); () @@ -177,7 +176,6 @@ inv => $::INV, invr => $::INVR, invr_hb => $::INVR_HB, - ); while (my ($id, $name) = each %ass) { @@ -450,6 +448,7 @@ $::GAUGES->{grace} ->set_value ($gr, $gr_m); $::GAUGES->{exp} ->set_text ("Exp: " . (::formsep ($stats->{+CS_STAT_EXP64})) . " (lvl " . ($stats->{+CS_STAT_LEVEL} * 1) . ")"); + $::GAUGES->{prg} ->set_value ($stats->{+CS_STAT_LEVEL}, $stats->{+CS_STAT_EXP64}); $::GAUGES->{range} ->set_text ($stats->{+CS_STAT_RANGE}); my $title = $stats->{+CS_STAT_TITLE}; $title =~ s/^Player: //; @@ -485,10 +484,12 @@ push @add, 0, 0, (new CFPlus::UI::Label text => "Experience", align => 1), 1, 0, (new CFPlus::UI::Label text => "Lvl.", align => 1), - 2, 0, (new CFPlus::UI::Label text => "Skill", expand => 1), - 3, 0, (new CFPlus::UI::Label text => "Experience", align => 1), - 4, 0, (new CFPlus::UI::Label text => "Lvl.", align => 1), - 5, 0, (new CFPlus::UI::Label text => "Skill", expand => 1), + 2, 0, (new CFPlus::UI::Label text => "Progress", align => 0), + 3, 0, (new CFPlus::UI::Label text => "Skill", expand => 1), + 4, 0, (new CFPlus::UI::Label text => "Experience", align => 1), + 5, 0, (new CFPlus::UI::Label text => "Lvl.", align => 1), + 6, 0, (new CFPlus::UI::Label text => "Progress", align => 0), + 7, 0, (new CFPlus::UI::Label text => "Skill", expand => 1), ; my $TOOLTIP_ALL = "\n\nLeft click - ready skill\nMiddle click - use spell\nRight click - further options"; @@ -528,11 +529,12 @@ }; push @add, - $x * 3 + 0, $y, ($self->{stat_widget_exp}{$idx} = new CFPlus::UI::Label + $x * 4 + 0, $y, ($self->{stat_widget_exp}{$idx} ||= new CFPlus::UI::Label align => 1, font => $::FONT_FIXED, fg => [1, 1, 0], on_button_down => $spell_cb, @TOOLTIP_EXP), - $x * 3 + 1, $y, ($self->{stat_widget_lvl}{$idx} = new CFPlus::UI::Label + $x * 4 + 1, $y, ($self->{stat_widget_lvl}{$idx} ||= new CFPlus::UI::Label text => "0", align => 1, font => $::FONT_FIXED, fg => [0, 1, 0], padding_x => 4, on_button_down => $spell_cb, @TOOLTIP_LVL), - $x * 3 + 2, $y, (new CFPlus::UI::Label text => $name, on_button_down => $spell_cb, + $x * 4 + 2, $y, ($self->{stat_widget_prg}{$idx} ||= new CFPlus::UI::ExperienceProgress), + $x * 4 + 3, $y, ($self->{stat_widget_lbl}{$idx} ||= new CFPlus::UI::Label text => $name, on_button_down => $spell_cb, can_events => 1, can_hover => 1, tooltip => (CFPlus::Pod::section_label skill_description => $name) . $TOOLTIP_ALL), ; @@ -545,6 +547,7 @@ for (grep exists $stats->{$_}, @skills) { $self->{stat_widget_exp}{$_}->set_text (::formsep ($stats->{$_}[1])); $self->{stat_widget_lvl}{$_}->set_text ($stats->{$_}[0] * 1); + $self->{stat_widget_prg}{$_}->set_value (@{$stats->{$_}}); } } @@ -930,6 +933,8 @@ sub register_face_handler { my ($self, $num, $cb) = @_; + return unless $num; + # invoke if available right now $cb->($self->{face}[$num], 0) unless exists $self->{face}[$num]{loading};