mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'DaforLynx/repair_sfx' into 'master'
Play sfx on successful repair See merge request veloren/veloren!4062
This commit is contained in:
commit
3ddc3f5f72
@ -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.
|
// Maintain the UI.
|
||||||
for event in hud_events {
|
for event in hud_events {
|
||||||
match event {
|
match event {
|
||||||
@ -1836,6 +1838,12 @@ impl PlayState for SessionState {
|
|||||||
})();
|
})();
|
||||||
slots.unwrap_or_default()
|
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
|
self.client
|
||||||
.borrow_mut()
|
.borrow_mut()
|
||||||
.repair_item(item, slots, sprite_pos);
|
.repair_item(item, slots, sprite_pos);
|
||||||
|
Loading…
Reference in New Issue
Block a user