From f1386cce19aabd4ad027e6f12be013de8e109493 Mon Sep 17 00:00:00 2001 From: David Gay Date: Wed, 7 Jul 2021 19:01:43 -0400 Subject: Show current active skill(s) level and XPTNL based on activity requirements rather than on the last skill that gained XP --- app/views/application/_timer.html.erb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'app/views') diff --git a/app/views/application/_timer.html.erb b/app/views/application/_timer.html.erb index a18e739..de82546 100644 --- a/app/views/application/_timer.html.erb +++ b/app/views/application/_timer.html.erb @@ -15,10 +15,14 @@ - <% most_recent_cs = current_char.character_skills.order(:updated_at).last %> + <% required_character_skills = current_char.activity.whatnot[:requirements]&.filter_map { |r| current_char.character_skills.find_by(skill: Skill.find_by_gid(r[:gid])) if r[:type] == "skill" } %>
-
<%= most_recent_cs.skill.name %> level <%= most_recent_cs.level %>
-
<%= most_recent_cs.xp_to_next_level %> XP to next level
+ <% required_character_skills.each do |cs| %> +
+
<%= cs.skill.name %> level <%= cs.level %>
+
<%= cs.xp_to_next_level %> XP to next level
+
+ <% end %>
-- cgit v1.2.3