forked from FunkinCrew/Funkin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
88c26f9
commit f86dc69
Showing
7 changed files
with
106 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
package; | ||
|
||
import flixel.FlxSprite; | ||
import flixel.FlxSubState; | ||
|
||
class ControlsSubState extends FlxSubState | ||
{ | ||
public function new() | ||
{ | ||
super(); | ||
|
||
var bullshit = new FlxSprite().makeGraphic(100, 100); | ||
add(bullshit); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package; | ||
|
||
class Options | ||
{ | ||
public static var masterVolume:Float = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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()); | ||
} | ||
} | ||
} | ||
} |