mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Play sfx on successful repair
This commit is contained in:
parent
aaaa8c13b0
commit
16f53d33ed
@ -1439,6 +1439,8 @@ impl PlayState for SessionState {
|
||||
));
|
||||
}
|
||||
|
||||
let mut has_repaired = false;
|
||||
let sfx_triggers = self.scene.sfx_mgr.triggers.read();
|
||||
// Maintain the UI.
|
||||
for event in hud_events {
|
||||
match event {
|
||||
@ -1836,6 +1838,12 @@ impl PlayState for SessionState {
|
||||
})();
|
||||
slots.unwrap_or_default()
|
||||
};
|
||||
if !has_repaired {
|
||||
let sfx_trigger_item = sfx_triggers
|
||||
.get_key_value(&SfxEvent::from(&InventoryUpdateEvent::Craft));
|
||||
global_state.audio.emit_ui_sfx(sfx_trigger_item, Some(1.0));
|
||||
has_repaired = true
|
||||
};
|
||||
self.client
|
||||
.borrow_mut()
|
||||
.repair_item(item, slots, sprite_pos);
|
||||
|
Loading…
Reference in New Issue
Block a user