Debug options are now in the options menu
Also disappear/reappear depending on the devMode bool's state
This commit is contained in:
@@ -42,11 +42,6 @@ class EditorPicker extends MusicBeatSubstate {
|
||||
onClick: function() {
|
||||
CoolUtil.openURL(Flags.URL_WIKI);
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "Debug Options",
|
||||
id: "debugOptions",
|
||||
state: DebugOptions
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -42,11 +42,21 @@ class OptionsMenu extends TreeMenu {
|
||||
desc: 'optionsTree.miscellaneous-desc',
|
||||
suffix: " >",
|
||||
state: MiscOptions
|
||||
},
|
||||
{
|
||||
name: "Debug Options",
|
||||
desc: "debugOptions",
|
||||
suffix: " >",
|
||||
state: DebugOptions
|
||||
}
|
||||
];
|
||||
|
||||
var bg:FlxSprite;
|
||||
|
||||
var addedDebugOptions:Bool = !Options.devMode;
|
||||
var debugModeButton:OptionType;
|
||||
var debugModeIndex:Int = mainOptions.length - 1;
|
||||
|
||||
public override function create() {
|
||||
super.create();
|
||||
|
||||
@@ -99,6 +109,12 @@ class OptionsMenu extends TreeMenu {
|
||||
if (access != null) for (o in parseOptionsFromXML(access)) main.add(o);
|
||||
}
|
||||
}
|
||||
|
||||
doDebugOptionThing();
|
||||
}
|
||||
|
||||
public override function onMenuClose(m:OptionsScreen) {
|
||||
doDebugOptionThing();
|
||||
}
|
||||
|
||||
public function reloadStrings() {
|
||||
@@ -115,6 +131,18 @@ class OptionsMenu extends TreeMenu {
|
||||
super.exit();
|
||||
}
|
||||
|
||||
function doDebugOptionThing() {
|
||||
if ((Options.devMode && !addedDebugOptions) || (!Options.devMode && addedDebugOptions)) {
|
||||
trace((addedDebugOptions ? "remove" : "add") + " option");
|
||||
addedDebugOptions = !addedDebugOptions;
|
||||
if (debugModeButton == null) debugModeButton = main.members[debugModeIndex];
|
||||
if (addedDebugOptions)
|
||||
main.add(debugModeButton);
|
||||
else
|
||||
main.remove(debugModeButton);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* XML STUFF
|
||||
*/
|
||||
|
||||
@@ -113,6 +113,10 @@ class OptionsScreen extends FlxTypedSpriteGroup<OptionType> {
|
||||
|
||||
CoolUtil.playMenuSFX(SCROLL);
|
||||
curSelected = FlxMath.wrap(curSelected + sel, 0, members.length-1);
|
||||
if (members[curSelected] == null) {
|
||||
changeSelection(sel, true);
|
||||
return;
|
||||
}
|
||||
members[curSelected].selected = true;
|
||||
updateMenuDesc();
|
||||
}
|
||||
|
||||
+5
-31
@@ -1,41 +1,15 @@
|
||||
package funkin.editors;
|
||||
package funkin.options.categories;
|
||||
|
||||
import funkin.backend.utils.NativeAPI;
|
||||
import funkin.options.OptionsScreen;
|
||||
import funkin.options.TreeMenu;
|
||||
import funkin.options.type.*;
|
||||
|
||||
class DebugOptions extends TreeMenu {
|
||||
public override function create() {
|
||||
super.create();
|
||||
class DebugOptions extends OptionsScreen {
|
||||
public override function new(title:String, desc:String) {
|
||||
super(title, desc, "DebugOptions.");
|
||||
|
||||
FlxG.camera.fade(0xFF000000, 0.5, true);
|
||||
|
||||
var bg:FlxSprite = new FlxSprite(-80).loadAnimatedGraphic(Paths.image('menus/menuBGBlue'));
|
||||
// bg.scrollFactor.set();
|
||||
bg.scale.set(1.15, 1.15);
|
||||
bg.updateHitbox();
|
||||
bg.screenCenter();
|
||||
bg.scrollFactor.set();
|
||||
bg.antialiasing = true;
|
||||
add(bg);
|
||||
|
||||
main = new DebugOptionsScreen();
|
||||
}
|
||||
}
|
||||
|
||||
class DebugOptionsScreen extends OptionsScreen {
|
||||
public override function new() {
|
||||
prefix = "DebugOptions.";
|
||||
super(translate("title"), translate("desc"), prefix);
|
||||
#if windows
|
||||
add(new TextOption(
|
||||
getName("showConsole"),
|
||||
getDesc("showConsole"),
|
||||
function() {
|
||||
NativeAPI.allocConsole();
|
||||
}));
|
||||
#end
|
||||
function() NativeAPI.allocConsole()));
|
||||
add(new Checkbox(
|
||||
getName("editorsResizable"),
|
||||
getDesc("editorsResizable"),
|
||||
Reference in New Issue
Block a user