From b66c271dfda6e1411dc72866dc2d95dd2f467fe9 Mon Sep 17 00:00:00 2001 From: Pfauenauge Date: Sat, 30 Mar 2019 01:11:10 +0100 Subject: [PATCH] Added chat arrow Former-commit-id: 387bf73af19e23678a9048ab3870665c88ff47b9 --- .gitignore | 2 +- assets/voxygen | 2 +- voxygen/src/hud/mod.rs | 33 +++++++++++++++++++++++++++------ 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 626dbff17e..0371dc57a4 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ /Cargo.lock /*/target/ /*/Cargo.lock -/voxygen/test_assets/ # IntelliJ @@ -20,3 +19,4 @@ # Veloren **/server_conf.toml **/keybinds.toml +assets/voxygen diff --git a/assets/voxygen b/assets/voxygen index e3cdc5c974..29c305b5ad 160000 --- a/assets/voxygen +++ b/assets/voxygen @@ -1 +1 @@ -Subproject commit e3cdc5c97469b099a5acade2e5faa6539caae924 +Subproject commit 29c305b5ad9c8737657ad4d60c4587505eaef51e diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 9015a4cb91..cf671afcd8 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -107,7 +107,8 @@ widget_ids! { questlog_close, questlog_title, - extra, + // Chat-Arrow + chat_arrow, } } @@ -178,24 +179,31 @@ struct Imgs { button_blank: ImgId, button_blue_mo: ImgId, button_blue_press: ImgId, - //Social-Window + // Social-Window social_bg: ImgId, social_icon: ImgId, - //Map-Window + // Map-Window map_bg: ImgId, map_icon: ImgId, map_frame: ImgId, - //Spell Book Window + // Spell Book Window spellbook_bg: ImgId, spellbook_icon: ImgId, - //Char Window + // Char Window charwindow_bg: ImgId, charwindow_icon: ImgId, - //Quest-Log Window + // Quest-Log Window questlog_bg: ImgId, questlog_icon: ImgId, //help //help: ImgId, + // Chat-Arrow + chat_arrow_active: ImgId, + chat_arrow_inactive: ImgId, + chat_arrow_active_mo: ImgId, + chat_arrow_active_press: ImgId, + + } impl Imgs { fn new(ui: &mut Ui, renderer: &mut Renderer) -> Imgs { @@ -293,6 +301,12 @@ impl Imgs { //Quest-Log Window questlog_bg: load("element/misc_backgrounds/small_bg.png"), questlog_icon: load("element/icons/questlog.png"), + + // Chat-Arrows + chat_arrow_active: load("element/buttons/arrow/chat_arrow_active.png"), + chat_arrow_inactive: load("element/buttons/arrow/chat_arrow_inactive.png"), + chat_arrow_active_mo: load("element/buttons/arrow/chat_arrow_active_mo.png"), + chat_arrow_active_press: load("element/buttons/arrow/chat_arrow_active_press.png"), } } } @@ -397,6 +411,13 @@ impl Hud { if let Some(msg) = self.chat.update_layout(ui_widgets, self.font_opensans) { events.push(Event::SendMessage(msg)); } + // Chat Arrow + Button::image(self.imgs.chat_arrow_active) + .w_h(22.0, 22.0) + .hover_image(self.imgs.chat_arrow_active_mo) + .press_image(self.imgs.chat_arrow_active_press) + .bottom_left_with_margins_on(ui_widgets.window, 26.0, 14.0) + .set(self.ids.chat_arrow, ui_widgets); // Help Text if self.show_help {