strip Input handling

This commit is contained in:
yugecin
2017-05-27 00:37:02 +02:00
parent 42bc11ef75
commit a5efe7e649
18 changed files with 280 additions and 1160 deletions

View File

@@ -17,18 +17,11 @@
*/
package yugecin.opsudance.core.state;
import itdelatrisu.opsu.states.Game;
import itdelatrisu.opsu.ui.UI;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Input;
import yugecin.opsudance.events.BarNotifListener;
import yugecin.opsudance.events.ResolutionChangedListener;
import java.io.StringWriter;
import static yugecin.opsudance.options.Options.*;
import static yugecin.opsudance.core.InstanceContainer.*;
public abstract class BaseOpsuState implements OpsuState, ResolutionChangedListener {
/**
@@ -91,33 +84,11 @@ public abstract class BaseOpsuState implements OpsuState, ResolutionChangedListe
@Override
public boolean keyReleased(int key, char c) {
if (key == Input.KEY_F7) {
OPTION_TARGET_FPS.clickListItem((targetFPSIndex + 1) % targetFPS.length);
BarNotifListener.EVENT.make().onBarNotif(String.format("Frame limiter: %s",
OPTION_TARGET_FPS.getValueString()));
return true;
}
if (key == Input.KEY_F10) {
OPTION_DISABLE_MOUSE_BUTTONS.toggle();
return true;
}
if (key == Input.KEY_F12) {
config.takeScreenShot();
return true;
}
Input input = displayContainer.input;
if (key == Input.KEY_S && input.isKeyDown(Input.KEY_LMENU) && input.isKeyDown(Input.KEY_LSHIFT) &&input.isKeyDown(Input.KEY_LCONTROL) && !displayContainer.isInState(Game.class)) {
skinservice.reloadSkin();
}
return false;
}
@Override
public boolean mouseWheelMoved(int delta) {
if (displayContainer.input.isKeyDown(Input.KEY_LALT) || displayContainer.input.isKeyDown(Input.KEY_RALT)) {
UI.changeVolume((delta < 0) ? -1 : 1);
return true;
}
return false;
}