mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-10-31 20:04:32 +00:00
options menu in progress
This commit is contained in:
parent
88c26f9ca4
commit
f86dc69cde
|
@ -18,7 +18,7 @@
|
|||
<!-- ____________________________ Window Settings ___________________________ -->
|
||||
|
||||
<!--These window settings apply to all targets-->
|
||||
<window width="1280" height="720" fps="60" background="#000000" hardware="true" vsync="false" />
|
||||
<window width="1280" height="720" fps="" background="#000000" hardware="true" vsync="false" />
|
||||
|
||||
<!--HTML5-specific-->
|
||||
<window if="html5" resizable="true" />
|
||||
|
|
Before Width: | Height: | Size: 194 KiB After Width: | Height: | Size: 194 KiB |
|
@ -1,5 +1,6 @@
|
|||
package;
|
||||
|
||||
import flixel.FlxSprite;
|
||||
import flixel.FlxSubState;
|
||||
|
||||
class ControlsSubState extends FlxSubState
|
||||
|
@ -7,5 +8,8 @@ class ControlsSubState extends FlxSubState
|
|||
public function new()
|
||||
{
|
||||
super();
|
||||
|
||||
var bullshit = new FlxSprite().makeGraphic(100, 100);
|
||||
add(bullshit);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ class MainMenuState extends MusicBeatState
|
|||
var menuItems:FlxTypedGroup<FlxSprite>;
|
||||
|
||||
#if !switch
|
||||
var optionShit:Array<String> = ['story mode', 'freeplay', 'donate'];
|
||||
var optionShit:Array<String> = ['story mode', 'freeplay', 'donate', 'options'];
|
||||
#else
|
||||
var optionShit:Array<String> = ['story mode', 'freeplay'];
|
||||
#end
|
||||
|
@ -174,6 +174,8 @@ class MainMenuState extends MusicBeatState
|
|||
trace("Freeplay Menu Selected");
|
||||
|
||||
case 'options':
|
||||
FlxTransitionableState.skipNextTransIn = true;
|
||||
FlxTransitionableState.skipNextTransOut = true;
|
||||
FlxG.switchState(new OptionsMenu());
|
||||
}
|
||||
});
|
||||
|
|
6
source/Options.hx
Normal file
6
source/Options.hx
Normal file
|
@ -0,0 +1,6 @@
|
|||
package;
|
||||
|
||||
class Options
|
||||
{
|
||||
public static var masterVolume:Float = 1;
|
||||
}
|
|
@ -32,44 +32,50 @@ class OptionsMenu extends MusicBeatState
|
|||
menuBG.antialiasing = true;
|
||||
add(menuBG);
|
||||
|
||||
grpControls = new FlxTypedGroup<Alphabet>();
|
||||
add(grpControls);
|
||||
/*
|
||||
grpControls = new FlxTypedGroup<Alphabet>();
|
||||
add(grpControls);
|
||||
|
||||
for (i in 0...controlsStrings.length)
|
||||
{
|
||||
if (controlsStrings[i].indexOf('set') != -1)
|
||||
for (i in 0...controlsStrings.length)
|
||||
{
|
||||
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);
|
||||
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() !!
|
||||
}
|
||||
// DONT PUT X IN THE FIRST PARAMETER OF new ALPHABET() !!
|
||||
}
|
||||
*/
|
||||
|
||||
super.create();
|
||||
|
||||
openSubState(new OptionsSubState());
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
super.update(elapsed);
|
||||
|
||||
if (controls.ACCEPT)
|
||||
{
|
||||
changeBinding();
|
||||
}
|
||||
/*
|
||||
if (controls.ACCEPT)
|
||||
{
|
||||
changeBinding();
|
||||
}
|
||||
|
||||
if (isSettingControl)
|
||||
waitingInput();
|
||||
else
|
||||
{
|
||||
if (controls.BACK)
|
||||
FlxG.switchState(new MainMenuState());
|
||||
if (controls.UP_P)
|
||||
changeSelection(-1);
|
||||
if (controls.DOWN_P)
|
||||
changeSelection(1);
|
||||
}
|
||||
if (isSettingControl)
|
||||
waitingInput();
|
||||
else
|
||||
{
|
||||
if (controls.BACK)
|
||||
FlxG.switchState(new MainMenuState());
|
||||
if (controls.UP_P)
|
||||
changeSelection(-1);
|
||||
if (controls.DOWN_P)
|
||||
changeSelection(1);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
function waitingInput():Void
|
||||
|
|
|
@ -1,11 +1,70 @@
|
|||
package;
|
||||
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.group.FlxGroup.FlxTypedGroup;
|
||||
import flixel.text.FlxText;
|
||||
import flixel.util.FlxColor;
|
||||
|
||||
class OptionsSubState extends MusicBeatSubstate
|
||||
{
|
||||
var textMenuItems:Array<String> = ['Master Volume', 'Sound Volume'];
|
||||
var textMenuItems:Array<String> = ['Master Volume', 'Sound Volume', 'Controls'];
|
||||
|
||||
var selector:FlxSprite;
|
||||
var curSelected:Int = 0;
|
||||
|
||||
var grpOptionsTexts:FlxTypedGroup<FlxText>;
|
||||
|
||||
public function new()
|
||||
{
|
||||
super();
|
||||
|
||||
grpOptionsTexts = new FlxTypedGroup<FlxText>();
|
||||
add(grpOptionsTexts);
|
||||
|
||||
selector = new FlxSprite().makeGraphic(5, 5, FlxColor.RED);
|
||||
add(selector);
|
||||
|
||||
for (i in 0...textMenuItems.length)
|
||||
{
|
||||
var optionText:FlxText = new FlxText(20, 20 + (i * 50), 0, textMenuItems[i], 32);
|
||||
optionText.ID = i;
|
||||
grpOptionsTexts.add(optionText);
|
||||
}
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
super.update(elapsed);
|
||||
|
||||
if (controls.UP_P)
|
||||
curSelected -= 1;
|
||||
|
||||
if (controls.DOWN_P)
|
||||
curSelected += 1;
|
||||
|
||||
if (curSelected < 0)
|
||||
curSelected = textMenuItems.length - 1;
|
||||
|
||||
if (curSelected >= textMenuItems.length)
|
||||
curSelected = 0;
|
||||
|
||||
grpOptionsTexts.forEach(function(txt:FlxText)
|
||||
{
|
||||
txt.color = FlxColor.WHITE;
|
||||
|
||||
if (txt.ID == curSelected)
|
||||
txt.color = FlxColor.YELLOW;
|
||||
});
|
||||
|
||||
if (controls.ACCEPT)
|
||||
{
|
||||
switch (textMenuItems[curSelected])
|
||||
{
|
||||
case "Controls":
|
||||
FlxG.state.closeSubState();
|
||||
FlxG.state.openSubState(new ControlsSubState());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue