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
No known key found for this signature in database
GPG Key ID: CD80BE9AAEE78097
6 changed files with 7 additions and 10 deletions

View File

@ -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) {

View File

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

View File

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

View File

@ -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)));
}

View File

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

View File

@ -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)
}