Play sfx on successful repair

This commit is contained in:
DaforLynx 2023-08-05 18:49:49 +00:00
parent aaaa8c13b0
commit 16f53d33ed

View File

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