Merge pull request #1535 from craftersshaft/creffyspatches
Made keyPressed code less janky and added keyReleased
This commit is contained in:
commit
193fcc398a
@ -3737,25 +3737,22 @@ class PlayState extends MusicBeatState
|
|||||||
var holdArray:Array<Bool> = [controls.LEFT, controls.DOWN, controls.UP, controls.RIGHT];
|
var holdArray:Array<Bool> = [controls.LEFT, controls.DOWN, controls.UP, controls.RIGHT];
|
||||||
var pressArray:Array<Bool> = [controls.LEFT_P, controls.DOWN_P, controls.UP_P, controls.RIGHT_P];
|
var pressArray:Array<Bool> = [controls.LEFT_P, controls.DOWN_P, controls.UP_P, controls.RIGHT_P];
|
||||||
var releaseArray:Array<Bool> = [controls.LEFT_R, controls.DOWN_R, controls.UP_R, controls.RIGHT_R];
|
var releaseArray:Array<Bool> = [controls.LEFT_R, controls.DOWN_R, controls.UP_R, controls.RIGHT_R];
|
||||||
|
var keynameArray:Array<String> = ['left', 'down', 'up', 'right'];
|
||||||
#if windows
|
#if windows
|
||||||
if (luaModchart != null)
|
if (luaModchart != null)
|
||||||
{
|
{
|
||||||
if (controls.LEFT_P)
|
for (i in 0...pressArray.length) {
|
||||||
{
|
if (pressArray[i] == true) {
|
||||||
luaModchart.executeState('keyPressed', ["left"]);
|
luaModchart.executeState('keyPressed', [keynameArray[i]]);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
if (controls.DOWN_P)
|
|
||||||
{
|
for (i in 0...releaseArray.length) {
|
||||||
luaModchart.executeState('keyPressed', ["down"]);
|
if (releaseArray[i] == true) {
|
||||||
};
|
luaModchart.executeState('keyReleased', [keynameArray[i]]);
|
||||||
if (controls.UP_P)
|
}
|
||||||
{
|
|
||||||
luaModchart.executeState('keyPressed', ["up"]);
|
|
||||||
};
|
|
||||||
if (controls.RIGHT_P)
|
|
||||||
{
|
|
||||||
luaModchart.executeState('keyPressed', ["right"]);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user