diff --git a/assets/common/items/debug/cultist_purp_2h_boss-0.ron b/assets/common/items/debug/cultist_purp_2h_boss-0.ron index 6c1fb695ab..0ce9a87270 100644 --- a/assets/common/items/debug/cultist_purp_2h_boss-0.ron +++ b/assets/common/items/debug/cultist_purp_2h_boss-0.ron @@ -3,7 +3,7 @@ ItemDef( description: "Shouldn't this be a hammer?", kind: Tool( ( - kind: Sceptre, + kind: Sword, stats: ( equip_time_millis: 0, power: 1000.0, diff --git a/assets/common/skill_trees/skill_prerequisites.ron b/assets/common/skill_trees/skill_prerequisites.ron index 5d7e9aa7fc..0c92214721 100644 --- a/assets/common/skill_trees/skill_prerequisites.ron +++ b/assets/common/skill_trees/skill_prerequisites.ron @@ -5,18 +5,18 @@ UnlockGroup(Weapon(Bow)): {General(HealthIncrease): Some(1)}, UnlockGroup(Weapon(Staff)): {General(HealthIncrease): Some(1)}, UnlockGroup(Weapon(Sceptre)): {General(HealthIncrease): Some(1)}, - Sword(SDamage): {Sword(SUnlockSpin): None}, - Sword(SSpeed): {Sword(SUnlockSpin): None}, - Sword(SCost): {Sword(SUnlockSpin): None}, - Sword(SSpins): {Sword(SUnlockSpin): None}, + Sword(TsDamage): {Sword(TsCombo): None}, + Sword(TsRegen): {Sword(TsCombo): None}, + Sword(TsSpeed): {Sword(TsCombo): None}, Sword(DDrain): {Sword(DDamage): Some(1)}, Sword(DCost): {Sword(DDamage): Some(1)}, Sword(DSpeed): {Sword(DDamage): Some(1)}, Sword(DInfinite): {Sword(DDamage): Some(1)}, Sword(DScaling): {Sword(DDamage): Some(1)}, - Sword(TsDamage): {Sword(TsCombo): None}, - Sword(TsRegen): {Sword(TsCombo): None}, - Sword(TsSpeed): {Sword(TsCombo): None}, + Sword(SDamage): {Sword(SUnlockSpin): None}, + Sword(SSpeed): {Sword(SUnlockSpin): None}, + Sword(SCost): {Sword(SUnlockSpin): None}, + Sword(SSpins): {Sword(SUnlockSpin): None}, Axe(DsDamage): {Axe(DsCombo): None}, Axe(DsSpeed): {Axe(DsCombo): None}, Axe(DsRegen): {Axe(DsCombo): None}, diff --git a/assets/voxygen/element/misc_bg/axe_render.png b/assets/voxygen/element/misc_bg/axe_render.png new file mode 100644 index 0000000000..b7e1fab441 Binary files /dev/null and b/assets/voxygen/element/misc_bg/axe_render.png differ diff --git a/assets/voxygen/element/misc_bg/bow_render.png b/assets/voxygen/element/misc_bg/bow_render.png new file mode 100644 index 0000000000..6e320a29c3 Binary files /dev/null and b/assets/voxygen/element/misc_bg/bow_render.png differ diff --git a/assets/voxygen/element/misc_bg/dagger_render.png b/assets/voxygen/element/misc_bg/dagger_render.png new file mode 100644 index 0000000000..a77227fabb Binary files /dev/null and b/assets/voxygen/element/misc_bg/dagger_render.png differ diff --git a/assets/voxygen/element/misc_bg/general_combat_render.png b/assets/voxygen/element/misc_bg/general_combat_render.png new file mode 100644 index 0000000000..e8bc072215 Binary files /dev/null and b/assets/voxygen/element/misc_bg/general_combat_render.png differ diff --git a/assets/voxygen/element/misc_bg/hammer_render.png b/assets/voxygen/element/misc_bg/hammer_render.png new file mode 100644 index 0000000000..ea86893acb Binary files /dev/null and b/assets/voxygen/element/misc_bg/hammer_render.png differ diff --git a/assets/voxygen/element/misc_bg/sceptre_render.png b/assets/voxygen/element/misc_bg/sceptre_render.png new file mode 100644 index 0000000000..3fbcdc152f Binary files /dev/null and b/assets/voxygen/element/misc_bg/sceptre_render.png differ diff --git a/assets/voxygen/element/misc_bg/shield_render.png b/assets/voxygen/element/misc_bg/shield_render.png new file mode 100644 index 0000000000..5384704e58 Binary files /dev/null and b/assets/voxygen/element/misc_bg/shield_render.png differ diff --git a/assets/voxygen/element/misc_bg/staff0_render.png b/assets/voxygen/element/misc_bg/staff0_render.png new file mode 100644 index 0000000000..aae481465c Binary files /dev/null and b/assets/voxygen/element/misc_bg/staff0_render.png differ diff --git a/assets/voxygen/element/misc_bg/sword_render.png b/assets/voxygen/element/misc_bg/sword_render.png index 5f7aa6847f..d0b30ab4a1 100644 Binary files a/assets/voxygen/element/misc_bg/sword_render.png and b/assets/voxygen/element/misc_bg/sword_render.png differ diff --git a/client/src/lib.rs b/client/src/lib.rs index e868cba093..1229a05584 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -20,8 +20,10 @@ use common::{ comp::{ self, chat::{KillSource, KillType}, - group, ControlAction, ControlEvent, Controller, ControllerInputs, GroupManip, - InventoryManip, InventoryUpdateEvent, + group, + skills::Skill, + ControlAction, ControlEvent, Controller, ControllerInputs, GroupManip, InventoryManip, + InventoryUpdateEvent, }, event::{EventBus, LocalEvent}, grid::Grid, @@ -692,6 +694,10 @@ impl Client { ))); } + pub fn unlock_skill(&mut self, skill: Skill) { + self.send_msg(ClientGeneral::UnlockSkill(skill)); + } + pub fn max_group_size(&self) -> u32 { self.max_group_size } pub fn group_invite(&self) -> Option<(Uid, std::time::Instant, std::time::Duration)> { diff --git a/voxygen/src/hud/diary.rs b/voxygen/src/hud/diary.rs new file mode 100644 index 0000000000..98045a493b --- /dev/null +++ b/voxygen/src/hud/diary.rs @@ -0,0 +1,2400 @@ +use super::{ + img_ids::{Imgs, ImgsRot}, + Show, TEXT_COLOR, UI_HIGHLIGHT_0, UI_MAIN, +}; +use crate::{ + i18n::Localization, + ui::{fonts::Fonts, ImageFrame, Tooltip, TooltipManager, Tooltipable}, +}; +use conrod_core::{ + color, + widget::{self, Button, Image, Rectangle, Text}, + widget_ids, Color, Colorable, Labelable, Positionable, Sizeable, Widget, WidgetCommon, +}; + +use client::{self, Client}; +use common::comp::skills::{self, Skill}; +use inline_tweak::*; + +widget_ids! { + pub struct Ids { + frame, + bg, + icon, + close, + title, + content_align, + weapon_imgs[], + weapon_btns[], + skills_top_l_align, + skills_top_r_align, + skills_bot_l_align, + skills_bot_r_align, + skills_top_l[], + skills_top_r[], + skills_bot_l[], + skills_bot_r[], + sword_render, + skill_sword_combo_0, + skill_sword_combo_1, + skill_sword_combo_2, + skill_sword_combo_3, + skill_sword_dash_0, + skill_sword_dash_1, + skill_sword_dash_2, + skill_sword_dash_3, + skill_sword_dash_4, + skill_sword_dash_5, + skill_sword_spin_0, + skill_sword_spin_1, + skill_sword_spin_2, + skill_sword_spin_3, + skill_sword_spin_4, + skill_sword_passive_0, + axe_render, + skill_axe_combo_0, + skill_axe_combo_1, + skill_axe_combo_2, + skill_axe_combo_3, + skill_axe_spin_0, + skill_axe_spin_1, + skill_axe_spin_2, + skill_axe_spin_3, + skill_axe_spin_4, + skill_axe_leap_0, + skill_axe_leap_1, + skill_axe_leap_2, + skill_axe_leap_3, + skill_axe_leap_4, + hammer_render, + skill_hammer_combo_0, + skill_hammer_combo_1, + skill_hammer_combo_2, + skill_hammer_combo_3, + skill_hammer_charged_0, + skill_hammer_charged_1, + skill_hammer_charged_2, + skill_hammer_charged_3, + skill_hammer_leap_0, + skill_hammer_leap_1, + skill_hammer_leap_2, + skill_hammer_leap_3, + skill_hammer_leap_4, + skill_hammer_leap_5, + bow_render, + skill_bow_basic_0, + skill_bow_basic_1, + skill_bow_charged_0, + skill_bow_charged_1, + skill_bow_charged_2, + skill_bow_charged_3, + skill_bow_charged_4, + skill_bow_charged_5, + skill_bow_repeater_0, + skill_bow_repeater_1, + skill_bow_repeater_2, + skill_bow_repeater_3, + skill_bow_repeater_4, + skill_bow_passive_0, + staff_render, + skill_staff_basic_0, + skill_staff_basic_1, + skill_staff_basic_2, + skill_staff_basic_3, + skill_staff_beam_0, + skill_staff_beam_1, + skill_staff_beam_2, + skill_staff_beam_3, + skill_staff_shockwave_0, + skill_staff_shockwave_1, + skill_staff_shockwave_2, + skill_staff_shockwave_3, + skill_staff_shockwave_4, + sceptre_render, + skill_sceptre_beam_0, + skill_sceptre_beam_1, + skill_sceptre_beam_2, + skill_sceptre_beam_3, + skill_sceptre_beam_4, + skill_sceptre_beam_5, + skill_sceptre_bomb_0, + skill_sceptre_bomb_1, + skill_sceptre_bomb_2, + skill_sceptre_bomb_3, + skill_sceptre_bomb_4, + } +} + +#[derive(WidgetCommon)] +pub struct Diary<'a> { + show: &'a Show, + _client: &'a Client, + + imgs: &'a Imgs, + fonts: &'a Fonts, + localized_strings: &'a Localization, + rot_imgs: &'a ImgsRot, + tooltip_manager: &'a mut TooltipManager, + + #[conrod(common_builder)] + common: widget::CommonBuilder, + created_btns_top_l: usize, + created_btns_top_r: usize, + created_btns_bot_l: usize, + created_btns_bot_r: usize, + example_skill_count: usize, +} + +impl<'a> Diary<'a> { + pub fn new( + show: &'a Show, + _client: &'a Client, + imgs: &'a Imgs, + fonts: &'a Fonts, + localized_strings: &'a Localization, + rot_imgs: &'a ImgsRot, + tooltip_manager: &'a mut TooltipManager, + ) -> Self { + Self { + show, + _client, + imgs, + fonts, + localized_strings, + rot_imgs, + tooltip_manager, + common: widget::CommonBuilder::default(), + created_btns_top_l: 0, + created_btns_top_r: 0, + created_btns_bot_l: 0, + created_btns_bot_r: 0, + example_skill_count: 0, + } + } +} + +/*pub struct State { + ids: Ids, +}*/ + +/*pub enum DiaryTab { + SkillTrees, + Achievements, +}*/ + +pub enum SelectedSkillTree { + None, + Sword, + Hammer, + Axe, + Sceptre, + Bow, + StaffFire, +} + +const WEAPONS: [&str; 6] = ["Sword", "Hammer", "Axe", "Sceptre", "Bow", "Fire Staff"]; + +pub enum Event { + Close, + ChangeWeaponTree(SelectedSkillTree), + UnlockSkill(Skill), +} + +impl<'a> Widget for Diary<'a> { + type Event = Vec; + type State = Ids; + type Style = (); + + fn init_state(&self, id_gen: widget::id::Generator) -> Self::State { Ids::new(id_gen) } + + #[allow(clippy::unused_unit)] // TODO: Pending review in #587 + fn style(&self) -> Self::Style { () } + + fn update(mut self, args: widget::UpdateArgs) -> Self::Event { + let widget::UpdateArgs { + id: _, state, ui, .. + } = args; + let mut events = Vec::new(); + // Tooltips + let diary_tooltip = Tooltip::new({ + // Edge images [t, b, r, l] + // Corner images [tr, tl, br, bl] + let edge = &self.rot_imgs.tt_side; + let corner = &self.rot_imgs.tt_corner; + ImageFrame::new( + [edge.cw180, edge.none, edge.cw270, edge.cw90], + [corner.none, corner.cw270, corner.cw90, corner.cw180], + Color::Rgba(0.08, 0.07, 0.04, 1.0), + 5.0, + ) + }) + .title_font_size(self.fonts.cyri.scale(15)) + .parent(ui.window) + .desc_font_size(self.fonts.cyri.scale(12)) + .font_id(self.fonts.cyri.conrod_id) + .desc_text_color(TEXT_COLOR); + let sel_tab = &self.show.skilltreetab; + // Frame + Image::new(self.imgs.diary_bg) + .w_h(1202.0, 886.0) + .mid_top_with_margin_on(ui.window, 5.0) + .color(Some(UI_MAIN)) + .set(state.bg, ui); + + Image::new(self.imgs.diary_frame) + .w_h(1202.0, 886.0) + .middle_of(state.bg) + .color(Some(UI_HIGHLIGHT_0)) + .set(state.frame, ui); + + // Icon + Image::new(self.imgs.spellbook_button) + .w_h(30.0, 27.0) + .top_left_with_margins_on(state.frame, 8.0, 8.0) + .set(state.icon, ui); + + // X-Button + if Button::image(self.imgs.close_button) + .w_h(24.0, 25.0) + .hover_image(self.imgs.close_btn_hover) + .press_image(self.imgs.close_btn_press) + .top_right_with_margins_on(state.frame, 0.0, 0.0) + .set(state.close, ui) + .was_clicked() + { + events.push(Event::Close); + } + + // Title + Text::new(&self.localized_strings.get("hud.diary")) + .mid_top_with_margin_on(state.frame, 3.0) + .font_id(self.fonts.cyri.conrod_id) + .font_size(self.fonts.cyri.scale(29)) + .color(TEXT_COLOR) + .set(state.title, ui); + + // Content Alignment + Rectangle::fill_with([599.0 * 2.0, 419.0 * 2.0], color::TRANSPARENT) + .mid_top_with_margin_on(state.frame, 46.0) + .set(state.content_align, ui); + + // Contents + + // Skill Trees + + // Skill Tree Selection + state.update(|s| { + s.weapon_btns + .resize(WEAPONS.len(), &mut ui.widget_id_generator()) + }); + state.update(|s| { + s.weapon_imgs + .resize(WEAPONS.len(), &mut ui.widget_id_generator()) + }); + for i in WEAPONS.iter().copied().enumerate() { + // Background weapon image + let img = Image::new(match i.1 { + "Sword" => self.imgs.sword, + "Hammer" => self.imgs.hammer, + "Axe" => self.imgs.axe, + "Sceptre" => self.imgs.sceptre, + "Bow" => self.imgs.bow, + "Fire Staff" => self.imgs.staff, + _ => self.imgs.nothing, + }); + + let img = if i.0 == 0 { + img.top_left_with_margins_on(state.content_align, tweak!(10.0), tweak!(5.0)) + } else { + img.down_from(state.weapon_btns[i.0 - 1], tweak!(5.0)) + }; + + img.w_h(tweak!(50.0), tweak!(50.0)) + .set(state.weapon_imgs[i.0], ui); + // Weapon icons + if Button::image(match i.1 { + "Sword" => match sel_tab { + SelectedSkillTree::Sword => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border, + }, + "Hammer" => match sel_tab { + SelectedSkillTree::Hammer => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border, + }, + "Axe" => match sel_tab { + SelectedSkillTree::Axe => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border, + }, + "Sceptre" => match sel_tab { + SelectedSkillTree::Sceptre => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border, + }, + "Bow" => match sel_tab { + SelectedSkillTree::Bow => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border, + }, + "Fire Staff" => match sel_tab { + SelectedSkillTree::StaffFire => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border, + }, + _ => self.imgs.wpn_icon_border, + }) + .w_h(tweak!(50.0), tweak!(50.0)) + .hover_image(match i.1 { + "Sword" => match sel_tab { + SelectedSkillTree::Sword => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border_mo, + }, + "Hammer" => match sel_tab { + SelectedSkillTree::Hammer => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border_mo, + }, + "Axe" => match sel_tab { + SelectedSkillTree::Axe => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border_mo, + }, + "Sceptre" => match sel_tab { + SelectedSkillTree::Sceptre => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border_mo, + }, + "Bow" => match sel_tab { + SelectedSkillTree::Bow => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border_mo, + }, + "Fire Staff" => match sel_tab { + SelectedSkillTree::StaffFire => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border_mo, + }, + _ => self.imgs.wpn_icon_border, + }) + .press_image(match i.1 { + "Sword" => match sel_tab { + SelectedSkillTree::Sword => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border_press, + }, + "Hammer" => match sel_tab { + SelectedSkillTree::Hammer => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border_press, + }, + "Axe" => match sel_tab { + SelectedSkillTree::Axe => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border_press, + }, + "Sceptre" => match sel_tab { + SelectedSkillTree::Sceptre => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border_press, + }, + "Bow" => match sel_tab { + SelectedSkillTree::Bow => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border_press, + }, + "Fire Staff" => match sel_tab { + SelectedSkillTree::StaffFire => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border_press, + }, + _ => self.imgs.wpn_icon_border, + }) + .middle_of(state.weapon_imgs[i.0]) + .set(state.weapon_btns[i.0], ui) + .was_clicked() + { + match i.1 { + "Sword" => events.push(Event::ChangeWeaponTree(SelectedSkillTree::Sword)), + "Hammer" => events.push(Event::ChangeWeaponTree(SelectedSkillTree::Hammer)), + "Axe" => events.push(Event::ChangeWeaponTree(SelectedSkillTree::Axe)), + "Sceptre" => events.push(Event::ChangeWeaponTree(SelectedSkillTree::Sceptre)), + "Bow" => events.push(Event::ChangeWeaponTree(SelectedSkillTree::Bow)), + "Fire Staff" => { + events.push(Event::ChangeWeaponTree(SelectedSkillTree::StaffFire)) + }, + _ => events.push(Event::ChangeWeaponTree(SelectedSkillTree::None)), + } + } + } + + // Skill Trees + // Alignment Placing + let x = tweak!(200.0); + let y = tweak!(100.0); + // Alignment rectangles for skills + Rectangle::fill_with([124.0 * 2.0, 124.0 * 2.0], color::TRANSPARENT) + .top_left_with_margins_on(state.content_align, y, x) + .set(state.skills_top_l_align, ui); + Rectangle::fill_with([124.0 * 2.0, 124.0 * 2.0], color::TRANSPARENT) + .top_right_with_margins_on(state.content_align, y, x) + .set(state.skills_top_r_align, ui); + Rectangle::fill_with([124.0 * 2.0, 124.0 * 2.0], color::TRANSPARENT) + .bottom_left_with_margins_on(state.content_align, y, x) + .set(state.skills_bot_l_align, ui); + Rectangle::fill_with([124.0 * 2.0, 124.0 * 2.0], color::TRANSPARENT) + .bottom_right_with_margins_on(state.content_align, y, x) + .set(state.skills_bot_r_align, ui); + // Number of skills per rectangle per weapon, start counting at 0 + // Maximum of 9 skills/8 indices + let skills_top_l = match sel_tab { + SelectedSkillTree::Sword => 4, + SelectedSkillTree::Axe => 4, + SelectedSkillTree::Hammer => 4, + SelectedSkillTree::Bow => 2, + SelectedSkillTree::StaffFire => 4, + SelectedSkillTree::Sceptre => 6, + _ => 0, + }; + let skills_top_r = match sel_tab { + SelectedSkillTree::Sword => 6, + SelectedSkillTree::Axe => 5, + SelectedSkillTree::Hammer => 4, + SelectedSkillTree::Bow => 6, + SelectedSkillTree::StaffFire => 4, + SelectedSkillTree::Sceptre => 5, + _ => 0, + }; + let skills_bot_l = match sel_tab { + SelectedSkillTree::Sword => 5, + SelectedSkillTree::Axe => 5, + SelectedSkillTree::Hammer => 6, + SelectedSkillTree::Bow => 5, + SelectedSkillTree::StaffFire => 5, + _ => 0, + }; + let skills_bot_r = match sel_tab { + SelectedSkillTree::Sword => 1, + SelectedSkillTree::Bow => 1, + _ => 0, + }; + // Update widget id array len + state.update(|s| { + s.skills_top_l + .resize(skills_top_l, &mut ui.widget_id_generator()) + }); + state.update(|s| { + s.skills_top_r + .resize(skills_top_r, &mut ui.widget_id_generator()) + }); + state.update(|s| { + s.skills_bot_l + .resize(skills_bot_l, &mut ui.widget_id_generator()) + }); + state.update(|s| { + s.skills_bot_r + .resize(skills_bot_r, &mut ui.widget_id_generator()) + }); + // Create Background Images to place skill icons on them later + // Create central skill first, others around it: + // + // 5 1 6 + // 3 0 4 + // 8 2 7 + // + // + // TOP-LEFT Skills + while self.created_btns_top_l < skills_top_l { + let mut img = Button::image(self.imgs.wpn_icon_border).w_h(80.0, 80.0); + match self.created_btns_top_l { + 0 => img = img.middle_of(state.skills_top_l_align), // Central Skill + 1 => img = img.up_from(state.skills_top_l[0], 4.0), // 12:00 + 2 => img = img.down_from(state.skills_top_l[0], 4.0), // 6:00 + 3 => img = img.left_from(state.skills_top_l[0], 4.0), // 3:00 + 4 => img = img.right_from(state.skills_top_l[0], 4.0), // 9:00 + 5 => img = img.top_left_with_margins_on(state.skills_top_l[0], -84.0, -84.0), /* 10:30 */ + 6 => img = img.top_right_with_margins_on(state.skills_top_l[0], -84.0, -84.0), /* 1:30 */ + 7 => img = img.bottom_left_with_margins_on(state.skills_top_l[0], -84.0, -84.0), /* 4:30 */ + 8 => img = img.bottom_right_with_margins_on(state.skills_top_l[0], -84.0, -84.0), /* 7:30 */ + _ => {}, + } + img.set(state.skills_top_l[self.created_btns_top_l], ui); + self.created_btns_top_l += 1; + } + // TOP-RIGHT Skills + while self.created_btns_top_r < skills_top_r { + let mut img = Button::image(self.imgs.wpn_icon_border).w_h(80.0, 80.0); + match self.created_btns_top_r { + 0 => img = img.middle_of(state.skills_top_r_align), // Central Skill + 1 => img = img.up_from(state.skills_top_r[0], 4.0), // 12:00 + 2 => img = img.down_from(state.skills_top_r[0], 4.0), // 6:00 + 3 => img = img.left_from(state.skills_top_r[0], 4.0), // 3:00 + 4 => img = img.right_from(state.skills_top_r[0], 4.0), // 9:00 + 5 => img = img.top_left_with_margins_on(state.skills_top_r[0], -84.0, -84.0), /* 10:30 */ + 6 => img = img.top_right_with_margins_on(state.skills_top_r[0], -84.0, -84.0), /* 1:30 */ + 7 => img = img.bottom_left_with_margins_on(state.skills_top_r[0], -84.0, -84.0), /* 4:30 */ + 8 => img = img.bottom_right_with_margins_on(state.skills_top_r[0], -84.0, -84.0), /* 7:30 */ + _ => {}, + } + img.set(state.skills_top_r[self.created_btns_top_r], ui); + self.created_btns_top_r += 1; + } + // BOTTOM-LEFT Skills + while self.created_btns_bot_l < skills_bot_l { + let mut img = Button::image(self.imgs.wpn_icon_border).w_h(80.0, 80.0); + match self.created_btns_bot_l { + 0 => img = img.middle_of(state.skills_bot_l_align), // Central Skill + 1 => img = img.up_from(state.skills_bot_l[0], 4.0), // 12:00 + 2 => img = img.down_from(state.skills_bot_l[0], 4.0), // 6:00 + 3 => img = img.left_from(state.skills_bot_l[0], 4.0), // 3:00 + 4 => img = img.right_from(state.skills_bot_l[0], 4.0), // 9:00 + 5 => img = img.top_left_with_margins_on(state.skills_bot_l[0], -84.0, -84.0), /* 10:30 */ + 6 => img = img.top_right_with_margins_on(state.skills_bot_l[0], -84.0, -84.0), /* 1:30 */ + 7 => img = img.bottom_left_with_margins_on(state.skills_bot_l[0], -84.0, -84.0), /* 4:30 */ + 8 => img = img.bottom_right_with_margins_on(state.skills_bot_l[0], -84.0, -84.0), /* 7:30 */ + _ => {}, + } + img.set(state.skills_bot_l[self.created_btns_bot_l], ui); + self.created_btns_bot_l += 1; + } + // BOTTOM-RIGHT Skills + while self.created_btns_bot_r < skills_bot_r { + let mut btn = Image::new(self.imgs.wpn_icon_border).w_h(80.0, 80.0); + match self.created_btns_bot_r { + 0 => btn = btn.middle_of(state.skills_bot_r_align), // Central Skill + 1 => btn = btn.up_from(state.skills_bot_r[0], 4.0), // 12:00 + 2 => btn = btn.down_from(state.skills_bot_r[0], 4.0), // 6:00 + 3 => btn = btn.left_from(state.skills_bot_r[0], 4.0), // 3:00 + 4 => btn = btn.right_from(state.skills_bot_r[0], 4.0), // 9:00 + 5 => btn = btn.top_left_with_margins_on(state.skills_bot_r[0], -84.0, -84.0), /* 10:30 */ + 6 => btn = btn.top_right_with_margins_on(state.skills_bot_r[0], -84.0, -84.0), /* 1:30 */ + 7 => btn = btn.bottom_left_with_margins_on(state.skills_bot_r[0], -84.0, -84.0), /* 4:30 */ + 8 => btn = btn.bottom_right_with_margins_on(state.skills_bot_r[0], -84.0, -84.0), /* 7:30 */ + _ => {}, + } + btn.set(state.skills_bot_r[self.created_btns_bot_r], ui); + self.created_btns_bot_r += 1; + } + // Skill-Icons and Functionality + // Art dimensions + let art_size = tweak!(0.6); + let sword_size = [265.0 * art_size, 818.0 * art_size]; + let axe_size = [448.0 * art_size, 818.0 * art_size]; + let hammer_size = [465.0 * art_size, 818.0 * art_size]; + let bow_size = [205.0 * art_size, 818.0 * art_size]; + let staff0_size = [177.0 * art_size, 818.0 * art_size]; + let sceptre_size = [241.0 * art_size, 818.0 * art_size]; + let general_comb_size = [762.0 * art_size, 818.0 * art_size]; + let _shield_size = [757.0 * art_size, 818.0 * art_size]; + let _dagger_size = [265.0 * art_size, 818.0 * art_size]; + + match sel_tab { + SelectedSkillTree::Sword => { + use skills::SwordSkill::*; + // Sword + Image::new(self.imgs.sword_render) + .wh(sword_size) + .middle_of(state.content_align) + .graphics_for(state.content_align) + .color(Some(Color::Rgba(1.0, 1.0, 1.0, tweak!(1.0)))) + .set(state.sword_render, ui); + // Top Left skills + // 5 1 6 + // 3 0 4 + // 8 2 7 + if Button::image(self.imgs.sword_whirlwind) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_l[0]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Triple Strike Combo", + "Unlocks combo scaling on triple strike", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_sword_combo_0, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Sword(TsCombo))); + }; + if Button::image(self.imgs.sword_whirlwind) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_l[1]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Triple Strike Damage", + "Increases damage scaling on triple strike", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_sword_combo_1, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Sword(TsDamage))); + }; + if Button::image(self.imgs.sword_whirlwind) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_l[2]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Triple Strike Speed", + "Increases attack speed scaling on triple strike", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_sword_combo_2, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Sword(TsSpeed))); + }; + if Button::image(self.imgs.sword_whirlwind) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_l[3]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Triple Strike Regen", + "Increases enery regen scaling on triple strike", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_sword_combo_3, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Sword(TsRegen))); + }; + // Top right skills + if Button::image(self.imgs.sword_whirlwind) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[0]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Dash Damage", + "Increases initial damage of the dash", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_sword_dash_0, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Sword(DDamage))); + }; + if Button::image(self.imgs.sword_whirlwind) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[1]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Dash Drain", + "Decreases the rate energy is drained while dashing", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_sword_dash_1, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Sword(DDrain))); + }; + if Button::image(self.imgs.sword_whirlwind) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[2]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Dash Cost", + "Decreases the initial cost of the dash", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_sword_dash_2, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Sword(DCost))); + }; + if Button::image(self.imgs.sword_whirlwind) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[3]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Dash Speed", + "Increases how fast you go while dashing", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_sword_dash_3, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Sword(DSpeed))); + }; + if Button::image(self.imgs.sword_whirlwind) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[4]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Dash Infinite", + "Allows you to dash for as long as you have energy", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_sword_dash_4, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Sword(DInfinite))); + }; + if Button::image(self.imgs.sword_whirlwind) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[5]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Dash Scaling", + "Increases how much the damage scales by over the course of the dash", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_sword_dash_5, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Sword(DScaling))); + }; + // Bottom left skills + if Button::image(self.imgs.sword_whirlwind) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_bot_l[0]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Spin Unlock", + "Unlocks the sword spin", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_sword_spin_0, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Sword(SUnlockSpin))); + }; + if Button::image(self.imgs.sword_whirlwind) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_bot_l[1]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Spin Damage", + "Increases the damage done", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_sword_spin_1, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Sword(SDamage))); + }; + if Button::image(self.imgs.sword_whirlwind) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_bot_l[2]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Spin Speed", + "Increase the speed at which you spin", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_sword_spin_2, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Sword(SSpeed))); + }; + if Button::image(self.imgs.sword_whirlwind) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_bot_l[3]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Spin Cost", + "Decreases the energy cost of each spin", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_sword_spin_3, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Sword(SCost))); + }; + if Button::image(self.imgs.sword_whirlwind) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_bot_l[4]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Spin Spins", + "Increases the number of times you can spin", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_sword_spin_4, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Sword(SSpins))); + }; + // Bottom right skills + if Button::image(self.imgs.sword_whirlwind) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_bot_r[0]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Interrupting Attacks", + "Allows you to immediately cancel an attack with another attack", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_sword_passive_0, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Sword(InterruptingAttacks))); + }; + }, + SelectedSkillTree::Axe => { + use skills::AxeSkill::*; + // Axe + Image::new(self.imgs.axe_render) + .wh(axe_size) + .middle_of(state.content_align) + .graphics_for(state.content_align) + .color(Some(Color::Rgba(1.0, 1.0, 1.0, tweak!(1.0)))) + .set(state.axe_render, ui); + // Top Left skills + // 5 1 6 + // 3 0 4 + // 8 2 7 + if Button::image(self.imgs.axespin) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_l[0]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Double Strike Combo", + "Unlocks a second strike", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_axe_combo_0, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Axe(DsCombo))); + }; + if Button::image(self.imgs.axespin) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_l[1]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Double Strike Damage", + "Increases damage scaling in combo", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_axe_combo_1, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Axe(DsDamage))); + }; + if Button::image(self.imgs.axespin) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_l[2]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Double Strike Speed", + "Increases speed scaling in combo", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_axe_combo_2, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Axe(DsSpeed))); + }; + if Button::image(self.imgs.axespin) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_l[3]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Double Strike Regen", + "Increases energy regen scaling in combo", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_axe_combo_3, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Axe(DsRegen))); + }; + // Top right skills + if Button::image(self.imgs.axespin) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[0]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Infinite Axe Spin", + "Spin for as long as you have energy", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_axe_spin_0, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Axe(SInfinite))); + }; + if Button::image(self.imgs.axespin) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[1]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Spin Damage", + "Increases the daamge each spin does", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_axe_spin_1, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Axe(SDamage))); + }; + if Button::image(self.imgs.axespin) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[2]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Spin Helicopter", + "You fall a little slower while spinning", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_axe_spin_2, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Axe(SHelicopter))); + }; + if Button::image(self.imgs.axespin) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[3]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Spin Speed", + "Increases your spins per minute", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_axe_spin_3, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Axe(SSpeed))); + }; + if Button::image(self.imgs.axespin) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[4]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Spin Cost", + "Increases your spin per energy efficiency", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_axe_spin_4, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Axe(SCost))); + }; + // Bottom left skills + if Button::image(self.imgs.axespin) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_bot_l[0]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Unlock Leap", + "Unlocks a leap spin", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_axe_leap_0, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Axe(LUnlockLeap))); + }; + if Button::image(self.imgs.axespin) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_bot_l[1]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Leap Damage", + "Increases damage of leap", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_axe_leap_1, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Axe(LDamage))); + }; + if Button::image(self.imgs.axespin) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_bot_l[2]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Leap Knockback", + "Increases knockback from leap", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_axe_leap_2, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Axe(LKnockback))); + }; + if Button::image(self.imgs.axespin) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_bot_l[3]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Leap Cost", + "Decreases cost of leap", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_axe_leap_3, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Axe(LCost))); + }; + if Button::image(self.imgs.axespin) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_bot_l[4]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Leap Distance", + "Increases distance of leap", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_axe_leap_4, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Axe(LDistance))); + }; + }, + SelectedSkillTree::Hammer => { + use skills::HammerSkill::*; + // Hammer + Image::new(self.imgs.hammer_render) + .wh(hammer_size) + .middle_of(state.content_align) + .graphics_for(state.content_align) + .color(Some(Color::Rgba(1.0, 1.0, 1.0, tweak!(1.0)))) + .set(state.hammer_render, ui); + // Top Left skills + // 5 1 6 + // 3 0 4 + // 8 2 7 + if Button::image(self.imgs.hammergolf) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_l[0]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Single Strike Knockback", + "Increaes yeet potential of swings", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_hammer_combo_0, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Hammer(SsKnockback))); + }; + if Button::image(self.imgs.hammergolf) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_l[1]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Single Strike Damage", + "Increases damage scaling in combo", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_hammer_combo_1, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Hammer(SsDamage))); + }; + if Button::image(self.imgs.hammergolf) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_l[2]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Single Strike Speed", + "Increases speed scaling in combo", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_hammer_combo_2, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Hammer(SsSpeed))); + }; + if Button::image(self.imgs.hammergolf) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_l[3]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Single Strike Regen", + "Increases energy regen scaling in combo", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_hammer_combo_3, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Hammer(SsRegen))); + }; + // Top right skills + if Button::image(self.imgs.hammergolf) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[0]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Charged Melee Knockback", + "Massively increases yeet potential of swing", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_hammer_charged_0, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Hammer(CKnockback))); + }; + if Button::image(self.imgs.hammergolf) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[1]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Charged Melee Damage", + "Increases the daamge of the charged swing", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_hammer_charged_1, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Hammer(CDamage))); + }; + if Button::image(self.imgs.hammergolf) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[2]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Charged Melee Energy Drain", + "Decreases the rate energy drains when charging", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_hammer_charged_2, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Hammer(CDrain))); + }; + if Button::image(self.imgs.hammergolf) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[3]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Charge Rate", + "Increases the rate that you charge the swing", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_hammer_charged_3, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Hammer(CSpeed))); + }; + // Bottom left skills + if Button::image(self.imgs.hammergolf) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_bot_l[0]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Unlock Leap", + "Unlocks a leap", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_hammer_leap_0, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Hammer(LUnlockLeap))); + }; + if Button::image(self.imgs.hammergolf) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_bot_l[1]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Leap Damage", + "Increases damage of leap", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_hammer_leap_1, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Hammer(LDamage))); + }; + if Button::image(self.imgs.hammergolf) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_bot_l[2]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Leap Knockback", + "Increases knockback from leap", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_hammer_leap_2, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Hammer(LKnockback))); + }; + if Button::image(self.imgs.hammergolf) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_bot_l[3]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Leap Cost", + "Decreases cost of leap", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_hammer_leap_3, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Hammer(LCost))); + }; + if Button::image(self.imgs.hammergolf) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_bot_l[4]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Leap Distance", + "Increases distance of leap", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_hammer_leap_4, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Hammer(LDistance))); + }; + if Button::image(self.imgs.hammergolf) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_bot_l[5]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Leap Radius", + "Increases attack radius on ground slam", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_hammer_leap_5, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Hammer(LRange))); + }; + }, + SelectedSkillTree::Bow => { + use skills::BowSkill::*; + // Bow + Image::new(self.imgs.bow_render) + .wh(bow_size) + .middle_of(state.content_align) + .graphics_for(state.content_align) + .color(Some(Color::Rgba(1.0, 1.0, 1.0, tweak!(1.0)))) + .set(state.bow_render, ui); + // Top Left skills + // 5 1 6 + // 3 0 4 + // 8 2 7 + if Button::image(self.imgs.bow_m1) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_l[0]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Damage", + "Increases damage", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_bow_basic_0, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Bow(BDamage))); + }; + if Button::image(self.imgs.bow_m1) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_l[1]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Energy Regen", + "Increases energy regen", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_bow_basic_1, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Bow(BRegen))); + }; + // Top right skills + if Button::image(self.imgs.bow_m1) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[0]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Charged Damage", + "Increases how much damage scales by as it is charged", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_bow_charged_0, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Bow(CDamage))); + }; + if Button::image(self.imgs.bow_m1) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[1]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Charged Drain", + "Decreases the rate energy is drained while charging", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_bow_charged_1, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Bow(CDrain))); + }; + if Button::image(self.imgs.bow_m1) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[2]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Charged Projectile Speed", + "Increases yeet potential applied to arrow while charging", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_bow_charged_2, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Bow(CProjSpeed))); + }; + if Button::image(self.imgs.bow_m1) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[3]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Charged Speed", + "Increases the rate that you charge the attack", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_bow_charged_3, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Bow(CSpeed))); + }; + if Button::image(self.imgs.bow_m1) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[4]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Charged Move Speed", + "Increases how fast you can shuffle while charging the attack", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_bow_charged_4, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Bow(CMove))); + }; + if Button::image(self.imgs.bow_m1) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[5]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Charged Knockback", + "Yeet enemies further", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_bow_charged_5, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Bow(CKnockback))); + }; + // Bottom left skills + if Button::image(self.imgs.bow_m1) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_bot_l[0]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Repeater Unlock", + "Unlocks the ability to leap in the arrow", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_bow_repeater_0, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Bow(UnlockRepeater))); + }; + if Button::image(self.imgs.bow_m1) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_bot_l[1]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Repeater Damage", + "Increases the damage done", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_bow_repeater_1, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Bow(RDamage))); + }; + if Button::image(self.imgs.bow_m1) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_bot_l[2]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Repeater Glide", + "Glide further while repeatering", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_bow_repeater_2, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Bow(RGlide))); + }; + if Button::image(self.imgs.bow_m1) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_bot_l[3]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Repeater Cost", + "Decreases the energy cost to become a gliding repeater", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_bow_repeater_3, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Bow(RCost))); + }; + if Button::image(self.imgs.bow_m1) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_bot_l[4]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Arrow Count", + "Yeet more arrows when you leap", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_bow_repeater_4, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Bow(RArrows))); + }; + // Bottom right skills + if Button::image(self.imgs.bow_m1) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_bot_r[0]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Projectile Speed", + "Allows you to yeet arrows further, faster", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_bow_passive_0, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Bow(ProjSpeed))); + }; + }, + SelectedSkillTree::StaffFire => { + use skills::StaffSkill::*; + // Staff + Image::new(self.imgs.staff0_render) + .wh(staff0_size) + .middle_of(state.content_align) + .graphics_for(state.content_align) + .color(Some(Color::Rgba(1.0, 1.0, 1.0, tweak!(1.0)))) + .set(state.staff_render, ui); + // Top Left skills + // 5 1 6 + // 3 0 4 + // 8 2 7 + if Button::image(self.imgs.fireball) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_l[0]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Explosion", + "When fire just isn't enough", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_staff_basic_0, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Staff(BExplosion))); + }; + if Button::image(self.imgs.fireball) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_l[1]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Damage", + "Increases damage", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_staff_basic_1, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Staff(BDamage))); + }; + if Button::image(self.imgs.fireball) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_l[2]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Energy Regen", + "Increases energy regen", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_staff_basic_2, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Staff(BRegen))); + }; + if Button::image(self.imgs.fireball) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_l[3]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Explosion Radius", + "Bigger is better", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_staff_basic_3, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Staff(BRadius))); + }; + // Top right skills + if Button::image(self.imgs.fireball) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[0]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Flamethrower Damage", + "Increases damage", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_staff_beam_0, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Staff(FDamage))); + }; + if Button::image(self.imgs.fireball) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[1]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Energy Drain", + "Decreases the rate energy is drained", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_staff_beam_1, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Staff(FDrain))); + }; + if Button::image(self.imgs.fireball) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[2]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Flamethrower Range", + "For when the flames just won't reach", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_staff_beam_2, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Staff(FRange))); + }; + if Button::image(self.imgs.fireball) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[3]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Flame Velocity", + "Gets the fire there faster", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_staff_beam_3, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Staff(FVelocity))); + }; + // Bottom left skills + if Button::image(self.imgs.fireball) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_bot_l[0]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Shockwave Unlock", + "Unlocks the ability to yeet enemies away using fire", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_staff_shockwave_0, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Staff(UnlockShockwave))); + }; + if Button::image(self.imgs.fireball) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_bot_l[1]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Shockwave Damage", + "Increases the damage done", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_staff_shockwave_1, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Staff(SDamage))); + }; + if Button::image(self.imgs.fireball) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_bot_l[2]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Shockwave Knockback", + "Increases yeet potential", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_staff_shockwave_2, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Staff(SKnockback))); + }; + if Button::image(self.imgs.fireball) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_bot_l[3]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Shockwave Cost", + "Decreases the energy cost to yeet helpless villagers", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_staff_shockwave_3, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Staff(SCost))); + }; + if Button::image(self.imgs.fireball) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_bot_l[4]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Shockwave Range", + "Yeet things that used to be out of reach", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_staff_shockwave_4, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Staff(SRange))); + }; + }, + SelectedSkillTree::Sceptre => { + use skills::SceptreSkill::*; + // Sceptre + Image::new(self.imgs.sceptre_render) + .wh(sceptre_size) + .middle_of(state.content_align) + .graphics_for(state.content_align) + .color(Some(Color::Rgba(1.0, 1.0, 1.0, tweak!(1.0)))) + .set(state.sceptre_render, ui); + // Top Left skills + // 5 1 6 + // 3 0 4 + // 8 2 7 + if Button::image(self.imgs.heal_0) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_l[0]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Beam Heal", + "Increased healing from the beam", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_sceptre_beam_0, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Sceptre(BHeal))); + }; + if Button::image(self.imgs.heal_0) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_l[1]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Damage", + "Increases damage", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_sceptre_beam_1, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Sceptre(BDamage))); + }; + if Button::image(self.imgs.heal_0) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_l[2]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Energy Regen", + "Increases energy regen from damage", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_sceptre_beam_2, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Sceptre(BRegen))); + }; + if Button::image(self.imgs.heal_0) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_l[3]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Range", + "Longer beam", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_sceptre_beam_3, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Sceptre(BRange))); + }; + if Button::image(self.imgs.heal_0) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_l[4]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Lifesteal Efficiency", + "Thieve more health", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_sceptre_beam_4, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Sceptre(BLifesteal))); + }; + if Button::image(self.imgs.heal_0) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_l[5]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Heal Cost", + "Use less energy when healing", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_sceptre_beam_5, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Sceptre(BCost))); + }; + // Top right skills + if Button::image(self.imgs.heal_0) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[0]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Heal", + "Increases healing", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_sceptre_bomb_0, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Sceptre(PHeal))); + }; + if Button::image(self.imgs.heal_0) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[1]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Damage", + "Increases damage", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_sceptre_bomb_1, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Sceptre(PDamage))); + }; + if Button::image(self.imgs.heal_0) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[2]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Radius", + "Increases radius", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_sceptre_bomb_2, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Sceptre(PRadius))); + }; + if Button::image(self.imgs.heal_0) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[3]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Energy Cost", + "Decreases energy cost of bomb", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_sceptre_bomb_3, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Sceptre(PCost))); + }; + if Button::image(self.imgs.heal_0) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_r[4]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .with_tooltip( + self.tooltip_manager, + "Projectile Speed", + "Yeets it faster", + &diary_tooltip, + TEXT_COLOR, + ) + .set(state.skill_sceptre_bomb_4, ui) + .was_clicked() + { + events.push(Event::UnlockSkill(Skill::Sceptre(PProjSpeed))); + }; + }, + _ => {}, + } + + events + } +} diff --git a/voxygen/src/hud/img_ids.rs b/voxygen/src/hud/img_ids.rs index 0a09b99cb0..3ad24c4a05 100644 --- a/voxygen/src/hud/img_ids.rs +++ b/voxygen/src/hud/img_ids.rs @@ -66,6 +66,14 @@ image_ids! { diary_bg: "voxygen.element.misc_bg.diary_bg", diary_frame: "voxygen.element.misc_bg.diary_frame", sword_render: "voxygen.element.misc_bg.sword_render", + axe_render: "voxygen.element.misc_bg.axe_render", + hammer_render: "voxygen.element.misc_bg.hammer_render", + bow_render: "voxygen.element.misc_bg.bow_render", + staff0_render: "voxygen.element.misc_bg.staff0_render", + sceptre_render: "voxygen.element.misc_bg.sceptre_render", + general_combat_render: "voxygen.element.misc_bg.general_combat_render", + shield_render: "voxygen.element.misc_bg.shield_render", + dagger_render: "voxygen.element.misc_bg.dagger_render", // Skill Trees sceptre: "voxygen.element.icons.sceptre", diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 06f2751a85..ed508867fa 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -3,6 +3,7 @@ mod buffs; mod buttons; mod chat; mod crafting; +mod diary; mod esc_menu; mod group; mod hotbar; @@ -18,7 +19,6 @@ mod settings_window; mod skillbar; mod slots; mod social; -mod spell; mod util; pub use hotbar::{SlotContents as HotbarSlotContents, State as HotbarState}; @@ -31,6 +31,7 @@ use buttons::Buttons; use chat::Chat; use chrono::NaiveTime; use crafting::Crafting; +use diary::{Diary, SelectedSkillTree}; use esc_menu::EscMenu; use group::Group; use img_ids::Imgs; @@ -43,7 +44,6 @@ use serde::{Deserialize, Serialize}; use settings_window::{SettingsTab, SettingsWindow}; use skillbar::Skillbar; use social::{Social, SocialTab}; -use spell::{SelectedSkillTree, Spell}; use crate::{ ecs::{comp as vcomp, comp::HpFloaterList}, @@ -60,6 +60,7 @@ use common::{ comp, comp::{ item::{ItemDesc, Quality}, + skills::Skill, BuffKind, }, span, @@ -246,7 +247,7 @@ widget_ids! { bag, social, quest, - spell, + diary, skillbar, buttons, buffs, @@ -384,6 +385,7 @@ pub enum Event { LeaveGroup, AssignLeader(Uid), RemoveBuff(BuffKind), + UnlockSkill(Skill), } // TODO: Are these the possible layouts we want? @@ -453,7 +455,7 @@ pub struct Show { bag: bool, bag_inv: bool, social: bool, - spell: bool, + diary: bool, group: bool, group_menu: bool, esc_menu: bool, @@ -487,7 +489,7 @@ impl Show { self.bag = false; self.crafting = false; self.social = false; - self.spell = false; + self.diary = false; self.want_grab = !open; } } @@ -495,7 +497,7 @@ impl Show { fn social(&mut self, open: bool) { if !self.esc_menu { self.social = open; - self.spell = false; + self.diary = false; self.want_grab = !open; } } @@ -509,13 +511,13 @@ impl Show { } } - fn spell(&mut self, open: bool) { + fn diary(&mut self, open: bool) { if !self.esc_menu { self.social = false; self.crafting = false; self.bag = false; self.map = false; - self.spell = open; + self.diary = open; self.want_grab = !open; } } @@ -534,7 +536,7 @@ impl Show { self.bag = false; self.social = false; self.crafting = false; - self.spell = false; + self.diary = false; self.want_grab = !open; } } @@ -566,7 +568,7 @@ impl Show { || self.map || self.social || self.crafting - || self.spell + || self.diary || self.help || self.intro || !matches!(self.open_windows, Windows::None) @@ -577,7 +579,7 @@ impl Show { self.intro = false; self.map = false; self.social = false; - self.spell = false; + self.diary = false; self.crafting = false; self.open_windows = Windows::None; self.want_grab = true; @@ -605,23 +607,23 @@ impl Show { fn toggle_social(&mut self) { self.social(!self.social); - self.spell = false; + self.diary = false; } fn toggle_crafting(&mut self) { self.crafting(!self.crafting) } fn open_social_tab(&mut self, social_tab: SocialTab) { self.social_tab = social_tab; - self.spell = false; + self.diary = false; } fn toggle_spell(&mut self) { - self.spell = !self.spell; + self.diary = !self.diary; self.bag = false; self.crafting = false; self.social = false; self.map = false; - self.want_grab = !self.spell; + self.want_grab = !self.diary; } fn open_skill_tree(&mut self, tree_sel: SelectedSkillTree) { @@ -750,7 +752,7 @@ impl Hud { crafting: false, ui: true, social: false, - spell: false, + diary: false, group: false, group_menu: false, mini_map: true, @@ -2304,18 +2306,27 @@ impl Hud { } } - // Spellbook - if self.show.spell { - for event in Spell::new(&self.show, client, &self.imgs, &self.fonts, i18n) - .set(self.ids.spell, ui_widgets) + // Diary + if self.show.diary { + for event in Diary::new( + &self.show, + client, + &self.imgs, + &self.fonts, + i18n, + &self.rot_imgs, + tooltip_manager, + ) + .set(self.ids.diary, ui_widgets) { match event { - spell::Event::Close => { - self.show.spell(false); + diary::Event::Close => { + self.show.diary(false); self.show.want_grab = true; self.force_ungrab = false; }, - spell::Event::ChangeWeaponTree(tree_sel) => self.show.open_skill_tree(tree_sel), + diary::Event::ChangeWeaponTree(tree_sel) => self.show.open_skill_tree(tree_sel), + diary::Event::UnlockSkill(skill) => events.push(Event::UnlockSkill(skill)), } } } diff --git a/voxygen/src/hud/spell.rs b/voxygen/src/hud/spell.rs deleted file mode 100644 index 3457cbc532..0000000000 --- a/voxygen/src/hud/spell.rs +++ /dev/null @@ -1,470 +0,0 @@ -use super::{img_ids::Imgs, Show, TEXT_COLOR, UI_HIGHLIGHT_0, UI_MAIN}; -use crate::{i18n::Localization, ui::fonts::Fonts}; -use conrod_core::{ - color, - widget::{self, Button, Image, Rectangle, Text}, - widget_ids, Color, Colorable, Labelable, Positionable, Sizeable, Widget, WidgetCommon, -}; - -use client::{self, Client}; -use inline_tweak::*; - -widget_ids! { - pub struct Ids { - frame, - bg, - icon, - close, - title, - content_align, - weapon_imgs[], - weapon_btns[], - skills_top_l_align, - skills_top_r_align, - skills_bot_l_align, - skills_bot_r_align, - skills_top_l[], - skills_top_r[], - skills_bot_l[], - skills_bot_r[], - sword_render, - sword_skill_0, - sword_sill_1, - - } -} - -#[derive(WidgetCommon)] -pub struct Spell<'a> { - show: &'a Show, - _client: &'a Client, - - imgs: &'a Imgs, - fonts: &'a Fonts, - localized_strings: &'a Localization, - - #[conrod(common_builder)] - common: widget::CommonBuilder, - created_btns_top_l: usize, - created_btns_top_r: usize, - created_btns_bot_l: usize, - created_btns_bot_r: usize, - example_skill_count: usize, -} - -impl<'a> Spell<'a> { - pub fn new( - show: &'a Show, - _client: &'a Client, - imgs: &'a Imgs, - fonts: &'a Fonts, - localized_strings: &'a Localization, - ) -> Self { - Self { - show, - _client, - imgs, - fonts, - localized_strings, - common: widget::CommonBuilder::default(), - created_btns_top_l: 0, - created_btns_top_r: 0, - created_btns_bot_l: 0, - created_btns_bot_r: 0, - example_skill_count: 0, - } - } -} - -/*pub struct State { - ids: Ids, -}*/ - -/*pub enum DiaryTab { - SkillTrees, - Achievements, -}*/ - -pub enum SelectedSkillTree { - None, - Sword, - Hammer, - Axe, - Sceptre, - Bow, - StaffFire, -} - -const WEAPONS: [&str; 6] = ["Sword", "Hammer", "Axe", "Sceptre", "Bow", "Fire Staff"]; - -pub enum Event { - Close, - ChangeWeaponTree(SelectedSkillTree), -} - -impl<'a> Widget for Spell<'a> { - type Event = Vec; - type State = Ids; - type Style = (); - - fn init_state(&self, id_gen: widget::id::Generator) -> Self::State { Ids::new(id_gen) } - - #[allow(clippy::unused_unit)] // TODO: Pending review in #587 - fn style(&self) -> Self::Style { () } - - fn update(mut self, args: widget::UpdateArgs) -> Self::Event { - let widget::UpdateArgs { - id: _, state, ui, .. - } = args; - let mut events = Vec::new(); - let sel_tab = &self.show.skilltreetab; - // Frame - Image::new(self.imgs.diary_bg) - .w_h(1202.0, 886.0) - .mid_top_with_margin_on(ui.window, 5.0) - .color(Some(UI_MAIN)) - .set(state.bg, ui); - - Image::new(self.imgs.diary_frame) - .w_h(1202.0, 886.0) - .middle_of(state.bg) - .color(Some(UI_HIGHLIGHT_0)) - .set(state.frame, ui); - - // Icon - Image::new(self.imgs.spellbook_button) - .w_h(30.0, 27.0) - .top_left_with_margins_on(state.frame, 8.0, 8.0) - .set(state.icon, ui); - - // X-Button - if Button::image(self.imgs.close_button) - .w_h(24.0, 25.0) - .hover_image(self.imgs.close_btn_hover) - .press_image(self.imgs.close_btn_press) - .top_right_with_margins_on(state.frame, 0.0, 0.0) - .set(state.close, ui) - .was_clicked() - { - events.push(Event::Close); - } - - // Title - Text::new(&self.localized_strings.get("hud.diary")) - .mid_top_with_margin_on(state.frame, 3.0) - .font_id(self.fonts.cyri.conrod_id) - .font_size(self.fonts.cyri.scale(29)) - .color(TEXT_COLOR) - .set(state.title, ui); - - // Content Alignment - Rectangle::fill_with([599.0 * 2.0, 419.0 * 2.0], color::TRANSPARENT) - .mid_top_with_margin_on(state.frame, 46.0) - .set(state.content_align, ui); - - // Contents - - // Skill Trees - - // Skill Tree Selection - state.update(|s| { - s.weapon_btns - .resize(WEAPONS.len(), &mut ui.widget_id_generator()) - }); - state.update(|s| { - s.weapon_imgs - .resize(WEAPONS.len(), &mut ui.widget_id_generator()) - }); - for i in WEAPONS.iter().copied().enumerate() { - // Background weapon image - let img = Image::new(match i.1 { - "Sword" => self.imgs.sword, - "Hammer" => self.imgs.hammer, - "Axe" => self.imgs.axe, - "Sceptre" => self.imgs.sceptre, - "Bow" => self.imgs.bow, - "Fire Staff" => self.imgs.staff, - _ => self.imgs.nothing, - }); - - let img = if i.0 == 0 { - img.top_left_with_margins_on(state.content_align, tweak!(10.0), tweak!(5.0)) - } else { - img.down_from(state.weapon_btns[i.0 - 1], tweak!(5.0)) - }; - - img.w_h(tweak!(50.0), tweak!(50.0)) - .set(state.weapon_imgs[i.0], ui); - // Weapon icons - if Button::image(match i.1 { - "Sword" => match sel_tab { - SelectedSkillTree::Sword => self.imgs.wpn_icon_border_pressed, - _ => self.imgs.wpn_icon_border, - }, - "Hammer" => match sel_tab { - SelectedSkillTree::Hammer => self.imgs.wpn_icon_border_pressed, - _ => self.imgs.wpn_icon_border, - }, - "Axe" => match sel_tab { - SelectedSkillTree::Axe => self.imgs.wpn_icon_border_pressed, - _ => self.imgs.wpn_icon_border, - }, - "Sceptre" => match sel_tab { - SelectedSkillTree::Sceptre => self.imgs.wpn_icon_border_pressed, - _ => self.imgs.wpn_icon_border, - }, - "Bow" => match sel_tab { - SelectedSkillTree::Bow => self.imgs.wpn_icon_border_pressed, - _ => self.imgs.wpn_icon_border, - }, - "Fire Staff" => match sel_tab { - SelectedSkillTree::StaffFire => self.imgs.wpn_icon_border_pressed, - _ => self.imgs.wpn_icon_border, - }, - _ => self.imgs.wpn_icon_border, - }) - .w_h(tweak!(50.0), tweak!(50.0)) - .hover_image(match i.1 { - "Sword" => match sel_tab { - SelectedSkillTree::Sword => self.imgs.wpn_icon_border_pressed, - _ => self.imgs.wpn_icon_border_mo, - }, - "Hammer" => match sel_tab { - SelectedSkillTree::Hammer => self.imgs.wpn_icon_border_pressed, - _ => self.imgs.wpn_icon_border_mo, - }, - "Axe" => match sel_tab { - SelectedSkillTree::Axe => self.imgs.wpn_icon_border_pressed, - _ => self.imgs.wpn_icon_border_mo, - }, - "Sceptre" => match sel_tab { - SelectedSkillTree::Sceptre => self.imgs.wpn_icon_border_pressed, - _ => self.imgs.wpn_icon_border_mo, - }, - "Bow" => match sel_tab { - SelectedSkillTree::Bow => self.imgs.wpn_icon_border_pressed, - _ => self.imgs.wpn_icon_border_mo, - }, - "Fire Staff" => match sel_tab { - SelectedSkillTree::StaffFire => self.imgs.wpn_icon_border_pressed, - _ => self.imgs.wpn_icon_border_mo, - }, - _ => self.imgs.wpn_icon_border, - }) - .press_image(match i.1 { - "Sword" => match sel_tab { - SelectedSkillTree::Sword => self.imgs.wpn_icon_border_pressed, - _ => self.imgs.wpn_icon_border_press, - }, - "Hammer" => match sel_tab { - SelectedSkillTree::Hammer => self.imgs.wpn_icon_border_pressed, - _ => self.imgs.wpn_icon_border_press, - }, - "Axe" => match sel_tab { - SelectedSkillTree::Axe => self.imgs.wpn_icon_border_pressed, - _ => self.imgs.wpn_icon_border_press, - }, - "Sceptre" => match sel_tab { - SelectedSkillTree::Sceptre => self.imgs.wpn_icon_border_pressed, - _ => self.imgs.wpn_icon_border_press, - }, - "Bow" => match sel_tab { - SelectedSkillTree::Bow => self.imgs.wpn_icon_border_pressed, - _ => self.imgs.wpn_icon_border_press, - }, - "Fire Staff" => match sel_tab { - SelectedSkillTree::StaffFire => self.imgs.wpn_icon_border_pressed, - _ => self.imgs.wpn_icon_border_press, - }, - _ => self.imgs.wpn_icon_border, - }) - .middle_of(state.weapon_imgs[i.0]) - .set(state.weapon_btns[i.0], ui) - .was_clicked() - { - match i.1 { - "Sword" => events.push(Event::ChangeWeaponTree(SelectedSkillTree::Sword)), - "Hammer" => events.push(Event::ChangeWeaponTree(SelectedSkillTree::Hammer)), - "Axe" => events.push(Event::ChangeWeaponTree(SelectedSkillTree::Axe)), - "Sceptre" => events.push(Event::ChangeWeaponTree(SelectedSkillTree::Sceptre)), - "Bow" => events.push(Event::ChangeWeaponTree(SelectedSkillTree::Bow)), - "Fire Staff" => { - events.push(Event::ChangeWeaponTree(SelectedSkillTree::StaffFire)) - }, - _ => events.push(Event::ChangeWeaponTree(SelectedSkillTree::None)), - } - } - } - - // Skill Trees - // Alignment Placing - let x = tweak!(200.0); - let y = tweak!(100.0); - // Alignment rectangles for skills - Rectangle::fill_with([124.0 * 2.0, 124.0 * 2.0], color::TRANSPARENT) - .top_left_with_margins_on(state.content_align, y, x) - .set(state.skills_top_l_align, ui); - Rectangle::fill_with([124.0 * 2.0, 124.0 * 2.0], color::TRANSPARENT) - .top_right_with_margins_on(state.content_align, y, x) - .set(state.skills_top_r_align, ui); - Rectangle::fill_with([124.0 * 2.0, 124.0 * 2.0], color::TRANSPARENT) - .bottom_left_with_margins_on(state.content_align, y, x) - .set(state.skills_bot_l_align, ui); - Rectangle::fill_with([124.0 * 2.0, 124.0 * 2.0], color::TRANSPARENT) - .bottom_right_with_margins_on(state.content_align, y, x) - .set(state.skills_bot_r_align, ui); - // Number of skills per rectangle per weapon, start counting at 0 - // Maximum of 9 skills/8 indices - let skills_top_l = match sel_tab { - SelectedSkillTree::Sword => 4, - SelectedSkillTree::Bow => 1, - _ => 0, - }; - let skills_top_r = match sel_tab { - SelectedSkillTree::Sword => 5, - _ => 0, - }; - let skills_bot_l = match sel_tab { - SelectedSkillTree::Sword => 3, - SelectedSkillTree::Bow => 2, - _ => 0, - }; - let skills_bot_r = match sel_tab { - SelectedSkillTree::Sword => 1, - _ => 0, - }; - // Update widget id array len - state.update(|s| { - s.skills_top_l - .resize(skills_top_l, &mut ui.widget_id_generator()) - }); - state.update(|s| { - s.skills_top_r - .resize(skills_top_r, &mut ui.widget_id_generator()) - }); - state.update(|s| { - s.skills_bot_l - .resize(skills_bot_l, &mut ui.widget_id_generator()) - }); - state.update(|s| { - s.skills_bot_r - .resize(skills_bot_r, &mut ui.widget_id_generator()) - }); - // Create Background Images to place skill icons on them later - // Create central skill first, others around it: - // - // 5 1 6 - // 3 0 4 - // 8 2 7 - // - // - // TOP-LEFT Skills - while self.created_btns_top_l < skills_top_l { - let mut img = Button::image(self.imgs.wpn_icon_border).w_h(80.0, 80.0); - match self.created_btns_top_l { - 0 => img = img.middle_of(state.skills_top_l_align), // Central Skill - 1 => img = img.up_from(state.skills_top_l[0], 4.0), // 12:00 - 2 => img = img.down_from(state.skills_top_l[0], 4.0), // 6:00 - 3 => img = img.left_from(state.skills_top_l[0], 4.0), // 3:00 - 4 => img = img.right_from(state.skills_top_l[0], 4.0), // 9:00 - 5 => img = img.top_left_with_margins_on(state.skills_top_l[0], -41.0, -41.0), /* 10:30 */ - 6 => img = img.top_right_with_margins_on(state.skills_top_l[0], -41.0, -41.0), /* 1:30 */ - 7 => img = img.bottom_left_with_margins_on(state.skills_top_l[0], -41.0, -41.0), /* 4:30 */ - 8 => img = img.bottom_right_with_margins_on(state.skills_top_l[0], -41.0, -41.0), /* 7:30 */ - _ => {}, - } - img.set(state.skills_top_l[self.created_btns_top_l], ui); - self.created_btns_top_l = self.created_btns_top_l + 1; - } - // TOP-RIGHT Skills - while self.created_btns_top_r < skills_top_r { - let mut img = Button::image(self.imgs.wpn_icon_border).w_h(80.0, 80.0); - match self.created_btns_top_r { - 0 => img = img.middle_of(state.skills_top_r_align), // Central Skill - 1 => img = img.up_from(state.skills_top_r[0], 4.0), // 12:00 - 2 => img = img.down_from(state.skills_top_r[0], 4.0), // 6:00 - 3 => img = img.left_from(state.skills_top_r[0], 4.0), // 3:00 - 4 => img = img.right_from(state.skills_top_r[0], 4.0), // 9:00 - 5 => img = img.top_left_with_margins_on(state.skills_top_r[0], -41.0, -41.0), /* 10:30 */ - 6 => img = img.top_right_with_margins_on(state.skills_top_r[0], -41.0, -41.0), /* 1:30 */ - 7 => img = img.bottom_left_with_margins_on(state.skills_top_r[0], -41.0, -41.0), /* 4:30 */ - 8 => img = img.bottom_right_with_margins_on(state.skills_top_r[0], -41.0, -41.0), /* 7:30 */ - _ => {}, - } - img.set(state.skills_top_r[self.created_btns_top_r], ui); - self.created_btns_top_r = self.created_btns_top_r + 1; - } - // BOTTOM-LEFT Skills - while self.created_btns_bot_l < skills_bot_l { - let mut img = Button::image(self.imgs.wpn_icon_border).w_h(80.0, 80.0); - match self.created_btns_bot_l { - 0 => img = img.middle_of(state.skills_bot_l_align), // Central Skill - 1 => img = img.up_from(state.skills_bot_l[0], 4.0), // 12:00 - 2 => img = img.down_from(state.skills_bot_l[0], 4.0), // 6:00 - 3 => img = img.left_from(state.skills_bot_l[0], 4.0), // 3:00 - 4 => img = img.right_from(state.skills_bot_l[0], 4.0), // 9:00 - 5 => img = img.top_left_with_margins_on(state.skills_bot_l[0], -41.0, -41.0), /* 10:30 */ - 6 => img = img.top_right_with_margins_on(state.skills_bot_l[0], -41.0, -41.0), /* 1:30 */ - 7 => img = img.bottom_left_with_margins_on(state.skills_bot_l[0], -41.0, -41.0), /* 4:30 */ - 8 => img = img.bottom_right_with_margins_on(state.skills_bot_l[0], -41.0, -41.0), /* 7:30 */ - _ => {}, - } - img.set(state.skills_bot_l[self.created_btns_bot_l], ui); - self.created_btns_bot_l = self.created_btns_bot_l + 1; - } - // BOTTOM-RIGHT Skills - while self.created_btns_bot_r < skills_bot_r { - let mut btn = Image::new(self.imgs.wpn_icon_border).w_h(80.0, 80.0); - match self.created_btns_bot_r { - 0 => btn = btn.middle_of(state.skills_bot_r_align), // Central Skill - 1 => btn = btn.up_from(state.skills_bot_r[0], 4.0), // 12:00 - 2 => btn = btn.down_from(state.skills_bot_r[0], 4.0), // 6:00 - 3 => btn = btn.left_from(state.skills_bot_r[0], 4.0), // 3:00 - 4 => btn = btn.right_from(state.skills_bot_r[0], 4.0), // 9:00 - 5 => btn = btn.top_left_with_margins_on(state.skills_bot_r[0], -41.0, -41.0), /* 10:30 */ - 6 => btn = btn.top_right_with_margins_on(state.skills_bot_r[0], -41.0, -41.0), /* 1:30 */ - 7 => btn = btn.bottom_left_with_margins_on(state.skills_bot_r[0], -41.0, -41.0), /* 4:30 */ - 8 => btn = btn.bottom_right_with_margins_on(state.skills_bot_r[0], -41.0, -41.0), /* 7:30 */ - _ => {}, - } - btn.set(state.skills_bot_r[self.created_btns_bot_r], ui); - self.created_btns_bot_r = self.created_btns_bot_r + 1; - } - // Actual Skill-Icons and Functionality - match sel_tab { - SelectedSkillTree::Sword => { - // Sword - // fancy bg art - let art_scale = tweak!(0.6); - Image::new(self.imgs.sword_render) - .w_h(222.0 * art_scale, 818.0 * art_scale) - .middle_of(state.content_align) - .graphics_for(state.content_align) - .color(Some(Color::Rgba(1.0, 1.0, 1.0, tweak!(0.2)))) - .set(state.sword_render, ui); - // Top Left skills - // 5 1 6 - // 3 0 4 - // 8 2 7 - if Button::image(self.imgs.sword_whirlwind) - .w_h(tweak!(74.0), tweak!(74.0)) - .middle_of(state.skills_top_l[0]) - .label(&self.example_skill_count.to_string()) - .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) - .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) - .label_color(TEXT_COLOR) - .label_font_size(self.fonts.cyri.scale(tweak!(16))) - .label_font_id(self.fonts.cyri.conrod_id) - .floating(true) - .set(state.sword_skill_0, ui) - .was_clicked() - { - self.example_skill_count = self.example_skill_count + 1; - }; - }, - _ => {}, - } - - events - } -} diff --git a/voxygen/src/session.rs b/voxygen/src/session.rs index e97bd1e594..a99111c5c6 100644 --- a/voxygen/src/session.rs +++ b/voxygen/src/session.rs @@ -926,6 +926,10 @@ impl PlayState for SessionState { let mut client = self.client.borrow_mut(); client.remove_buff(buff_id); }, + HudEvent::UnlockSkill(skill) => { + let mut client = self.client.borrow_mut(); + client.unlock_skill(skill); + }, HudEvent::UseSlot { slot, bypass_dialog,