Rename activate_inventory_slot to use_inventory_slot

This commit is contained in:
timokoesters
2019-08-30 22:46:45 +02:00
parent 5d02d32ec6
commit bd8e71c5aa
6 changed files with 7 additions and 10 deletions

View File

@ -181,9 +181,8 @@ impl Client {
// Can't fail // Can't fail
} }
pub fn activate_inventory_slot(&mut self, x: usize) { pub fn use_inventory_slot(&mut self, x: usize) {
self.postbox self.postbox.send_message(ClientMsg::UseInventorySlot(x))
.send_message(ClientMsg::ActivateInventorySlot(x))
} }
pub fn swap_inventory_slots(&mut self, a: usize, b: usize) { pub fn swap_inventory_slots(&mut self, a: usize, b: usize) {

View File

@ -30,7 +30,7 @@ pub enum ClientMsg {
vel: comp::Vel, vel: comp::Vel,
ori: comp::Ori, ori: comp::Ori,
}, },
ActivateInventorySlot(usize), UseInventorySlot(usize),
SwapInventorySlots(usize, usize), SwapInventorySlots(usize, usize),
DropInventorySlot(usize), DropInventorySlot(usize),
PickUp(u64), PickUp(u64),

View File

@ -712,7 +712,7 @@ impl Server {
} }
_ => {} _ => {}
}, },
ClientMsg::ActivateInventorySlot(x) => { ClientMsg::UseInventorySlot(x) => {
let item = state let item = state
.ecs() .ecs()
.write_storage::<comp::Inventory>() .write_storage::<comp::Inventory>()

View File

@ -153,7 +153,7 @@ impl<'a> Widget for Bag<'a> {
let selected_slot = match state.selected_slot { let selected_slot = match state.selected_slot {
Some(a) => { Some(a) => {
if a == i { if a == i {
event = Some(Event::HudEvent(HudEvent::ActivateInventorySlot(i))); event = Some(Event::HudEvent(HudEvent::UseInventorySlot(i)));
} else { } else {
event = Some(Event::HudEvent(HudEvent::SwapInventorySlots(a, i))); event = Some(Event::HudEvent(HudEvent::SwapInventorySlots(a, i)));
} }

View File

@ -162,7 +162,7 @@ pub enum Event {
ToggleShortcutNumbers(ShortcutNumbers), ToggleShortcutNumbers(ShortcutNumbers),
UiScale(ScaleChange), UiScale(ScaleChange),
CharacterSelection, CharacterSelection,
ActivateInventorySlot(usize), UseInventorySlot(usize),
SwapInventorySlots(usize, usize), SwapInventorySlots(usize, usize),
DropInventorySlot(usize), DropInventorySlot(usize),
Logout, Logout,

View File

@ -376,9 +376,7 @@ impl PlayState for SessionState {
global_state.settings.graphics.max_fps = fps; global_state.settings.graphics.max_fps = fps;
global_state.settings.save_to_file_warn(); global_state.settings.save_to_file_warn();
} }
HudEvent::ActivateInventorySlot(x) => { HudEvent::UseInventorySlot(x) => self.client.borrow_mut().use_inventory_slot(x),
self.client.borrow_mut().activate_inventory_slot(x)
}
HudEvent::SwapInventorySlots(a, b) => { HudEvent::SwapInventorySlots(a, b) => {
self.client.borrow_mut().swap_inventory_slots(a, b) self.client.borrow_mut().swap_inventory_slots(a, b)
} }