Merge branch 'pfau/small_ui_fixes' into 'master'

Small UI fixes

See merge request veloren/veloren!888
This commit is contained in:
Monty Marz 2020-04-04 21:51:06 +00:00
commit 32db0df208
5 changed files with 25 additions and 22 deletions

View File

@ -10,7 +10,7 @@
/// To add a new language in Veloren, juste write an additional `.ron` file in /// To add a new language in Veloren, juste write an additional `.ron` file in
/// `assets/voxygen/i18n` and that's it! /// `assets/voxygen/i18n` and that's it!
/// Localization for "global" English /// Lokalisation für Deutsch/Deutschland
VoxygenLocalization( VoxygenLocalization(
metadata: ( metadata: (
language_name: "Deutsch", language_name: "Deutsch",
@ -238,7 +238,7 @@ Viel Spaß in der Welt von Veloren, Abenteurer!"#,
"hud.settings.zoom_sensitivity": "Zoom Sensibilität", "hud.settings.zoom_sensitivity": "Zoom Sensibilität",
"hud.settings.invert_scroll_zoom": "Scroll-Zoom invertieren", "hud.settings.invert_scroll_zoom": "Scroll-Zoom invertieren",
"hud.settings.invert_mouse_y_axis": "Maus Y-Achse 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.view_distance": "Sichtweite",
"hud.settings.maximum_fps": "Maximale FPS", "hud.settings.maximum_fps": "Maximale FPS",

View File

@ -156,17 +156,12 @@ https://account.veloren.net."#,
"hud.press_key_to_respawn": r#"Press {key} to respawn at the last campfire you visited."#, "hud.press_key_to_respawn": r#"Press {key} to respawn at the last campfire you visited."#,
// Welcome message // Welcome message
"hud.welcome": r#"Welcome to the Veloren Alpha!, "hud.welcome": r#"Welcome to the Veloren Alpha!
Some tips before you start: 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. Press F1 to see the available key commands.
Type /help into the chat to see chat commands Type /help into the chat to see chat commands

View File

@ -149,9 +149,7 @@ pub enum Event {
Stats, Stats,
Close, Close,
} }
/*
*/
impl<'a> Widget for Bag<'a> { impl<'a> Widget for Bag<'a> {
type Event = Option<Event>; type Event = Option<Event>;
type State = State; type State = State;

View File

@ -42,6 +42,7 @@ use crate::{
use client::{Client, Event as ClientEvent}; use client::{Client, Event as ClientEvent};
use common::{assets::load_expect, comp, terrain::TerrainChunk, vol::RectRasterableVol}; use common::{assets::load_expect, comp, terrain::TerrainChunk, vol::RectRasterableVol};
use conrod_core::{ use conrod_core::{
position::Relative,
text::cursor::Index, text::cursor::Index,
widget::{self, Button, Image, Rectangle, Text}, widget::{self, Button, Image, Rectangle, Text},
widget_ids, Color, Colorable, Labelable, Positionable, Sizeable, Widget, widget_ids, Color, Colorable, Labelable, Positionable, Sizeable, Widget,
@ -305,6 +306,7 @@ pub struct Show {
impl Show { impl Show {
fn bag(&mut self, open: bool) { fn bag(&mut self, open: bool) {
self.bag = open; self.bag = open;
self.map = false;
self.want_grab = !open; self.want_grab = !open;
} }
@ -361,6 +363,8 @@ impl Show {
|| self.map || self.map
|| self.social || self.social
|| self.spell || self.spell
|| self.help
|| self.intro
|| match self.open_windows { || match self.open_windows {
Windows::None => false, Windows::None => false,
_ => true, _ => true,
@ -368,6 +372,8 @@ impl Show {
{ {
self.bag = false; self.bag = false;
self.esc_menu = false; self.esc_menu = false;
self.help = false;
self.intro = false;
self.map = false; self.map = false;
self.social = false; self.social = false;
self.spell = false; self.spell = false;
@ -1239,23 +1245,27 @@ impl Hud {
if self.show.intro && !self.show.esc_menu && !self.intro_2 { if self.show.intro && !self.show.esc_menu && !self.intro_2 {
match global_state.settings.gameplay.intro_show { match global_state.settings.gameplay.intro_show {
Intro::Show => { Intro::Show => {
Rectangle::fill_with([800.0, 850.0], Color::Rgba(0.0, 0.0, 0.0, 0.80)) Rectangle::fill_with(
.top_left_with_margins_on(ui_widgets.window, 180.0, 10.0) [800.0 * 0.8, 850.0 * 0.8],
.floating(true) Color::Rgba(0.0, 0.0, 0.0, 0.80),
.set(self.ids.intro_bg, ui_widgets); )
.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) Text::new(intro_text)
.top_left_with_margins_on(self.ids.intro_bg, 10.0, 10.0) .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) .font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR) .color(TEXT_COLOR)
.set(self.ids.intro_text, ui_widgets); .set(self.ids.intro_text, ui_widgets);
if Button::image(self.imgs.button) 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) .mid_bottom_with_margin_on(self.ids.intro_bg, 10.0)
.label(&self.voxygen_i18n.get("common.close")) .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_font_id(self.fonts.cyri.conrod_id)
.label_color(TEXT_COLOR) .label_color(TEXT_COLOR)
.label_y(Relative::Scalar(4.0))
.hover_image(self.imgs.button_hover) .hover_image(self.imgs.button_hover)
.press_image(self.imgs.button_press) .press_image(self.imgs.button_press)
.set(self.ids.intro_close, ui_widgets) .set(self.ids.intro_close, ui_widgets)
@ -1550,14 +1560,14 @@ impl Hud {
if self.show.help && !self.show.map && !self.show.esc_menu { if self.show.help && !self.show.map && !self.show.esc_menu {
Image::new(self.imgs.help) Image::new(self.imgs.help)
.middle_of(ui_widgets.window) .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); .set(self.ids.help, ui_widgets);
// Show tips // Show tips
if Button::image(self.imgs.button) /*if Button::image(self.imgs.button)
.w_h(120.0, 50.0) .w_h(120.0, 50.0)
.hover_image(self.imgs.button_hover) .hover_image(self.imgs.button_hover)
.press_image(self.imgs.button_press) .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_size(self.fonts.cyri.scale(20))
.label_font_id(self.fonts.cyri.conrod_id) .label_font_id(self.fonts.cyri.conrod_id)
.label_color(TEXT_COLOR) .label_color(TEXT_COLOR)
@ -1569,7 +1579,7 @@ impl Hud {
self.show.intro = false; self.show.intro = false;
self.intro = false; self.intro = false;
self.intro_2 = true; self.intro_2 = true;
}; };*/
// X-button // X-button
if Button::image(self.imgs.close_button) if Button::image(self.imgs.close_button)
.w_h(40.0, 40.0) .w_h(40.0, 40.0)

View File

@ -534,7 +534,7 @@ impl MainMenuUi {
.set(self.ids.password_bg, ui_widgets); .set(self.ids.password_bg, ui_widgets);
for event in TextBox::new(&self.password) for event in TextBox::new(&self.password)
.w_h(290.0, 30.0) .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_size(self.fonts.cyri.scale(22))
.font_id(self.fonts.cyri.conrod_id) .font_id(self.fonts.cyri.conrod_id)
.text_color(TEXT_COLOR) .text_color(TEXT_COLOR)