From 07242644cac44c47adad918f5692d6677b0ab245 Mon Sep 17 00:00:00 2001 From: Monty Marz Date: Sat, 4 Apr 2020 21:51:06 +0000 Subject: [PATCH] Small UI fixes --- assets/voxygen/i18n/de_DE.ron | 4 ++-- assets/voxygen/i18n/en.ron | 7 +------ voxygen/src/hud/bag.rs | 2 -- voxygen/src/hud/mod.rs | 32 +++++++++++++++++++++----------- voxygen/src/menu/main/ui.rs | 2 +- 5 files changed, 25 insertions(+), 22 deletions(-) diff --git a/assets/voxygen/i18n/de_DE.ron b/assets/voxygen/i18n/de_DE.ron index 098ad80e20..d28ae8fc35 100644 --- a/assets/voxygen/i18n/de_DE.ron +++ b/assets/voxygen/i18n/de_DE.ron @@ -10,7 +10,7 @@ /// To add a new language in Veloren, juste write an additional `.ron` file in /// `assets/voxygen/i18n` and that's it! -/// Localization for "global" English +/// Lokalisation für Deutsch/Deutschland VoxygenLocalization( metadata: ( language_name: "Deutsch", @@ -238,7 +238,7 @@ Viel Spaß in der Welt von Veloren, Abenteurer!"#, "hud.settings.zoom_sensitivity": "Zoom Sensibilität", "hud.settings.invert_scroll_zoom": "Scroll-Zoom invertieren", "hud.settings.invert_mouse_y_axis": "Maus Y-Achse invertieren", - "hud.settings.free_look_behavior": "Freie Sicht", + "hud.settings.free_look_behavior": "Freies Umsehen", "hud.settings.view_distance": "Sichtweite", "hud.settings.maximum_fps": "Maximale FPS", diff --git a/assets/voxygen/i18n/en.ron b/assets/voxygen/i18n/en.ron index 987962b814..d1ca9fb2cc 100644 --- a/assets/voxygen/i18n/en.ron +++ b/assets/voxygen/i18n/en.ron @@ -156,17 +156,12 @@ https://account.veloren.net."#, "hud.press_key_to_respawn": r#"Press {key} to respawn at the last campfire you visited."#, // Welcome message - "hud.welcome": r#"Welcome to the Veloren Alpha!, + "hud.welcome": r#"Welcome to the Veloren Alpha! Some tips before you start: -MOST IMPORTANTLY: To set your respawn point type /waypoint into the chat. - -This can also be done when you are already dead! - - Press F1 to see the available key commands. Type /help into the chat to see chat commands diff --git a/voxygen/src/hud/bag.rs b/voxygen/src/hud/bag.rs index 8bb4a2a7d8..0c9708d9ad 100644 --- a/voxygen/src/hud/bag.rs +++ b/voxygen/src/hud/bag.rs @@ -149,9 +149,7 @@ pub enum Event { Stats, Close, } -/* -*/ impl<'a> Widget for Bag<'a> { type Event = Option; type State = State; diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 706f909c90..fe58075ddb 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -42,6 +42,7 @@ use crate::{ use client::{Client, Event as ClientEvent}; use common::{assets::load_expect, comp, terrain::TerrainChunk, vol::RectRasterableVol}; use conrod_core::{ + position::Relative, text::cursor::Index, widget::{self, Button, Image, Rectangle, Text}, widget_ids, Color, Colorable, Labelable, Positionable, Sizeable, Widget, @@ -305,6 +306,7 @@ pub struct Show { impl Show { fn bag(&mut self, open: bool) { self.bag = open; + self.map = false; self.want_grab = !open; } @@ -361,6 +363,8 @@ impl Show { || self.map || self.social || self.spell + || self.help + || self.intro || match self.open_windows { Windows::None => false, _ => true, @@ -368,6 +372,8 @@ impl Show { { self.bag = false; self.esc_menu = false; + self.help = false; + self.intro = false; self.map = false; self.social = false; self.spell = false; @@ -1239,23 +1245,27 @@ impl Hud { if self.show.intro && !self.show.esc_menu && !self.intro_2 { match global_state.settings.gameplay.intro_show { Intro::Show => { - Rectangle::fill_with([800.0, 850.0], Color::Rgba(0.0, 0.0, 0.0, 0.80)) - .top_left_with_margins_on(ui_widgets.window, 180.0, 10.0) - .floating(true) - .set(self.ids.intro_bg, ui_widgets); + Rectangle::fill_with( + [800.0 * 0.8, 850.0 * 0.8], + Color::Rgba(0.0, 0.0, 0.0, 0.80), + ) + .top_left_with_margins_on(ui_widgets.window, 180.0 * 0.8, 10.0 * 0.8) + .floating(true) + .set(self.ids.intro_bg, ui_widgets); Text::new(intro_text) .top_left_with_margins_on(self.ids.intro_bg, 10.0, 10.0) - .font_size(self.fonts.cyri.scale(20)) + .font_size(self.fonts.cyri.scale(16)) .font_id(self.fonts.cyri.conrod_id) .color(TEXT_COLOR) .set(self.ids.intro_text, ui_widgets); if Button::image(self.imgs.button) - .w_h(100.0, 50.0) + .w_h(90.0, 35.0) .mid_bottom_with_margin_on(self.ids.intro_bg, 10.0) .label(&self.voxygen_i18n.get("common.close")) - .label_font_size(self.fonts.cyri.scale(20)) + .label_font_size(self.fonts.cyri.scale(16)) .label_font_id(self.fonts.cyri.conrod_id) .label_color(TEXT_COLOR) + .label_y(Relative::Scalar(4.0)) .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) .set(self.ids.intro_close, ui_widgets) @@ -1550,14 +1560,14 @@ impl Hud { if self.show.help && !self.show.map && !self.show.esc_menu { Image::new(self.imgs.help) .middle_of(ui_widgets.window) - .w_h(1260.0 * 1.2, 519.0 * 1.2) + .w_h(1260.0, 519.0) .set(self.ids.help, ui_widgets); // Show tips - if Button::image(self.imgs.button) + /*if Button::image(self.imgs.button) .w_h(120.0, 50.0) .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) - .label(&self.voxygen_i18n.get("hud.show_tips")) + .label(&self.voxygen_i18n.get("common.close")) .label_font_size(self.fonts.cyri.scale(20)) .label_font_id(self.fonts.cyri.conrod_id) .label_color(TEXT_COLOR) @@ -1569,7 +1579,7 @@ impl Hud { self.show.intro = false; self.intro = false; self.intro_2 = true; - }; + };*/ // X-button if Button::image(self.imgs.close_button) .w_h(40.0, 40.0) diff --git a/voxygen/src/menu/main/ui.rs b/voxygen/src/menu/main/ui.rs index 0ba0007e33..d704d0ab5a 100644 --- a/voxygen/src/menu/main/ui.rs +++ b/voxygen/src/menu/main/ui.rs @@ -534,7 +534,7 @@ impl MainMenuUi { .set(self.ids.password_bg, ui_widgets); for event in TextBox::new(&self.password) .w_h(290.0, 30.0) - .mid_bottom_with_margin_on(self.ids.password_bg, 44.0 / 2.0) + .mid_bottom_with_margin_on(self.ids.password_bg, 17.0) .font_size(self.fonts.cyri.scale(22)) .font_id(self.fonts.cyri.conrod_id) .text_color(TEXT_COLOR)