diff --git a/voxygen/src/hud/chat.rs b/voxygen/src/hud/chat.rs index 9f4eb67a8b..916a7e4bf5 100644 --- a/voxygen/src/hud/chat.rs +++ b/voxygen/src/hud/chat.rs @@ -3,7 +3,7 @@ use conrod_core::{ input::Key, position::Dimension, text::font::Id as FontId, - widget::{Button, Id, List, Rectangle, Text, TextEdit}, + widget::{Id, Button, List, Rectangle, Text, TextEdit}, widget_ids, Color, Colorable, Positionable, Sizeable, UiCell, Widget, }; use std::collections::VecDeque; @@ -70,12 +70,7 @@ impl Chat { fn scroll_to_bottom(&self, ui_widgets: &mut UiCell) { ui_widgets.scroll_widget(self.ids.message_box, [0.0, std::f64::MAX]); } - pub(super) fn update_layout( - &mut self, - ui_widgets: &mut UiCell, - font: FontId, - imgs: &super::Imgs, - ) -> Option { + pub(super) fn update_layout(&mut self, ui_widgets: &mut UiCell, font: FontId, imgs: &super::Imgs) -> Option { // Maintain scrolling if self.new_messages { self.scroll_new_messages(ui_widgets); @@ -107,13 +102,12 @@ impl Chat { } // Message box - Rectangle::fill([470.0, 160.0]) + Rectangle::fill([470.0, 180.0]) .rgba(0.0, 0.0, 0.0, 0.4) .up_from(self.ids.input, 0.0) .set(self.ids.message_box_bg, ui_widgets); let (mut items, scrollbar) = List::flow_down(self.messages.len()) - .top_left_with_margins_on(self.ids.message_box_bg, 0.0, 5.0) - .w_h(460.0, 160.0) + .middle_of(self.ids.message_box_bg) .scrollbar_next_to() .scrollbar_thickness(18.0) .scrollbar_color(Color::Rgba(0.0, 0.0, 0.0, 1.0)) @@ -123,7 +117,7 @@ impl Chat { Text::new(&self.messages[item.i]) .font_size(14) .font_id(font) - .rgba(1.0, 1.0, 1.0, 1.0), + .rgba(0.86 , 0.86, 0.86, 1.0), ui_widgets, ) } @@ -131,12 +125,12 @@ impl Chat { // Chat Arrow if !self.scrolled_to_bottom(ui_widgets) { if Button::image(imgs.chat_arrow) - .w_h(22.0, 22.0) - .hover_image(imgs.chat_arrow_mo) - .press_image(imgs.chat_arrow_press) - .bottom_right_with_margins_on(self.ids.message_box_bg, 2.0, 2.0) - .set(self.ids.chat_arrow, ui_widgets) - .was_clicked() + .w_h(22.0, 22.0) + .hover_image(imgs.chat_arrow_mo) + .press_image(imgs.chat_arrow_press) + .bottom_right_with_margins_on(self.ids.message_box_bg, 2.0, 2.0) + .set(self.ids.chat_arrow, ui_widgets) + .was_clicked() { self.scroll_to_bottom(ui_widgets); } diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index b92d6dcd06..5c5688be8d 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -7,11 +7,11 @@ use crate::{ }; use common::assets; use conrod_core::{ - color, + color, Color, image::Id as ImgId, text::font::Id as FontId, widget::{Button, Image, Rectangle, Scrollbar, Text}, - widget_ids, Color, Colorable, Labelable, Positionable, Sizeable, Widget, + widget_ids, Colorable, Labelable, Positionable, Sizeable, Widget, }; widget_ids! { @@ -422,7 +422,7 @@ pub struct Hud { //#[inline] //pub fn rgba_bytes(r: u8, g: u8, b: u8, a: f32) -> Color { -//Color::Rgba(r as f32 / 255.0, g as f32 / 255.0, b as f32 / 255.0, a) + //Color::Rgba(r as f32 / 255.0, g as f32 / 255.0, b as f32 / 255.0, a) //} impl Hud { @@ -459,7 +459,7 @@ impl Hud { typing: false, cursor_grabbed: true, settings_tab: SettingsTab::Interface, - show_help: true, + show_help: false, bag_open: false, menu_open: false, map_open: false, @@ -479,11 +479,12 @@ impl Hud { let mut events = Vec::new(); let ref mut ui_widgets = self.ui.set_widgets(); - const TEXT_COLOR: Color = Color::Rgba(1.0, 1.0, 1.0, 1.0); + const TEXT_COLOR: Color = Color::Rgba(0.86, 0.86, 0.86, 0.8); const HP_COLOR: Color = Color::Rgba(0.33, 0.63, 0.0, 1.0); const MANA_COLOR: Color = Color::Rgba(0.42, 0.41, 0.66, 1.0); const XP_COLOR: Color = Color::Rgba(0.59, 0.41, 0.67, 1.0); + if self.show_ui { // Add Bag-Space Button if self.inventorytest_button { @@ -511,7 +512,7 @@ impl Hud { if self.show_help { Image::new(self.imgs.window_frame_2) .top_left_with_margins_on(ui_widgets.window, 5.0, 5.0) - .w_h(300.0, 370.0) + .w_h(300.0, 300.0) .set(self.ids.help_bg, ui_widgets); Text::new( @@ -522,9 +523,6 @@ impl Hud { F1 = Toggle this Window \n\ F2 = Toggle Interface \n\ \n\ - Enter = Open Chat \n\ - Mouse Wheel= Scroll Chat\n\ - \n\ M = Map \n\ B = Bag \n\ L = Quest-Log \n\ @@ -755,6 +753,7 @@ impl Hud { .top_right_with_margins_on(self.ids.health_bar, 5.0, 0.0) .set(self.ids.health_bar_color, ui_widgets); + // Mana Bar Image::new(self.imgs.mana_bar) .w_h(1120.0 / 6.0, 96.0 / 6.0) @@ -767,6 +766,7 @@ impl Hud { .top_left_with_margins_on(self.ids.mana_bar, 5.0, 0.0) .set(self.ids.mana_bar_color, ui_widgets); + // Buffs/Debuffs // Buffs @@ -778,14 +778,14 @@ impl Hud { // Insert actual Level here Text::new("1") .left_from(self.ids.xp_bar, -15.0) - .font_size(10) + .font_size(14) .color(TEXT_COLOR) .set(self.ids.level_text, ui_widgets); // Insert next Level here Text::new("2") .right_from(self.ids.xp_bar, -15.0) - .font_size(10) + .font_size(14) .color(TEXT_COLOR) .set(self.ids.next_level_text, ui_widgets); @@ -1561,39 +1561,39 @@ impl Hud { true } WinEvent::KeyDown(key) if !self.typing => match key { - Key::Map => { + Key::Map => { self.toggle_map(); true } - Key::Bag => { + Key::Bag => { self.toggle_bag(); true } - Key::QuestLog => { + Key::QuestLog => { self.toggle_questlog(); true } - Key::CharacterWindow => { + Key::CharacterWindow => { self.toggle_charwindow(); true } - Key::Social => { + Key::Social => { self.toggle_social(); true } - Key::Spellbook => { + Key::Spellbook => { self.toggle_spellbook(); true } - Key::Settings => { + Key::Settings => { self.toggle_settings(); true } - Key::Help => { + Key::Help => { self.toggle_help(); true } - Key::Interface => { + Key::Interface => { self.toggle_ui(); true } diff --git a/voxygen/src/menu/char_selection/ui.rs b/voxygen/src/menu/char_selection/ui.rs index 8becdd8b24..ffd1b47156 100644 --- a/voxygen/src/menu/char_selection/ui.rs +++ b/voxygen/src/menu/char_selection/ui.rs @@ -345,7 +345,7 @@ pub enum Event { Play, } -const TEXT_COLOR: Color = Color::Rgba(1.0, 1.0, 1.0, 1.0); +const TEXT_COLOR: Color = Color::Rgba(0.86, 0.86, 0.86, 0.8); pub struct CharSelectionUi { ui: Ui, @@ -463,7 +463,7 @@ impl CharSelectionUi { .set(self.ids.test_char_l_button, ui_widgets) .was_clicked() { - self.selected_char_no = Some(1); + self.selected_char_no = Some(1); } // Veloren Logo and Alpha Version @@ -477,7 +477,7 @@ impl CharSelectionUi { .label_x(conrod_core::position::Relative::Scalar(-100.0)) .set(self.ids.v_logo, ui_widgets); - if let Some(no) = self.selected_char_no { + if let Some(no) = self.selected_char_no { // Selection_Window Image::new(self.imgs.selection_window) .w_h(522.0, 722.0) @@ -495,6 +495,7 @@ impl CharSelectionUi { .color(TEXT_COLOR) .set(self.ids.char_level, ui_widgets); + // Selected Character if no == 1 { Image::new(self.imgs.test_char_l_big) @@ -871,11 +872,11 @@ impl CharSelectionUi { Their greatest strengths are their adaptability and intelligence, which makes them allrounders in many fields."; const ORC_DESC: &str = "They are considered brutal, rude and combative. \n\ - But once you gained their trust they will be loyal friends \n\ - that follow a strict code of honor in all of their actions. \n\ - \n\ - Their warriors are masters of melee combat, but their true power \ - comes from the magical rituals of their powerful shamans."; + But once you gained their trust they will be loyal friends \n\ + that follow a strict code of honor in all of their actions. \n\ + \n\ + Their warriors are masters of melee combat, but their true power \ + comes from the magical rituals of their powerful shamans."; const DWARF_DESC: &str = "Smoking chimneys, the sound of countless hammers and hoes. \ Infinite tunnel systems to track down even the last chunk of metal in the ground. \n\ diff --git a/voxygen/src/menu/main/mod.rs b/voxygen/src/menu/main/mod.rs index 0dfe93880d..4b95bb6d46 100644 --- a/voxygen/src/menu/main/mod.rs +++ b/voxygen/src/menu/main/mod.rs @@ -6,7 +6,10 @@ use crate::{ GlobalState, PlayState, PlayStateResult, }; use client::{self, Client}; -use common::clock::Clock; +use common::{ + comp, + clock::Clock, +}; use std::time::Duration; use ui::{Event as MainMenuEvent, MainMenuUi}; use vek::*; @@ -67,12 +70,12 @@ impl PlayState for MainMenuState { Ok(mut socket_adders) => { while let Some(socket_addr) = socket_adders.next() { // TODO: handle error - match Client::new(socket_addr) { + match Client::new(socket_addr, comp::Player::new(username.clone()), Some(comp::Character::test())) { Ok(client) => { return PlayStateResult::Push( Box::new(CharSelectionState::new( &mut global_state.window, - std::rc::Rc::new(std::cell::RefCell::new(client.with_test_state())) // <--- TODO: Remove this + std::rc::Rc::new(std::cell::RefCell::new(client)) // <--- TODO: Remove this )) ); } diff --git a/voxygen/src/menu/main/ui.rs b/voxygen/src/menu/main/ui.rs index c63794a1fb..eaeb8d78bd 100644 --- a/voxygen/src/menu/main/ui.rs +++ b/voxygen/src/menu/main/ui.rs @@ -169,7 +169,7 @@ impl MainMenuUi { }); }; } - const TEXT_COLOR: Color = Color::Rgba(1.0, 1.0, 1.0, 1.0); + const TEXT_COLOR: Color = Color::Rgba(0.94, 0.94, 0.94, 0.8); // Username // TODO: get a lower resolution and cleaner input_bg.png Image::new(self.imgs.input_bg) @@ -249,7 +249,7 @@ impl MainMenuUi { .align_middle_x_of(self.ids.address_bg) .label("Login") .label_color(TEXT_COLOR) - .label_font_size(26) + .label_font_size(28) .label_y(conrod_core::position::Relative::Scalar(5.0)) .set(self.ids.login_button, ui_widgets) .was_clicked()