Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions example_mods/testing123/_merge/data/preferences.brocken-json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[
{
"op": "add",
"path": "/-",
"value": {
"name": "Test Two",
"desc": "Desc2",
"defaultValue": true,
"saveId": "testPref2",
"type": "checkbox",

"script": "NullScript"
}
},
{
"op": "add",
"path": "/-",
"value": {
"name": "Test Number",
"desc": "Desc Number",
"defaultValue": 0.5,

"min": 0.15,
"max": 2.6,
"step": 0.15,
"precision": 3,

"saveId": "testPref3",
"type": "number"
}
},
{
"op": "add",
"path": "/-",
"value": {
"name": "Test Percent",
"desc": "Desc Percent",
"defaultValue": 20,

"min": 0,
"max": 200,

"saveId": "testpref4",
"type": "percent"
}
},
{
"op": "add",
"path": "/-",
"value": {
"name": "Test Enum",
"desc": "Desc Enum",
"defaultValue": "None",
"options": {
"None": "NOTHING FUCK",
"one": "Ass",
"two": "boob",
"three": "funk"
},
"saveId": "testpref5",
"type": "enum"
}
}
]
18 changes: 10 additions & 8 deletions source/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,17 @@ class Main extends Sprite
haxe.Log.trace = funkin.util.logging.AnsiTrace.trace;
funkin.util.logging.AnsiTrace.traceBF();

// George recommends binding the save before FlxGame is created.
Save.load();
// Load default list of preferences
Preferences.loadPreferences(true);

// Load mods to override assets.
// TODO: Replace with loadEnabledMods() once the user can configure the mod list.
funkin.modding.PolymodHandler.loadAllMods();

Preferences.loadPreferences(false);

if (stage != null)
{
init();
Expand Down Expand Up @@ -116,11 +123,7 @@ class Main extends Sprite
FlxG.signals.preUpdate.add(repositionCounters.bind(true));
#end

// George recommends binding the save before FlxGame is created.
Save.load();

#if hxvlc
// Initialize hxvlc's Handle here so the videos are loading faster.
#if hxvlc // Initialize hxvlc's Handle here so the videos are loading faster.
Handle.init();
#end

Expand All @@ -131,9 +134,8 @@ class Main extends Sprite
funkin.Preferences.lockedFramerateFunction = untyped js.Syntax.code("window.requestAnimationFrame");
#end

WindowUtil.setVSyncMode(funkin.Preferences.vsyncMode);

var game:FlxGame = new FlxGame(gameWidth, gameHeight, initialState, Preferences.framerate, Preferences.framerate, skipSplash, startFullscreen);
var game:FlxGame = new FlxGame(gameWidth, gameHeight, initialState, Preferences.getPref("framerate", 160), Preferences.getPref("framerate", 160),
skipSplash, startFullscreen);

// FlxG.game._customSoundTray wants just the class, it calls new from
// create() in there, which gets called when it's added to the stage
Expand Down
15 changes: 5 additions & 10 deletions source/funkin/InitState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,8 @@ class InitState extends FlxState
// Since we don't really need VSync on Android we're gonna forcefully disable it on these signals for now
// This is fixed on SDL3 from what I've heared but that doodoo isn't working poperly for Android
#if android
FlxG.signals.focusLost.add(function() {
WindowUtil.setVSyncMode(lime.ui.WindowVSyncMode.OFF);
});
FlxG.signals.focusGained.add(function() {
WindowUtil.setVSyncMode(lime.ui.WindowVSyncMode.OFF);
});
FlxG.signals.focusLost.add(() -> WindowUtil.setVSyncMode(lime.ui.WindowVSyncMode.OFF));
FlxG.signals.focusGained.add(() -> WindowUtil.setVSyncMode(lime.ui.WindowVSyncMode.OFF));
#end

//
Expand Down Expand Up @@ -246,7 +242,6 @@ class InitState extends FlxState
//
// GAME DATA PARSING
//

// NOTE: Registries must be imported and not referenced with fully qualified names,
// to ensure build macros work properly.
trace('Parsing game data...');
Expand Down Expand Up @@ -570,16 +565,16 @@ class InitState extends FlxState

function defineSong():Null<String>
{
return MacroUtil.getDefine('SONG');
return MacroUtil.getDefineString('SONG');
}

function defineLevel():Null<String>
{
return MacroUtil.getDefine('LEVEL');
return MacroUtil.getDefineString('LEVEL');
}

function defineDifficulty():Null<String>
{
return MacroUtil.getDefine('DIFFICULTY');
return MacroUtil.getDefineString('DIFFICULTY');
}
}
Loading