Fixed bug where right click would play audio

This commit is contained in:
Collin Smith 2019-01-13 15:31:44 -08:00
parent 4a62b5614d
commit 5977b64fb6

View File

@ -1,5 +1,6 @@
package gdx.diablo.widget;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.assets.AssetDescriptor;
import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.scenes.scene2d.InputEvent;
@ -29,7 +30,9 @@ public class Button extends com.badlogic.gdx.scenes.scene2d.ui.Button implements
@Override
public boolean touchDown(InputEvent event, float x, float y, int pointer, int b) {
if (button == null) {
if (event.getButton() != Input.Buttons.LEFT) {
return super.touchDown(event, x, y, pointer, b);
} else if (button == null) {
Diablo.assets.finishLoadingAsset(buttonDescriptor);
button = Diablo.assets.get(buttonDescriptor);
}