From 2e09feb426ec3245e92c20a5f600db1def0c515e Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 6 Dec 2021 01:35:55 -0500 Subject: [PATCH] Tweaks to prompt dialog. --- common/src/comp/skillset/mod.rs | 2 +- voxygen/src/hud/mod.rs | 14 ++++++++------ voxygen/src/hud/prompt_dialog.rs | 9 +++++++-- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/common/src/comp/skillset/mod.rs b/common/src/comp/skillset/mod.rs index 42c51d66b9..5ef2e4b325 100644 --- a/common/src/comp/skillset/mod.rs +++ b/common/src/comp/skillset/mod.rs @@ -84,7 +84,7 @@ lazy_static! { let map = SkillTreeMap::load_expect_cloned( "common.skill_trees.skills_skill-groups_manifest", ).0; - map.iter().flat_map(|(sgk, skills)| skills.into_iter().map(move |s| (*s, *sgk))).collect() + map.iter().flat_map(|(sgk, skills)| skills.iter().map(move |s| (*s, *sgk))).collect() }; // Loads the maximum level that a skill can obtain pub static ref SKILL_MAX_LEVEL: HashMap = { diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 0645d3a5e9..97e077b6f1 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -109,6 +109,7 @@ use std::{ sync::Arc, time::{Duration, Instant}, }; +use tracing::warn; use vek::*; const TEXT_COLOR: Color = Color::Rgba(1.0, 1.0, 1.0, 1.0); @@ -909,6 +910,7 @@ impl PromptDialogSettings { self.outcome_via_keypress = Some(outcome); } + #[must_use] pub fn with_no_negative_option(mut self) -> Self { self.negative_option = false; self @@ -1161,13 +1163,13 @@ impl Hud { acquired them. Prerequisites or costs may have changed." }, }; - let common_message = "At least one of your skill groups has been \ - invalidated. You will need to re-assign your skill \ - points to get skills."; - let persistence_error = - format!("{}\n{}", persistence_error, common_message); + + let common_message = "Some of your skill points have been reset. You will \ + need to reassign them."; + + warn!("{}\n{}", persistence_error, common_message); let prompt_dialog = PromptDialogSettings::new( - persistence_error, + format!("{}\n", common_message), Event::AcknowledgePersistenceLoadError, None, ) diff --git a/voxygen/src/hud/prompt_dialog.rs b/voxygen/src/hud/prompt_dialog.rs index 44e32b5b31..a9309ff741 100644 --- a/voxygen/src/hud/prompt_dialog.rs +++ b/voxygen/src/hud/prompt_dialog.rs @@ -143,8 +143,13 @@ impl<'a> Widget for PromptDialog<'a> { self.prompt_dialog_settings.affirmative_event.clone(), )); } - Text::new("Accept") - .bottom_right_with_margins_on(state.ids.accept_key, 5.0, -65.0) + let accept_txt = if self.prompt_dialog_settings.negative_option { + "Accept" + } else { + "Ok" + }; + Text::new(accept_txt) + .bottom_left_with_margins_on(state.ids.accept_key, 4.0, 28.0) .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(18)) .color(TEXT_COLOR)