This repository has been archived by the owner on Aug 28, 2022. It is now read-only.
generated from ShadowMario/FNF-PsychEngine
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Showing
6 changed files
with
214 additions
and
31 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
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,149 @@ | ||
package; | ||
|
||
import Data; | ||
import flixel.FlxState; | ||
import flixel.FlxG; | ||
import GameMenuState; | ||
import flixel.util.FlxSave; | ||
|
||
class FakeData { | ||
public static var downScroll:Bool = false; | ||
public static var middleScroll:Bool = false; | ||
public static var showFPS:Bool = true; | ||
public static var flashing:Bool = true; | ||
public static var globalAntialiasing:Bool = true; | ||
public static var noteSplashes:Bool = true; | ||
public static var lowQuality:Bool = false; | ||
public static var framerate:Int = 60; | ||
public static var cursing:Bool = true; | ||
public static var violence:Bool = true; | ||
public static var camZooms:Bool = true; | ||
public static var hideHud:Bool = false; | ||
public static var noteOffset:Int = 0; | ||
public static var arrowHSV:Array<Array<Int>> = [[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]]; | ||
public static var ghostTapping:Bool = true; | ||
public static var hideTime:Bool = false; | ||
public static var caching:Bool = true; | ||
|
||
public static function saveSettings() { | ||
FlxG.save.data.downScroll = downScroll; | ||
FlxG.save.data.middleScroll = middleScroll; | ||
FlxG.save.data.showFPS = showFPS; | ||
FlxG.save.data.flashing = flashing; | ||
FlxG.save.data.globalAntialiasing = globalAntialiasing; | ||
FlxG.save.data.noteSplashes = noteSplashes; | ||
FlxG.save.data.lowQuality = lowQuality; | ||
FlxG.save.data.framerate = framerate; | ||
FlxG.save.data.cursing = cursing; | ||
FlxG.save.data.violence = violence; | ||
FlxG.save.data.camZooms = camZooms; | ||
FlxG.save.data.noteOffset = noteOffset; | ||
FlxG.save.data.hideHud = hideHud; | ||
FlxG.save.data.arrowHSV = arrowHSV; | ||
FlxG.save.data.ghostTapping = ghostTapping; | ||
FlxG.save.data.hideTime = hideTime; | ||
FlxG.save.data.caching = caching; | ||
//caching = FlxG.save.data.caching; | ||
|
||
var save:FlxSave = new FlxSave(); | ||
save.bind('controls', 'xale'); //Placing this in a separate save so that it can be manually deleted without removing your Score and stuff | ||
save.flush(); | ||
FlxG.log.add("Settings saved!"); | ||
|
||
if(FlxG.save.data.caching != null) | ||
trace('That is ok'); | ||
trace(caching); | ||
} | ||
|
||
public static function loadPrefs() { | ||
if(FlxG.save.data.downScroll != null) { | ||
downScroll = FlxG.save.data.downScroll; | ||
} | ||
if(FlxG.save.data.middleScroll != null) { | ||
middleScroll = FlxG.save.data.middleScroll; | ||
} | ||
if(FlxG.save.data.showFPS != null) { | ||
showFPS = FlxG.save.data.showFPS; | ||
if(Main.fpsVar != null) { | ||
Main.fpsVar.visible = showFPS; | ||
} | ||
} | ||
if(FlxG.save.data.flashing != null) { | ||
flashing = FlxG.save.data.flashing; | ||
} | ||
if(FlxG.save.data.globalAntialiasing != null) { | ||
globalAntialiasing = FlxG.save.data.globalAntialiasing; | ||
} | ||
if(FlxG.save.data.noteSplashes != null) { | ||
noteSplashes = FlxG.save.data.noteSplashes; | ||
} | ||
if(FlxG.save.data.lowQuality != null) { | ||
lowQuality = FlxG.save.data.lowQuality; | ||
} | ||
if(FlxG.save.data.framerate != null) { | ||
framerate = FlxG.save.data.framerate; | ||
if(framerate > FlxG.drawFramerate) { | ||
FlxG.updateFramerate = framerate; | ||
FlxG.drawFramerate = framerate; | ||
} else { | ||
FlxG.drawFramerate = framerate; | ||
FlxG.updateFramerate = framerate; | ||
} | ||
} | ||
if(FlxG.save.data.camZooms != null) { | ||
camZooms = FlxG.save.data.camZooms; | ||
} | ||
if(FlxG.save.data.hideHud != null) { | ||
hideHud = FlxG.save.data.hideHud; | ||
} | ||
if(FlxG.save.data.noteOffset != null) { | ||
noteOffset = FlxG.save.data.noteOffset; | ||
} | ||
if(FlxG.save.data.arrowHSV != null) { | ||
arrowHSV = FlxG.save.data.arrowHSV; | ||
} | ||
if(FlxG.save.data.ghostTapping != null) { | ||
ghostTapping = FlxG.save.data.ghostTapping; | ||
} | ||
if(FlxG.save.data.hideTime != null) { | ||
hideTime = FlxG.save.data.hideTime; | ||
} | ||
if(FlxG.save.data.caching != null) { | ||
caching = FlxG.save.data.caching; | ||
} | ||
|
||
var save:FlxSave = new FlxSave(); | ||
save.bind('controls', 'xale'); | ||
} | ||
|
||
public static function getCaching() | ||
{ | ||
caching = FlxG.save.data.caching; | ||
return caching; | ||
} | ||
} | ||
|
||
class LoaderState extends MusicBeatState | ||
{ | ||
var caching = FakeData.caching; | ||
override function create() | ||
{ | ||
ClientPrefs.saveSettings(); | ||
trace(caching); | ||
trace(EngineData.isCachingEnabled); | ||
|
||
trace('It is working'); | ||
#if debug | ||
FlxG.switchState(new TitleState()); | ||
#end | ||
|
||
#if !debug | ||
if(EngineData.isCachingEnabled && caching) | ||
FlxG.switchState(new Caching()); | ||
else | ||
FlxG.switchState(new TitleState()); | ||
#end | ||
|
||
super.create(); | ||
} | ||
} |
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
Oops, something went wrong.