process common hotkeys in base state
This commit is contained in:
@@ -17,7 +17,10 @@
|
||||
*/
|
||||
package yugecin.opsudance.core.state;
|
||||
|
||||
import itdelatrisu.opsu.Options;
|
||||
import itdelatrisu.opsu.Utils;
|
||||
import org.newdawn.slick.Graphics;
|
||||
import org.newdawn.slick.Input;
|
||||
import yugecin.opsudance.core.DisplayContainer;
|
||||
import yugecin.opsudance.core.events.EventListener;
|
||||
import yugecin.opsudance.events.ResolutionChangedEvent;
|
||||
@@ -89,6 +92,18 @@ public abstract class BaseOpsuState implements OpsuState, EventListener<Resoluti
|
||||
|
||||
@Override
|
||||
public boolean keyReleased(int key, char c) {
|
||||
if (key == Input.KEY_F7) {
|
||||
Options.setNextFPS(displayContainer);
|
||||
return true;
|
||||
}
|
||||
if (key == Input.KEY_F10) {
|
||||
Options.toggleMouseDisabled();
|
||||
return true;
|
||||
}
|
||||
if (key == Input.KEY_F12) {
|
||||
Utils.takeScreenShot();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -95,6 +95,9 @@ public class ComplexOpsuState extends BaseOpsuState {
|
||||
|
||||
@Override
|
||||
public boolean keyReleased(int key, char c) {
|
||||
if (super.keyReleased(key, c)) {
|
||||
return true;
|
||||
}
|
||||
if (focusedComponent != null) {
|
||||
if (key == Input.KEY_ESCAPE) {
|
||||
focusedComponent.setFocused(false);
|
||||
|
||||
Reference in New Issue
Block a user