From 2b0f6a1d9cc7a4bad918f7cc7920ac503440607c Mon Sep 17 00:00:00 2001 From: timokoesters Date: Fri, 30 Aug 2019 22:46:45 +0200 Subject: [PATCH] Rename activate_inventory_slot to use_inventory_slot --- client/src/lib.rs | 5 ++--- common/src/msg/client.rs | 2 +- server/src/lib.rs | 2 +- voxygen/src/hud/bag.rs | 2 +- voxygen/src/hud/mod.rs | 2 +- voxygen/src/session.rs | 4 +--- 6 files changed, 7 insertions(+), 10 deletions(-) diff --git a/client/src/lib.rs b/client/src/lib.rs index d1b6389d97..285017027f 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -181,9 +181,8 @@ impl Client { // Can't fail } - pub fn activate_inventory_slot(&mut self, x: usize) { - self.postbox - .send_message(ClientMsg::ActivateInventorySlot(x)) + pub fn use_inventory_slot(&mut self, x: usize) { + self.postbox.send_message(ClientMsg::UseInventorySlot(x)) } pub fn swap_inventory_slots(&mut self, a: usize, b: usize) { diff --git a/common/src/msg/client.rs b/common/src/msg/client.rs index b51760d92a..c3639562bd 100644 --- a/common/src/msg/client.rs +++ b/common/src/msg/client.rs @@ -30,7 +30,7 @@ pub enum ClientMsg { vel: comp::Vel, ori: comp::Ori, }, - ActivateInventorySlot(usize), + UseInventorySlot(usize), SwapInventorySlots(usize, usize), DropInventorySlot(usize), PickUp(u64), diff --git a/server/src/lib.rs b/server/src/lib.rs index db39d714fb..fe8ff30ad1 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -712,7 +712,7 @@ impl Server { } _ => {} }, - ClientMsg::ActivateInventorySlot(x) => { + ClientMsg::UseInventorySlot(x) => { let item = state .ecs() .write_storage::() diff --git a/voxygen/src/hud/bag.rs b/voxygen/src/hud/bag.rs index bd3f748165..523dbdc5b0 100644 --- a/voxygen/src/hud/bag.rs +++ b/voxygen/src/hud/bag.rs @@ -153,7 +153,7 @@ impl<'a> Widget for Bag<'a> { let selected_slot = match state.selected_slot { Some(a) => { if a == i { - event = Some(Event::HudEvent(HudEvent::ActivateInventorySlot(i))); + event = Some(Event::HudEvent(HudEvent::UseInventorySlot(i))); } else { event = Some(Event::HudEvent(HudEvent::SwapInventorySlots(a, i))); } diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index b563442933..79731b13a2 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -162,7 +162,7 @@ pub enum Event { ToggleShortcutNumbers(ShortcutNumbers), UiScale(ScaleChange), CharacterSelection, - ActivateInventorySlot(usize), + UseInventorySlot(usize), SwapInventorySlots(usize, usize), DropInventorySlot(usize), Logout, diff --git a/voxygen/src/session.rs b/voxygen/src/session.rs index e7e2fc7c89..b912c99853 100644 --- a/voxygen/src/session.rs +++ b/voxygen/src/session.rs @@ -376,9 +376,7 @@ impl PlayState for SessionState { global_state.settings.graphics.max_fps = fps; global_state.settings.save_to_file_warn(); } - HudEvent::ActivateInventorySlot(x) => { - self.client.borrow_mut().activate_inventory_slot(x) - } + HudEvent::UseInventorySlot(x) => self.client.borrow_mut().use_inventory_slot(x), HudEvent::SwapInventorySlots(a, b) => { self.client.borrow_mut().swap_inventory_slots(a, b) }