2020-11-06 09:57:00 +00:00
|
|
|
package;
|
|
|
|
|
2021-01-30 11:27:11 +00:00
|
|
|
import Controls.Control;
|
2021-01-27 08:58:58 +00:00
|
|
|
import flash.text.TextField;
|
2020-11-06 09:57:00 +00:00
|
|
|
import flixel.FlxG;
|
|
|
|
import flixel.FlxSprite;
|
2021-01-27 08:58:58 +00:00
|
|
|
import flixel.addons.display.FlxGridOverlay;
|
|
|
|
import flixel.group.FlxGroup.FlxTypedGroup;
|
2021-01-30 11:27:11 +00:00
|
|
|
import flixel.input.keyboard.FlxKey;
|
2021-01-27 08:58:58 +00:00
|
|
|
import flixel.math.FlxMath;
|
|
|
|
import flixel.text.FlxText;
|
2020-11-06 09:57:00 +00:00
|
|
|
import flixel.util.FlxColor;
|
2021-01-27 08:58:58 +00:00
|
|
|
import lime.utils.Assets;
|
2021-01-30 11:27:11 +00:00
|
|
|
|
2021-02-24 00:59:36 +00:00
|
|
|
class OptionsMenu_old extends MusicBeatState
|
2020-11-06 09:57:00 +00:00
|
|
|
{
|
2021-01-27 08:58:58 +00:00
|
|
|
var selector:FlxText;
|
|
|
|
var curSelected:Int = 0;
|
|
|
|
|
|
|
|
var controlsStrings:Array<String> = [];
|
|
|
|
|
|
|
|
private var grpControls:FlxTypedGroup<Alphabet>;
|
2021-01-30 11:27:11 +00:00
|
|
|
|
2020-11-06 09:57:00 +00:00
|
|
|
override function create()
|
|
|
|
{
|
2021-02-08 21:34:48 +00:00
|
|
|
var menuBG:FlxSprite = new FlxSprite().loadGraphic(Paths.image('menuDesat'));
|
2021-02-10 20:18:14 +00:00
|
|
|
controlsStrings = CoolUtil.coolTextFile(Paths.txt('controls'));
|
2020-11-06 09:57:00 +00:00
|
|
|
menuBG.color = 0xFFea71fd;
|
|
|
|
menuBG.setGraphicSize(Std.int(menuBG.width * 1.1));
|
|
|
|
menuBG.updateHitbox();
|
|
|
|
menuBG.screenCenter();
|
|
|
|
menuBG.antialiasing = true;
|
|
|
|
add(menuBG);
|
|
|
|
|
2021-02-24 23:32:51 +00:00
|
|
|
/*
|
|
|
|
grpControls = new FlxTypedGroup<Alphabet>();
|
|
|
|
add(grpControls);
|
2021-01-30 11:27:11 +00:00
|
|
|
|
2021-02-24 23:32:51 +00:00
|
|
|
for (i in 0...controlsStrings.length)
|
2021-01-30 11:27:11 +00:00
|
|
|
{
|
2021-02-24 23:32:51 +00:00
|
|
|
if (controlsStrings[i].indexOf('set') != -1)
|
|
|
|
{
|
|
|
|
var controlLabel:Alphabet = new Alphabet(0, (70 * i) + 30, controlsStrings[i].substring(3) + ': ' + controlsStrings[i + 1], true, false);
|
|
|
|
controlLabel.isMenuItem = true;
|
|
|
|
controlLabel.targetY = i;
|
|
|
|
grpControls.add(controlLabel);
|
|
|
|
}
|
|
|
|
// DONT PUT X IN THE FIRST PARAMETER OF new ALPHABET() !!
|
2021-01-27 08:58:58 +00:00
|
|
|
}
|
2021-02-24 23:32:51 +00:00
|
|
|
*/
|
2021-01-27 08:58:58 +00:00
|
|
|
|
2020-11-06 09:57:00 +00:00
|
|
|
super.create();
|
2021-02-24 23:32:51 +00:00
|
|
|
|
|
|
|
openSubState(new OptionsSubState());
|
2020-11-06 09:57:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
override function update(elapsed:Float)
|
|
|
|
{
|
2021-01-27 08:58:58 +00:00
|
|
|
super.update(elapsed);
|
|
|
|
|
2021-02-24 23:32:51 +00:00
|
|
|
/*
|
|
|
|
if (controls.ACCEPT)
|
|
|
|
{
|
|
|
|
changeBinding();
|
|
|
|
}
|
2021-01-30 11:27:11 +00:00
|
|
|
|
2021-02-24 23:32:51 +00:00
|
|
|
if (isSettingControl)
|
|
|
|
waitingInput();
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (controls.BACK)
|
|
|
|
FlxG.switchState(new MainMenuState());
|
|
|
|
if (controls.UP_P)
|
|
|
|
changeSelection(-1);
|
|
|
|
if (controls.DOWN_P)
|
|
|
|
changeSelection(1);
|
|
|
|
}
|
|
|
|
*/
|
2021-01-30 11:27:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function waitingInput():Void
|
|
|
|
{
|
|
|
|
if (FlxG.keys.getIsDown().length > 0)
|
|
|
|
{
|
2021-03-23 02:39:35 +00:00
|
|
|
// PlayerSettings.player1.controls.replaceBinding(Control.LEFT, Keys, FlxG.keys.getIsDown()[0].ID, null);
|
2021-01-30 11:27:11 +00:00
|
|
|
}
|
|
|
|
// PlayerSettings.player1.controls.replaceBinding(Control)
|
|
|
|
}
|
|
|
|
|
|
|
|
var isSettingControl:Bool = false;
|
|
|
|
|
|
|
|
function changeBinding():Void
|
|
|
|
{
|
|
|
|
if (!isSettingControl)
|
|
|
|
{
|
|
|
|
isSettingControl = true;
|
|
|
|
}
|
2020-11-06 09:57:00 +00:00
|
|
|
}
|
2021-01-27 08:58:58 +00:00
|
|
|
|
|
|
|
function changeSelection(change:Int = 0)
|
2021-01-30 11:27:11 +00:00
|
|
|
{
|
|
|
|
NGio.logEvent('Fresh');
|
|
|
|
|
2021-02-08 21:34:48 +00:00
|
|
|
FlxG.sound.play(Paths.sound('scrollMenu'), 0.4);
|
2021-01-30 11:27:11 +00:00
|
|
|
|
|
|
|
curSelected += change;
|
|
|
|
|
|
|
|
if (curSelected < 0)
|
|
|
|
curSelected = grpControls.length - 1;
|
|
|
|
if (curSelected >= grpControls.length)
|
|
|
|
curSelected = 0;
|
|
|
|
|
|
|
|
// selector.y = (70 * curSelected) + 30;
|
|
|
|
|
|
|
|
var bullShit:Int = 0;
|
|
|
|
|
|
|
|
for (item in grpControls.members)
|
2021-01-27 08:58:58 +00:00
|
|
|
{
|
2021-01-30 11:27:11 +00:00
|
|
|
item.targetY = bullShit - curSelected;
|
|
|
|
bullShit++;
|
|
|
|
|
|
|
|
item.alpha = 0.6;
|
|
|
|
// item.setGraphicSize(Std.int(item.width * 0.8));
|
|
|
|
|
|
|
|
if (item.targetY == 0)
|
2021-01-27 08:58:58 +00:00
|
|
|
{
|
2021-01-30 11:27:11 +00:00
|
|
|
item.alpha = 1;
|
|
|
|
// item.setGraphicSize(Std.int(item.width));
|
2021-01-27 08:58:58 +00:00
|
|
|
}
|
|
|
|
}
|
2021-01-30 11:27:11 +00:00
|
|
|
}
|
2020-11-06 09:57:00 +00:00
|
|
|
}
|