From 78acdcf767c7d51a446bd5f14a53ab18d7cbc108 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 26 Jan 2024 19:56:16 -0500 Subject: [PATCH] Placeholder UI for skill tree --- assets/voxygen/element/ui/diary/hammer_bg.png | 3 + common/src/comp/ability.rs | 2 +- voxygen/src/hud/diary.rs | 123 +++++++++++++++++- voxygen/src/hud/img_ids.rs | 1 + 4 files changed, 123 insertions(+), 6 deletions(-) create mode 100644 assets/voxygen/element/ui/diary/hammer_bg.png diff --git a/assets/voxygen/element/ui/diary/hammer_bg.png b/assets/voxygen/element/ui/diary/hammer_bg.png new file mode 100644 index 0000000000..0434dc4eec --- /dev/null +++ b/assets/voxygen/element/ui/diary/hammer_bg.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f5ab5dd7fd805d91eb2eca905a25aa7c757059fd559a39bb6513a4117f1ccd8 +size 4554 diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index 4a3ed1a3f6..3332b3e42e 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -34,7 +34,7 @@ use crate::{ use hashbrown::HashMap; use serde::{Deserialize, Serialize}; use specs::{Component, DerefFlaggedStorage}; -use std::{borrow::Cow, convert::TryFrom, time::Duration}; +use std::{borrow::Cow, time::Duration}; use super::shockwave::ShockwaveDodgeable; diff --git a/voxygen/src/hud/diary.rs b/voxygen/src/hud/diary.rs index 65ed34b19b..310ac4bff0 100644 --- a/voxygen/src/hud/diary.rs +++ b/voxygen/src/hud/diary.rs @@ -86,6 +86,7 @@ widget_ids! { skill_lock_imgs[], sword_bg, axe_bg, + hammer_bg, bow_render, skill_bow_charged_0, skill_bow_charged_1, @@ -1792,12 +1793,124 @@ impl<'a> Diary<'a> { ui: &mut UiCell, mut events: Vec, ) -> Vec { - // use skills::HammerSkill::*; - // let skill_buttons = &[ - // ]; + // Hammer + Image::new(self.imgs.hammer_bg) + .wh([865.0, 600.0]) + .mid_top_with_margin_on(state.ids.content_align, 65.0) + .color(Some(Color::Rgba(1.0, 1.0, 1.0, 1.0))) + .set(state.ids.hammer_bg, ui); - // self.handle_skill_buttons(skill_buttons, ui, &mut events, diary_tooltip, - // state); + use PositionSpecifier::TopLeftWithMarginsOn; + let skill_buttons = &[ + SkillIcon::Ability { + skill: Skill::Hammer(HammerSkill::ScornfulSwipe), + ability_id: "common.abilities.hammer.scornful_swipe", + position: TopLeftWithMarginsOn(state.ids.hammer_bg, 492.0, 416.0), + }, + SkillIcon::Ability { + skill: Skill::Hammer(HammerSkill::Tremor), + ability_id: "common.abilities.hammer.tremor", + position: TopLeftWithMarginsOn(state.ids.hammer_bg, 418.0, 149.0), + }, + SkillIcon::Ability { + skill: Skill::Hammer(HammerSkill::VigorousBash), + ability_id: "common.abilities.hammer.vigorous_bash", + position: TopLeftWithMarginsOn(state.ids.hammer_bg, 422.0, 282.0), + }, + SkillIcon::Ability { + skill: Skill::Hammer(HammerSkill::Retaliate), + ability_id: "common.abilities.hammer.retaliate", + position: TopLeftWithMarginsOn(state.ids.hammer_bg, 313.0, 87.0), + }, + SkillIcon::Ability { + skill: Skill::Hammer(HammerSkill::SpineCracker), + ability_id: "common.abilities.hammer.spine_cracker", + position: TopLeftWithMarginsOn(state.ids.hammer_bg, 311.0, 327.0), + }, + SkillIcon::Ability { + skill: Skill::Hammer(HammerSkill::Breach), + ability_id: "common.abilities.hammer.breach", + position: TopLeftWithMarginsOn(state.ids.hammer_bg, 311.0, 214.0), + }, + SkillIcon::Ability { + skill: Skill::Hammer(HammerSkill::IronTempest), + ability_id: "common.abilities.hammer.iron_tempest", + position: TopLeftWithMarginsOn(state.ids.hammer_bg, 202.0, 216.0), + }, + SkillIcon::Ability { + skill: Skill::Hammer(HammerSkill::Upheaval), + ability_id: "common.abilities.hammer.upheaval", + position: TopLeftWithMarginsOn(state.ids.hammer_bg, 202.0, 343.0), + }, + SkillIcon::Ability { + skill: Skill::Hammer(HammerSkill::Thunderclap), + ability_id: "common.abilities.hammer.thunderclap", + position: TopLeftWithMarginsOn(state.ids.hammer_bg, 72.0, 218.0), + }, + SkillIcon::Ability { + skill: Skill::Hammer(HammerSkill::SeismicShock), + ability_id: "common.abilities.hammer.seismic_shock", + position: TopLeftWithMarginsOn(state.ids.hammer_bg, 71.0, 336.0), + }, + SkillIcon::Ability { + skill: Skill::Hammer(HammerSkill::HeavyWhorl), + ability_id: "common.abilities.hammer.heavy_whorl", + position: TopLeftWithMarginsOn(state.ids.hammer_bg, 417.0, 675.0), + }, + SkillIcon::Ability { + skill: Skill::Hammer(HammerSkill::Intercept), + ability_id: "common.abilities.hammer.intercept", + position: TopLeftWithMarginsOn(state.ids.hammer_bg, 421.0, 541.0), + }, + SkillIcon::Ability { + skill: Skill::Hammer(HammerSkill::PileDriver), + ability_id: "common.abilities.hammer.pile_driver", + position: TopLeftWithMarginsOn(state.ids.hammer_bg, 312.0, 735.0), + }, + SkillIcon::Ability { + skill: Skill::Hammer(HammerSkill::LungPummel), + ability_id: "common.abilities.hammer.lung_pummel", + position: TopLeftWithMarginsOn(state.ids.hammer_bg, 310.0, 609.0), + }, + SkillIcon::Ability { + skill: Skill::Hammer(HammerSkill::HelmCrusher), + ability_id: "common.abilities.hammer.helm_crusher", + position: TopLeftWithMarginsOn(state.ids.hammer_bg, 310.0, 497.0), + }, + SkillIcon::Ability { + skill: Skill::Hammer(HammerSkill::Rampart), + ability_id: "common.abilities.hammer.rampart", + position: TopLeftWithMarginsOn(state.ids.hammer_bg, 201.0, 605.0), + }, + SkillIcon::Ability { + skill: Skill::Hammer(HammerSkill::Tenacity), + ability_id: "common.abilities.hammer.tenacity", + position: TopLeftWithMarginsOn(state.ids.hammer_bg, 201.0, 478.0), + }, + SkillIcon::Ability { + skill: Skill::Hammer(HammerSkill::Earthshaker), + ability_id: "common.abilities.hammer.earthshaker", + position: TopLeftWithMarginsOn(state.ids.hammer_bg, 71.0, 600.0), + }, + SkillIcon::Ability { + skill: Skill::Hammer(HammerSkill::Judgement), + ability_id: "common.abilities.hammer.judgement", + position: TopLeftWithMarginsOn(state.ids.hammer_bg, 70.0, 481.0), + }, + ]; + + state.update(|s| { + s.ids + .skills + .resize(skill_buttons.len(), &mut ui.widget_id_generator()) + }); + state.update(|s| { + s.ids + .skill_lock_imgs + .resize(skill_buttons.len(), &mut ui.widget_id_generator()) + }); + + self.handle_skill_buttons(skill_buttons, ui, &mut events, diary_tooltip, state); events } diff --git a/voxygen/src/hud/img_ids.rs b/voxygen/src/hud/img_ids.rs index fff7cdd125..0be304dcd6 100644 --- a/voxygen/src/hud/img_ids.rs +++ b/voxygen/src/hud/img_ids.rs @@ -84,6 +84,7 @@ image_ids! { slot_skills: "voxygen.element.ui.diary.buttons.slot_skilltree", sword_bg: "voxygen.element.ui.diary.sword_bg", axe_bg: "voxygen.element.ui.diary.axe_bg", + hammer_bg: "voxygen.element.ui.diary.hammer_bg", swords_crossed: "voxygen.element.weapons.swords_crossed", sceptre: "voxygen.element.weapons.sceptre", sword: "voxygen.element.weapons.sword",