From b29343490f51757c8fb1171445058faec7d36c4c Mon Sep 17 00:00:00 2001 From: Pfauenauge90 <44173739+Pfauenauge90@users.noreply.github.com> Date: Tue, 2 Apr 2019 16:25:14 +0200 Subject: [PATCH] disabled chat arrows Former-commit-id: 5a5ea8e7101c16ae780af1fb9b3e6e4ba59a98b4 --- voxygen/src/hud/chat.rs | 32 +++++++++++++-------------- voxygen/src/hud/mod.rs | 49 ++++++++++++++++++++++++++++++----------- voxygen/src/session.rs | 3 +++ 3 files changed, 55 insertions(+), 29 deletions(-) diff --git a/voxygen/src/hud/chat.rs b/voxygen/src/hud/chat.rs index 964e1ae9e6..5202e971c5 100644 --- a/voxygen/src/hud/chat.rs +++ b/voxygen/src/hud/chat.rs @@ -153,23 +153,23 @@ impl Chat { } // Up and Down Arrows => Scroll the chat up/down one row per click; - if Button::image(imgs.chat_arrow_up) - .w_h(22.0, 22.0) - .hover_image(imgs.chat_arrow_up_mo) - .press_image(imgs.chat_arrow_up_press) - .up_from(self.ids.chat_arrow_down, 60.0) - .set(self.ids.chat_arrow_up, ui_widgets) - .was_clicked() - {}; + //if Button::image(imgs.chat_arrow_up) + //.w_h(22.0, 22.0) + //.hover_image(imgs.chat_arrow_up_mo) + //.press_image(imgs.chat_arrow_up_press) + //.up_from(self.ids.chat_arrow_down, 60.0) + //.set(self.ids.chat_arrow_up, ui_widgets) + //.was_clicked() + //{}; - if Button::image(imgs.chat_arrow_down) - .w_h(22.0, 22.0) - .hover_image(imgs.chat_arrow_down_mo) - .press_image(imgs.chat_arrow_down_press) - .bottom_right_with_margins_on(self.ids.message_box_bg, 73.0, 2.0) - .set(self.ids.chat_arrow_down, ui_widgets) - .was_clicked() - {}; + //if Button::image(imgs.chat_arrow_down) + // .w_h(22.0, 22.0) + //.hover_image(imgs.chat_arrow_down_mo) + //.press_image(imgs.chat_arrow_down_press) + //.bottom_right_with_margins_on(self.ids.message_box_bg, 73.0, 2.0) + // .set(self.ids.chat_arrow_down, ui_widgets) + //.was_clicked() + //{}; // If enter is pressed send the current message if ui_widgets diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index ebcb88c584..750a938e3c 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -18,6 +18,9 @@ widget_ids! { struct Ids { // Test bag_space_add, + inventorytest_button, + inventorytest_button_label, + // Bag and Inventory bag, bag_contents, @@ -375,6 +378,7 @@ pub struct Hud { map_open: bool, show_ui: bool, inventory_space: i32, + inventorytest_button: bool, settings_tab: SettingsTab, } @@ -417,6 +421,7 @@ impl Hud { menu_open: false, map_open: false, show_ui: true, + inventorytest_button: false, inventory_space: 8, open_windows: Windows::None, font_metamorph, @@ -430,19 +435,20 @@ impl Hud { if self.show_ui { // Add Bag-Space Button - if Button::image(self.imgs.mmap_button) - .w_h(50.0, 50.0) - .top_right_with_margins_on(ui_widgets.window, 2.0, 2.0) - .label("+1 Space") - .label_font_size(10) - .hover_image(self.imgs.mmap_button_hover) - .press_image(self.imgs.mmap_button_press) - .set(self.ids.bag_space_add, ui_widgets) - .was_clicked() - { - self.inventory_space = self.inventory_space + 1; - }; - + if self.inventorytest_button { + if Button::image(self.imgs.mmap_button) + .w_h(100.0, 100.0) + .middle_of(ui_widgets.window) + .label("+1 Space") + .label_font_size(10) + .hover_image(self.imgs.mmap_button_hover) + .press_image(self.imgs.mmap_button_press) + .set(self.ids.bag_space_add, ui_widgets) + .was_clicked() + { + self.inventory_space = self.inventory_space + 1; + }; + } // Chat box if let Some(msg) = self .chat @@ -855,6 +861,23 @@ impl Hud { .graphics_for(self.ids.button_help) .rgba(220.0, 220.0, 220.0, 0.8) .set(self.ids.show_help_label, ui_widgets); + + self.inventorytest_button = ToggleButton::new( + self.inventorytest_button, + self.imgs.check, + self.imgs.check_checked, + ) + .w_h(288.0 / 24.0, 288.0 / 24.0) + .top_left_with_margins_on(self.ids.rectangle, 40.0, 15.0) + .hover_images(self.imgs.check_checked_mo, self.imgs.check_mo) + .press_images(self.imgs.check_press, self.imgs.check_press) + .set(self.ids.inventorytest_button, ui_widgets); + Text::new("Show Inventory Test Button") + .x_relative_to(self.ids.inventorytest_button, 55.0) + .font_size(12) + .graphics_for(self.ids.inventorytest_button) + .rgba(220.0, 220.0, 220.0, 0.8) + .set(self.ids.inventorytest_button_label, ui_widgets); } //2 Gameplay//////////////// if Button::image(if let SettingsTab::Gameplay = self.settings_tab { diff --git a/voxygen/src/session.rs b/voxygen/src/session.rs index 3a98e51c91..3568c8beef 100644 --- a/voxygen/src/session.rs +++ b/voxygen/src/session.rs @@ -8,6 +8,9 @@ use vek::*; use client::{self, Client}; use common::clock::Clock; +// Convert Input to a valid string +use std::net::ToSocketAddrs; + // Crate use crate::{ hud::{Event as HudEvent, Hud},