Changed item drop sound to play in the panels and not cursor

Changed item drop sound to play in the panels and not cursor
This resolved an issue where dropping item on the ground was playing the inventory drop sound
This commit is contained in:
Collin Smith 2019-03-11 02:14:13 -07:00
parent ad931e0e8e
commit 70fc628fba
3 changed files with 3 additions and 3 deletions

View File

@ -78,9 +78,7 @@ public class Cursor {
}
public void setItem(Item item) {
if (this.item != null) {
Riiablo.audio.play(this.item.base.dropsound, true);
} else if (item != null) {
if (this.item == null && item != null) {
Riiablo.audio.play("item_pickup", true);
}

View File

@ -319,6 +319,7 @@ public class InventoryPanel extends WidgetGroup implements Disposable {
return;
}
Riiablo.audio.play(cursor.base.dropsound, true);
Riiablo.cursor.setItem(item);
item = cursor;
gameScreen.player.setSlot(InventoryPanel.BodyPart.this.bodyLoc, item);

View File

@ -89,6 +89,7 @@ public class ItemGrid extends Group {
Item cursor = Riiablo.cursor.getItem();
if (cursor != null) {
Riiablo.audio.play(cursor.base.dropsound, true);
if (swap != null) {
Riiablo.cursor.setItem(swap.item);
removeActor(swap);