Merge branch 'fix-ghost-item' into 'master'

Fix ghost item when trade gets declined

Closes #1429

See merge request veloren/veloren!3117
This commit is contained in:
Imbris 2022-01-30 17:31:15 +00:00
commit 21cad12272
2 changed files with 4 additions and 0 deletions

View File

@ -4166,6 +4166,9 @@ impl Hud {
events
}
#[inline]
pub fn clear_cursor(&mut self) { self.slot_manager.idle(); }
pub fn render<'a>(&'a self, drawer: &mut UiDrawer<'_, 'a>) {
span!(_guard, "render", "Hud::render");
// Don't show anything if the UI is toggled off.

View File

@ -225,6 +225,7 @@ impl SessionState {
self.hud.new_message(ChatType::Meta.chat_msg(msg));
},
client::Event::TradeComplete { result, trade: _ } => {
self.hud.clear_cursor();
let i18n = global_state.i18n.read();
let msg = match result {
TradeResult::Completed => i18n.get("hud.trade.result.completed"),