Merge remote-tracking branch 'upstream/main' into new-editors-main
# Conflicts: # commandline/commands/Compiler.hx # source/funkin/backend/FunkinSprite.hx # source/funkin/backend/MusicBeatState.hx # source/funkin/backend/MusicBeatSubstate.hx # source/funkin/backend/chart/Chart.hx # source/funkin/backend/chart/EventsData.hx # source/funkin/backend/scripting/GlobalScript.hx # source/funkin/backend/system/Controls.hx # source/funkin/backend/system/MainState.hx # source/funkin/backend/utils/AudioAnalyzer.hx # source/funkin/backend/utils/CoolUtil.hx # source/funkin/editors/character/CharacterInfoScreen.hx # source/funkin/editors/charter/Charter.hx # source/funkin/editors/charter/CharterSelection.hx # source/funkin/editors/charter/CharterStrumline.hx # source/funkin/editors/charter/CharterStrumlineButton.hx # source/funkin/editors/charter/SongCreationScreen.hx # source/funkin/editors/ui/UIDropDown.hx # source/funkin/editors/ui/UIFileExplorer.hx # source/funkin/game/Note.hx # source/funkin/game/PlayState.hx # source/funkin/game/SplashGroup.hx # source/funkin/game/Stage.hx # source/funkin/game/Strum.hx # source/funkin/menus/FreeplayState.hx # source/funkin/options/Options.hx # source/funkin/options/keybinds/KeybindsOptions.hx
This commit is contained in:
@@ -33,6 +33,7 @@ class Options
|
||||
public static var gameplayShaders:Bool = true;
|
||||
public static var colorHealthBar:Bool = true;
|
||||
public static var lowMemoryMode:Bool = false;
|
||||
public static var devMode:Bool = false;
|
||||
public static var betaUpdates:Bool = false;
|
||||
public static var splashesEnabled:Bool = true;
|
||||
public static var hitWindow:Float = 250;
|
||||
@@ -94,6 +95,8 @@ class Options
|
||||
public static var P1_NOTE_DOWN:Array<FlxKey> = [S];
|
||||
public static var P1_NOTE_UP:Array<FlxKey> = [W];
|
||||
public static var P1_NOTE_RIGHT:Array<FlxKey> = [D];
|
||||
|
||||
// Menus
|
||||
public static var P1_LEFT:Array<FlxKey> = [A];
|
||||
public static var P1_DOWN:Array<FlxKey> = [S];
|
||||
public static var P1_UP:Array<FlxKey> = [W];
|
||||
@@ -101,16 +104,30 @@ class Options
|
||||
public static var P1_ACCEPT:Array<FlxKey> = [ENTER];
|
||||
public static var P1_BACK:Array<FlxKey> = [BACKSPACE];
|
||||
public static var P1_PAUSE:Array<FlxKey> = [ENTER];
|
||||
|
||||
// Misc
|
||||
public static var P1_RESET:Array<FlxKey> = [R];
|
||||
public static var P1_SWITCHMOD:Array<FlxKey> = [TAB];
|
||||
public static var P1_VOLUME_UP:Array<FlxKey> = [];
|
||||
public static var P1_VOLUME_DOWN:Array<FlxKey> = [];
|
||||
public static var P1_VOLUME_MUTE:Array<FlxKey> = [];
|
||||
|
||||
// Debugs
|
||||
public static var P1_DEV_ACCESS:Array<FlxKey> = [SEVEN];
|
||||
public static var P1_DEV_CONSOLE:Array<FlxKey> = [F2];
|
||||
public static var P1_DEV_RELOAD:Array<FlxKey> = [F5];
|
||||
|
||||
/**
|
||||
* PLAYER 2 CONTROLS (ALT)
|
||||
*/
|
||||
* PLAYER 2 CONTROLS (ALT)
|
||||
*/
|
||||
|
||||
// Notes
|
||||
public static var P2_NOTE_LEFT:Array<FlxKey> = [LEFT];
|
||||
public static var P2_NOTE_DOWN:Array<FlxKey> = [DOWN];
|
||||
public static var P2_NOTE_UP:Array<FlxKey> = [UP];
|
||||
public static var P2_NOTE_RIGHT:Array<FlxKey> = [RIGHT];
|
||||
|
||||
// Menus
|
||||
public static var P2_LEFT:Array<FlxKey> = [LEFT];
|
||||
public static var P2_DOWN:Array<FlxKey> = [DOWN];
|
||||
public static var P2_UP:Array<FlxKey> = [UP];
|
||||
@@ -118,16 +135,30 @@ class Options
|
||||
public static var P2_ACCEPT:Array<FlxKey> = [SPACE];
|
||||
public static var P2_BACK:Array<FlxKey> = [ESCAPE];
|
||||
public static var P2_PAUSE:Array<FlxKey> = [ESCAPE];
|
||||
|
||||
// Misc
|
||||
public static var P2_RESET:Array<FlxKey> = [];
|
||||
public static var P2_SWITCHMOD:Array<FlxKey> = [];
|
||||
public static var P2_VOLUME_UP:Array<FlxKey> = [PLUS];
|
||||
public static var P2_VOLUME_DOWN:Array<FlxKey> = [MINUS];
|
||||
public static var P2_VOLUME_MUTE:Array<FlxKey> = [ZERO];
|
||||
|
||||
// Debugs
|
||||
public static var P2_DEV_ACCESS:Array<FlxKey> = [];
|
||||
public static var P2_DEV_CONSOLE:Array<FlxKey> = [];
|
||||
public static var P2_DEV_RELOAD:Array<FlxKey> = [];
|
||||
|
||||
/**
|
||||
* SOLO GETTERS
|
||||
*/
|
||||
* SOLO GETTERS
|
||||
*/
|
||||
|
||||
// Notes
|
||||
public static var SOLO_NOTE_LEFT(get, null):Array<FlxKey>;
|
||||
public static var SOLO_NOTE_DOWN(get, null):Array<FlxKey>;
|
||||
public static var SOLO_NOTE_UP(get, null):Array<FlxKey>;
|
||||
public static var SOLO_NOTE_RIGHT(get, null):Array<FlxKey>;
|
||||
|
||||
// Menus
|
||||
public static var SOLO_LEFT(get, null):Array<FlxKey>;
|
||||
public static var SOLO_DOWN(get, null):Array<FlxKey>;
|
||||
public static var SOLO_UP(get, null):Array<FlxKey>;
|
||||
@@ -135,8 +166,18 @@ class Options
|
||||
public static var SOLO_ACCEPT(get, null):Array<FlxKey>;
|
||||
public static var SOLO_BACK(get, null):Array<FlxKey>;
|
||||
public static var SOLO_PAUSE(get, null):Array<FlxKey>;
|
||||
|
||||
// Misc
|
||||
public static var SOLO_RESET(get, null):Array<FlxKey>;
|
||||
public static var SOLO_SWITCHMOD(get, null):Array<FlxKey>;
|
||||
public static var SOLO_VOLUME_UP(get, null):Array<FlxKey>;
|
||||
public static var SOLO_VOLUME_DOWN(get, null):Array<FlxKey>;
|
||||
public static var SOLO_VOLUME_MUTE(get, null):Array<FlxKey>;
|
||||
|
||||
// Debugs
|
||||
public static var SOLO_DEV_ACCESS(get, null):Array<FlxKey>;
|
||||
public static var SOLO_DEV_CONSOLE(get, null):Array<FlxKey>;
|
||||
public static var SOLO_DEV_RELOAD(get, null):Array<FlxKey>;
|
||||
|
||||
public static function load() {
|
||||
if (__save == null) __save = new FlxSave();
|
||||
@@ -165,6 +206,10 @@ class Options
|
||||
PlayerSettings.solo.setKeyboardScheme(Solo);
|
||||
PlayerSettings.player1.setKeyboardScheme(Duo(true));
|
||||
PlayerSettings.player2.setKeyboardScheme(Duo(false));
|
||||
|
||||
FlxG.sound.volumeUpKeys = SOLO_VOLUME_UP;
|
||||
FlxG.sound.volumeDownKeys = SOLO_VOLUME_DOWN;
|
||||
FlxG.sound.muteKeys = SOLO_VOLUME_MUTE;
|
||||
}
|
||||
|
||||
public static function save() {
|
||||
|
||||
@@ -54,36 +54,24 @@ class OptionsMenu extends TreeMenu {
|
||||
if (o.substate != null) {
|
||||
persistentUpdate = false;
|
||||
persistentDraw = true;
|
||||
if (o.substate is MusicBeatSubstate) {
|
||||
openSubState(o.substate);
|
||||
} else {
|
||||
openSubState(Type.createInstance(o.substate, []));
|
||||
}
|
||||
if (o.substate is MusicBeatSubstate) openSubState(o.substate);
|
||||
else openSubState(Type.createInstance(o.substate, []));
|
||||
} else {
|
||||
if (o.state is OptionsScreen) {
|
||||
optionsTree.add(o.state);
|
||||
} else {
|
||||
optionsTree.add(Type.createInstance(o.state, []));
|
||||
}
|
||||
if (o.state is OptionsScreen) optionsTree.add(o.state);
|
||||
else optionsTree.add(Type.createInstance(o.state, []));
|
||||
}
|
||||
})]);
|
||||
|
||||
var xmlPath = Paths.xml("config/options");
|
||||
for(source in [funkin.backend.assets.AssetsLibraryList.AssetSource.SOURCE, funkin.backend.assets.AssetsLibraryList.AssetSource.MODS]) {
|
||||
if (Paths.assetsTree.existsSpecific(xmlPath, "TEXT", source)) {
|
||||
var access:Access = null;
|
||||
try {
|
||||
access = new Access(Xml.parse(Paths.assetsTree.getSpecificAsset(xmlPath, "TEXT", source)));
|
||||
} catch(e) {
|
||||
Logs.trace('Error while parsing options.xml: ${Std.string(e)}', ERROR);
|
||||
}
|
||||
for (i in funkin.backend.assets.ModsFolder.getLoadedMods()) {
|
||||
var xmlPath = Paths.xml('config/options/LIB_$i');
|
||||
|
||||
if (access != null)
|
||||
for(o in parseOptionsFromXML(access))
|
||||
main.add(o);
|
||||
if (Paths.assetsTree.existsSpecific(xmlPath, "TEXT")) {
|
||||
var access:Access = null;
|
||||
try access = new Access(Xml.parse(Paths.assetsTree.getSpecificAsset(xmlPath, "TEXT")))
|
||||
catch(e) Logs.trace('Error while parsing options.xml: ${Std.string(e)}', ERROR);
|
||||
if (access != null) for (o in parseOptionsFromXML(access)) main.add(o);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public override function exit() {
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package funkin.options.categories;
|
||||
|
||||
|
||||
class MiscOptions extends OptionsScreen {
|
||||
public override function new() {
|
||||
super("Miscellaneous", "Use this menu to reset save data or engine settings.");
|
||||
super("Miscellaneous", "Change some other options like enabling Developer Mode, resetting data...");
|
||||
add(new Checkbox(
|
||||
"Developer Mode",
|
||||
"If checked, you will be able to access developer features like certain keybinds, editors, developer options, state reloads, console and more.",
|
||||
"devMode"));
|
||||
#if UPDATE_CHECKING
|
||||
add(new Checkbox(
|
||||
"Enable Nightly Updates",
|
||||
|
||||
@@ -67,6 +67,23 @@ class KeybindsOptions extends MusicBeatSubstate {
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'Volume',
|
||||
settings: [
|
||||
{
|
||||
name: 'Up',
|
||||
control: 'VOLUME_UP'
|
||||
},
|
||||
{
|
||||
name: 'Down',
|
||||
control: 'VOLUME_DOWN'
|
||||
},
|
||||
{
|
||||
name: 'Mute',
|
||||
control: 'VOLUME_MUTE'
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'Engine',
|
||||
settings: [
|
||||
@@ -75,6 +92,26 @@ class KeybindsOptions extends MusicBeatSubstate {
|
||||
control: 'SWITCHMOD'
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'Developer',
|
||||
devModeOnly: true,
|
||||
settings: [
|
||||
{
|
||||
name: 'Developer Menus',
|
||||
control: 'DEV_ACCESS'
|
||||
},
|
||||
#if GLOBAL_SCRIPT // since theyre integrated into global script - Nex
|
||||
{
|
||||
name: 'Open Console',
|
||||
control: 'DEV_CONSOLE'
|
||||
},
|
||||
{
|
||||
name: 'Reload State',
|
||||
control: 'DEV_RELOAD'
|
||||
},
|
||||
#end
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
@@ -132,7 +169,9 @@ class KeybindsOptions extends MusicBeatSubstate {
|
||||
for (i in customCategories) categories.push(i);
|
||||
|
||||
var k:Int = 0;
|
||||
for(category in categories) {
|
||||
for (category in categories) {
|
||||
if (category.devModeOnly && !Options.devMode) continue;
|
||||
|
||||
k++;
|
||||
var title = new Alphabet(0, k * 75, category.name, true);
|
||||
title.screenCenter(X);
|
||||
@@ -168,6 +207,10 @@ class KeybindsOptions extends MusicBeatSubstate {
|
||||
}
|
||||
add(alphabets);
|
||||
add(camFollow);
|
||||
|
||||
FlxG.sound.volumeUpKeys = [];
|
||||
FlxG.sound.volumeDownKeys = [];
|
||||
FlxG.sound.muteKeys = [];
|
||||
}
|
||||
|
||||
public override function destroy() {
|
||||
@@ -181,10 +224,8 @@ class KeybindsOptions extends MusicBeatSubstate {
|
||||
public override function update(elapsed:Float) {
|
||||
super.update(elapsed);
|
||||
|
||||
|
||||
if (isSubState) {
|
||||
bg.alpha = lerp(bg.alpha, 0.1, 0.125);
|
||||
} else {
|
||||
if (isSubState) bg.alpha = lerp(bg.alpha, 0.1, 0.125);
|
||||
else {
|
||||
if (curSelected < 4) {
|
||||
if (coloredBG.alpha == 0)
|
||||
coloredBG.color = noteColors[curSelected];
|
||||
@@ -200,11 +241,11 @@ class KeybindsOptions extends MusicBeatSubstate {
|
||||
changeSelection((controls.UP_P ? -1 : 0) + (controls.DOWN_P ? 1 : 0));
|
||||
|
||||
if (controls.BACK) {
|
||||
MusicBeatState.skipTransIn = true;
|
||||
if (isSubState)
|
||||
close();
|
||||
else
|
||||
if (isSubState) close();
|
||||
else {
|
||||
MusicBeatState.skipTransIn = true;
|
||||
FlxG.switchState(new OptionsMenu());
|
||||
}
|
||||
ControlsUtil.resetCustomControls();
|
||||
Options.applyKeybinds();
|
||||
ControlsUtil.loadCustomControls();
|
||||
@@ -251,7 +292,7 @@ class KeybindsOptions extends MusicBeatSubstate {
|
||||
var minH = FlxG.height / 2;
|
||||
var maxH = alphabets.members[alphabets.length-1].y + alphabets.members[alphabets.length-1].height - (FlxG.height / 2);
|
||||
if (minH < maxH)
|
||||
camFollow.setPosition(FlxG.width / 2, CoolUtil.bound(alphabet.y + (alphabet.height / 2) - (35), minH, maxH));
|
||||
camFollow.setPosition(FlxG.width / 2, CoolUtil.bound(alphabet.y + (alphabet.height / 2) - 35, minH, maxH));
|
||||
else
|
||||
camFollow.setPosition(FlxG.width / 2, FlxG.height / 2);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,21 @@ class GithubUserIcon extends FlxSprite
|
||||
super.update(elapsed);
|
||||
}
|
||||
|
||||
#if target.threaded
|
||||
final mutex = new sys.thread.Mutex();
|
||||
#end
|
||||
|
||||
inline function acquireMutex() {
|
||||
#if target.threaded
|
||||
mutex.acquire();
|
||||
#end
|
||||
}
|
||||
inline function releaseMutex() {
|
||||
#if target.threaded
|
||||
mutex.release();
|
||||
#end
|
||||
}
|
||||
|
||||
override function drawComplex(camera:FlxCamera):Void { // Making the image download only if the player actually sees it on the screen - Nex
|
||||
if(waitUntilLoad <= 0) {
|
||||
waitUntilLoad = null;
|
||||
@@ -82,19 +96,19 @@ class GithubUserIcon extends FlxSprite
|
||||
}
|
||||
|
||||
if(bmap != null) try {
|
||||
mutex.acquire(); // Avoiding critical section - Nex
|
||||
acquireMutex(); // Avoiding critical section - Nex
|
||||
var leGraphic:FlxGraphic = FlxG.bitmap.add(bmap, false, key);
|
||||
leGraphic.persist = true;
|
||||
updateDaFunni(leGraphic);
|
||||
bmap = null;
|
||||
mutex.release();
|
||||
releaseMutex();
|
||||
} catch(e) {
|
||||
Logs.traceColored([Logs.logText('Failed to update the pfp for ${user.login}: ${e.message}', RED)], ERROR);
|
||||
}
|
||||
} else {
|
||||
mutex.acquire();
|
||||
acquireMutex();
|
||||
updateDaFunni(bmap);
|
||||
mutex.release();
|
||||
releaseMutex();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -14,6 +14,10 @@ class IconOption extends TextOption {
|
||||
|
||||
iconSpr = new HealthIcon(icon, false);
|
||||
iconSpr.setPosition(90 - iconSpr.width, (__text.height - iconSpr.height) / 2);
|
||||
iconSpr.setUnstretchedGraphicSize(150, 150, true);
|
||||
iconSpr.updateHitbox();
|
||||
iconSpr.sprTracker = __text;
|
||||
iconSpr.sprTrackerAlignment = LEFT;
|
||||
add(iconSpr);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package funkin.options.type;
|
||||
|
||||
import flixel.util.FlxColor;
|
||||
import funkin.game.HealthIcon;
|
||||
|
||||
/**
|
||||
* Option type that has a new button, and is green.
|
||||
|
||||
Reference in New Issue
Block a user