From 7c073438b3a58de79df8f86ab37cf619cedf27b7 Mon Sep 17 00:00:00 2001 From: Yoshman29 <81191621+YoshiCrafter29@users.noreply.github.com> Date: Sun, 12 Mar 2023 01:13:04 +0100 Subject: [PATCH] new settings sucks ass --- assets/data/config/discord.json | 2 +- buildnumber.txt | 2 +- source/funkin/game/PlayState.hx | 6 +- source/funkin/menus/MainMenuState.hx | 6 +- source/funkin/menus/PauseSubState.hx | 2 +- source/funkin/options/LatencyState.hx | 71 --------- source/funkin/options/OptionsMenu.hx | 141 +++++++++-------- source/funkin/options/OptionsScreen.hx | 143 ++++-------------- source/funkin/options/OptionsTree.hx | 48 ++++++ .../options/categories/AppearanceOptions.hx | 50 +++--- .../funkin/options/categories/DebugOptions.hx | 22 ++- .../options/categories/GameplayOptions.hx | 38 +++-- .../funkin/options/categories/MiscOptions.hx | 54 ++++--- source/funkin/options/type/TextOption.hx | 8 + 14 files changed, 254 insertions(+), 339 deletions(-) delete mode 100644 source/funkin/options/LatencyState.hx create mode 100644 source/funkin/options/OptionsTree.hx diff --git a/assets/data/config/discord.json b/assets/data/config/discord.json index 9aa84b62..29fa11b1 100644 --- a/assets/data/config/discord.json +++ b/assets/data/config/discord.json @@ -1,4 +1,4 @@ { "clientID": "1027994136193810442", - "logoKey": "logo" + "logoKey": "icon" } \ No newline at end of file diff --git a/buildnumber.txt b/buildnumber.txt index c84224b2..75d9bd8b 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -2414 \ No newline at end of file +2460 \ No newline at end of file diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index 853ca431..7875324a 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -1291,6 +1291,9 @@ class PlayState extends MusicBeatState if (__pressed.contains(true)) { + for(c in p.characters) + c.__lockAnimThisFrame = true; + __funcsToExec.push(function(note:Note) { if (__pressed[note.strumID] && note.isSustainNote && note.canBeHit && !note.wasGoodHit) { goodNoteHit(p, note); @@ -1300,9 +1303,6 @@ class PlayState extends MusicBeatState var notePerStrum = [for(_ in 0...4) null]; if (__justPressed.contains(true)) { - for(c in p.characters) - c.__lockAnimThisFrame = true; - __funcsToExec.push(function(note:Note) { if (__justPressed[note.strumID] && !note.isSustainNote && !note.wasGoodHit && note.canBeHit) { if (notePerStrum[note.strumID] == null) notePerStrum[note.strumID] = note; diff --git a/source/funkin/menus/MainMenuState.hx b/source/funkin/menus/MainMenuState.hx index b05ebf62..871adb78 100644 --- a/source/funkin/menus/MainMenuState.hx +++ b/source/funkin/menus/MainMenuState.hx @@ -3,7 +3,7 @@ package funkin.menus; import haxe.Json; import funkin.ui.FunkinText; import funkin.options.Options; -import funkin.menus.credits.CreditsMain; +// import funkin.menus.credits.CreditsMain; import flixel.FlxState; import flixel.addons.transition.FlxTransitionableState; import flixel.effects.FlxFlicker; @@ -179,11 +179,13 @@ class MainMenuState extends MusicBeatState trace("Freeplay Menu Selected"); case 'donate': + /* FlxG.switchState(new CreditsMain()); trace("Credits Menu Selected"); + */ case 'options': - FlxG.switchState(new OptionsMenu(false)); + FlxG.switchState(new OptionsMenu()); } }); } diff --git a/source/funkin/menus/PauseSubState.hx b/source/funkin/menus/PauseSubState.hx index 99d4ffac..1f5becd4 100644 --- a/source/funkin/menus/PauseSubState.hx +++ b/source/funkin/menus/PauseSubState.hx @@ -138,7 +138,7 @@ class PauseSubState extends MusicBeatSubstate persistentDraw = false; openSubState(new KeybindsOptions()); case "Options": - FlxG.switchState(new OptionsMenu(true)); + FlxG.switchState(new OptionsMenu()); case "Exit to menu": FlxG.switchState(PlayState.isStoryMode ? new StoryMenuState() : new FreeplayState()); CoolUtil.playMenuSong(); diff --git a/source/funkin/options/LatencyState.hx b/source/funkin/options/LatencyState.hx deleted file mode 100644 index 85f3944a..00000000 --- a/source/funkin/options/LatencyState.hx +++ /dev/null @@ -1,71 +0,0 @@ -package funkin.options; - -import flixel.FlxState; -import flixel.text.FlxText; - -class LatencyState extends FlxState -{ - var offsetText:FlxText; - var noteGrp:FlxTypedGroup; - var strumLine:FlxSprite; - - override function create() - { - FlxG.sound.playMusic(Paths.sound('soundTest')); - - noteGrp = new FlxTypedGroup(); - add(noteGrp); - - for (i in 0...32) - { - var note:Note = new Note(Conductor.crochet * i, 1); - noteGrp.add(note); - } - - offsetText = new FlxText(); - offsetText.screenCenter(); - add(offsetText); - - strumLine = new FlxSprite(FlxG.width / 2, 100).makeGraphic(FlxG.width, 5); - add(strumLine); - - Conductor.changeBPM(120); - - super.create(); - } - - override function update(elapsed:Float) - { - offsetText.text = "Offset: " + Conductor.offset + "ms"; - - Conductor.songPosition = FlxG.sound.music.time - Conductor.offset; - - var multiply:Float = 1; - - if (FlxG.keys.pressed.SHIFT) - multiply = 10; - - if (FlxG.keys.justPressed.RIGHT) - Conductor.offset += 1 * multiply; - if (FlxG.keys.justPressed.LEFT) - Conductor.offset -= 1 * multiply; - - if (FlxG.keys.justPressed.SPACE) - { - FlxG.sound.music.stop(); - - FlxG.resetState(); - } - - noteGrp.forEach(function(daNote:Note) - { - daNote.y = (strumLine.y - (Conductor.songPosition - daNote.strumTime) * 0.45); - daNote.x = strumLine.x + 30; - - if (daNote.y < strumLine.y) - daNote.kill(); - }); - - super.update(elapsed); - } -} diff --git a/source/funkin/options/OptionsMenu.hx b/source/funkin/options/OptionsMenu.hx index 2f5b7f5c..f358a9d2 100644 --- a/source/funkin/options/OptionsMenu.hx +++ b/source/funkin/options/OptionsMenu.hx @@ -1,25 +1,20 @@ package funkin.options; -import flixel.util.typeLimit.OneOfTwo; -import flixel.FlxState; -import flixel.addons.transition.FlxTransitionableState; -import flixel.effects.FlxFlicker; +import funkin.options.OptionsScreen; import funkin.menus.MainMenuState; - +import funkin.options.type.TextOption; +import flixel.util.typeLimit.OneOfTwo; +import funkin.options.type.OptionType; import funkin.options.categories.*; -typedef OptionCategory = { - var name:String; - var desc:String; - var state:OneOfTwo, FlxState>; -} class OptionsMenu extends MusicBeatState { - public static var fromPlayState:Bool = false; - public var options:Array = [ + + public static var mainOptions:Array = [ { name: 'Controls', desc: 'Change Controls for Player 1 and Player 2!', - state: funkin.options.keybinds.KeybindsOptions + state: null, + substate: funkin.options.keybinds.KeybindsOptions }, { name: 'Gameplay', @@ -42,67 +37,93 @@ class OptionsMenu extends MusicBeatState { state: DebugOptions } ]; - - public var curSelected:Int = -1; - public var canSelect:Bool = true; - public var alphabets:FlxTypedGroup; - - public function new(?fromPlayState:Bool) { + + public var options:Array; + public var optionsTree:OptionsTree; + public function new(?options:Array) { super(); - if (fromPlayState != null) OptionsMenu.fromPlayState = fromPlayState; } + public override function create() { - var bg:FlxSprite = new FlxSprite(-80).loadAnimatedGraphic(Paths.image('menus/menuBGBlue')); - bg.scrollFactor.set(); + super.create(); + + var optionSprites:Array = []; + if (options == null) { + optionSprites = [for(o in mainOptions) new TextOption(o.name, o.desc, function() { + if (o.substate != null) { + persistentUpdate = false; + persistentDraw = true; + 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, [])); + } + } + })]; + } else { + optionSprites = [for(o in options) Type.createInstance(o.type, o.args)]; + } + + 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); - super.create(); - alphabets = new FlxTypedGroup(); - for(k=>e in options) { - var alphabet = new Alphabet(0, (k+1) * (100), e.name, true, false); - alphabet.screenCenter(X); - alphabets.add(alphabet); - } - add(alphabets); - changeSelection(1); + optionsTree = new OptionsTree(); + optionsTree.onMenuChange = onMenuChange; + optionsTree.onMenuClose = onMenuClose; + var mainOptionScreen:OptionsScreen = new OptionsScreen(); + for(o in optionSprites) + mainOptionScreen.add(o); + optionsTree.add(mainOptionScreen); + add(optionsTree); - CoolUtil.playMenuSong(); + FlxG.camera.scroll.set(-FlxG.width, 0); + } + + public function onMenuChange() { + if (optionsTree.members.length <= 0) { + exit(); + } else { + // TODO: update top info + } + } + + public function exit() { + Options.save(); + Options.applySettings(); + FlxG.switchState(new MainMenuState()); + } + + public function onMenuClose(m:OptionsScreen) { + CoolUtil.playMenuSFX(CANCEL); } public override function update(elapsed:Float) { super.update(elapsed); - if (!canSelect) return; - changeSelection((controls.UP_P ? -1 : 0) + (controls.DOWN_P ? 1 : 0)); - if (controls.ACCEPT && alphabets.members[curSelected] != null) { - CoolUtil.playMenuSFX(CONFIRM); - canSelect = false; - FlxFlicker.flicker(alphabets.members[curSelected], 1, Options.flashingMenu ? 0.06 : 0.15, false, false, function(flick:FlxFlicker) - { - FlxTransitionableState.skipNextTransOut = true; - if (options[curSelected].state is FlxState) - FlxG.switchState(options[curSelected].state); - else - FlxG.switchState(Type.createInstance(options[curSelected].state, [])); - }); - } else if (controls.BACK) { - if (fromPlayState) - FlxG.switchState(new PlayState()); - else - FlxG.switchState(new MainMenuState()); - } - } - public function changeSelection(change:Int) { - if (change == 0) return; - CoolUtil.playMenuSFX(SCROLL, 0.7); - curSelected = FlxMath.wrap(curSelected + change, 0, options.length-1); - alphabets.forEach(function(e) { - e.alpha = 0.6; - }); - if (alphabets.members[curSelected] != null) alphabets.members[curSelected].alpha = 1; + FlxG.camera.scroll.x = lerp(FlxG.camera.scroll.x, FlxG.width * Math.max(0, (optionsTree.members.length-1)), 0.2); } +} + +typedef OptionCategory = { + var name:String; + var desc:String; + var state:OneOfTwo>; + var ?substate:OneOfTwo>; +} + +typedef OptionTypeDef = { + var type:Class; + var args:Array; } \ No newline at end of file diff --git a/source/funkin/options/OptionsScreen.hx b/source/funkin/options/OptionsScreen.hx index 469e309a..8442f488 100644 --- a/source/funkin/options/OptionsScreen.hx +++ b/source/funkin/options/OptionsScreen.hx @@ -1,143 +1,62 @@ package funkin.options; -import flixel.addons.display.FlxBackdrop; -import funkin.ui.FunkinText; -import flixel.text.FlxText; -import flixel.math.FlxPoint; -import flixel.util.FlxColor; -import flixel.addons.transition.FlxTransitionableState; import funkin.options.type.OptionType; -/** - * Direct replica from Week 7 lol - */ -class OptionsScreen extends MusicBeatState { - public static inline var defaultBGColor:FlxColor = 0xFFFDE871; - public static var instance:OptionsScreen; +class OptionsScreen extends FlxTypedSpriteGroup { public static var optionHeight:Float = 120; - public var bg:FlxSprite; + public var parent:OptionsTree; - public var descDrop:FlxBackdrop; - public var descBG:FlxSprite; - public var descText:FunkinText; + public var curSelected:Int = 0; + public var id:Int = 0; - public var curSelected:Int = -1; - - public var options:Array = []; - - private var descLetters:Float = 0; - - public var descSpeed:Float = 35; + private var __firstFrame:Bool = true; public function new() { super(); - instance = this; + // EXTEND then add options } - public override function create() { - FlxTransitionableState.skipNextTransIn = true; - super.create(); - - bg = new FlxSprite(-80).loadAnimatedGraphic(Paths.image('menus/menuDesat')); - bg.scrollFactor.set(); - bg.scale.set(1.15, 1.15); - bg.updateHitbox(); - bg.screenCenter(); - bg.color = defaultBGColor; - bg.antialiasing = true; - add(bg); - - - for(k=>option in options) { - option.setPosition(k * 20, 10 + (k * optionHeight)); - add(option); - } - - createAdditional(); - - descText = new FunkinText(0, 0); - descText.alignment = CENTER; - descText.scrollFactor.set(); - descText.y = FlxG.height - 50 - descText.height; - - descBG = new FlxSprite(-1, 0).makeGraphic(1, 1, 0xFF000000); - descBG.scrollFactor.set(); - add(descBG); - - descDrop = new FlxBackdrop(null, 1, 0, true, false, 0, 0); - descDrop.scrollFactor.set(); - add(descDrop); - - descText.antialiasing = descDrop.antialiasing = true; - changeSelection(1); - } - - public function createAdditional() {} - public var scrollDest:FlxPoint = FlxPoint.get(0, 0); public override function update(elapsed:Float) { super.update(elapsed); - changeSelection((controls.DOWN_P ? 1 : 0) + (controls.UP_P ? -1 : 0)); - if (controls.ACCEPT) { - options[curSelected].onSelect(); - } - if (controls.BACK) { - Options.save(); - Options.applySettings(); - exit(); - } - FlxG.camera.scroll.x = lerp(FlxG.camera.scroll.x, scrollDest.x, 0.25); - FlxG.camera.scroll.y = lerp(FlxG.camera.scroll.y, scrollDest.y, 0.25); - for(option in options) { - var angle = Math.cos((option.y + (optionHeight / 2) - (FlxG.camera.scroll.y + ((FlxG.height - descBG.height) / 2))) / (FlxG.height * 1.25) * Math.PI); + var controls = PlayerSettings.solo.controls; - option.x = -50 + (Math.abs(angle) * 150); + changeSelection((controls.UP_P ? -1 : 0) + (controls.DOWN_P ? 1 : 0) - FlxG.mouse.wheel); + x = id * FlxG.width; + for(k=>option in members) { + var y:Float = ((FlxG.height - optionHeight) / 2) + ((k - curSelected) * optionHeight); + + option.selected = false; + option.y = __firstFrame ? y : CoolUtil.fpsLerp(option.y, y, 0.25); + option.x = x + (-50 + (Math.abs(Math.cos((option.y + (optionHeight / 2) - (FlxG.camera.scroll.y + (FlxG.height / 2))) / (FlxG.height * 1.25) * Math.PI)) * 150)); } - descBG.alpha = (descDrop.alpha = lerp(descDrop.alpha, 1, 0.25)) * 0.75; - descDrop.x -= elapsed * 200; - } + __firstFrame = false; - public function exit() { - FlxTransitionableState.skipNextTransOut = true; - FlxTransitionableState.skipNextTransIn = true; - FlxG.switchState(new OptionsMenu()); - } - - public function changeSelection(change:Int) { - if (change == 0 && curSelected != -1) return; - CoolUtil.playMenuSFX(SCROLL, 0.7); - if (curSelected != (curSelected = FlxMath.wrap(curSelected + change, 0, options.length - 1))) { - for(e in options) - e.selected = false; - options[curSelected].selected = true; - scrollDest.set(-50, -((FlxG.height - descBG.height) / 2) + ((curSelected + 0.5) * optionHeight)); - updateDesc(); + if (members.length > 0) { + members[curSelected].selected = true; + if (controls.ACCEPT || FlxG.mouse.justReleased) + members[curSelected].onSelect(); } + if (controls.BACK || FlxG.mouse.justReleasedRight) + close(); } - public function updateDesc() { - updateDescText(options[curSelected].desc); + public function close() { + onClose(this); } - public function updateDescText(text:String) { - descText.text = '/ ${text} /'; - @:privateAccess descText.regenGraphic(); //updates the thing + public function changeSelection(sel:Int) { + if (members.length <= 0 || sel == 0) return; - descDrop.loadFrame(descText.frame); - descDrop.y = Std.int(FlxG.height - 10 - descText.height); + CoolUtil.playMenuSFX(SCROLL); - descBG.setGraphicSize(FlxG.width + 2, Std.int(descText.height + 20) + 1); - descBG.updateHitbox(); + curSelected = FlxMath.wrap(curSelected + sel, 0, members.length-1); - descBG.alpha = descDrop.alpha = 0; - descBG.y = FlxG.height - descBG.height + 1; + for(o in members) + members[curSelected].selected = true; } - public override function destroy() { - super.destroy(); - instance = null; - scrollDest.put(); - } + public dynamic function onClose(o:OptionsScreen) {} } \ No newline at end of file diff --git a/source/funkin/options/OptionsTree.hx b/source/funkin/options/OptionsTree.hx new file mode 100644 index 00000000..30eb1b11 --- /dev/null +++ b/source/funkin/options/OptionsTree.hx @@ -0,0 +1,48 @@ +package funkin.options; + +class OptionsTree extends FlxTypedGroup { + public override function new() { + super(); + + } + + public override function update(elapsed:Float) { + var last = members.last(); + if (last != null) + last.update(elapsed); + } + + public override function add(m:OptionsScreen) { + super.add(m); + setup(m); + onMenuChange(); + return m; + } + public override function insert(pos:Int, m:OptionsScreen) { + var last = members.last(); + super.insert(pos, m); + setup(m); + if (last != members.last()) + onMenuChange(); + return m; + } + + public function setup(m:OptionsScreen) { + m.onClose = __subMenuClose; + m.id = members.indexOf(m); + m.parent = this; + } + + function __subMenuClose(m:OptionsScreen) { + remove(m, true); + onMenuChange(); + onMenuClose(m); + } + + public dynamic function onMenuChange() { + + } + + public dynamic function onMenuClose(m:OptionsScreen) { + } +} \ No newline at end of file diff --git a/source/funkin/options/categories/AppearanceOptions.hx b/source/funkin/options/categories/AppearanceOptions.hx index f22b82a0..3fd7ee88 100644 --- a/source/funkin/options/categories/AppearanceOptions.hx +++ b/source/funkin/options/categories/AppearanceOptions.hx @@ -1,33 +1,27 @@ package funkin.options.categories; class AppearanceOptions extends OptionsScreen { - public override function create() { - options = [ - new Checkbox( - "Antialiasing", - "If unchecked, will disable antialiasing on every sprite. Can boost performances at the cost of sharper, more pixely sprites", - "antialiasing"), - new Checkbox( - "Pixel Perfect Effect", - "If checked, Week 6 will have a pixel perfect effect to it enabled, aligning every pixel on the screen.", - "week6PixelPerfect"), - new Checkbox( - "Enable splashes", - "If checked, the game will show a note impact effect everytime you hit a note with a Sick! rating.", - "splashesEnabled"), - new Checkbox( - "Flashing Menu", - "If unchecked, will disable menu flashing when you select an option in the Main Menu, and other flashs will be slower", - "flashingMenu"), - new Checkbox( - "Low Memory Mode", - "If checked, will disable certain background elements in stages to reduce memory usage.", - "lowMemoryMode"), - new Checkbox( - "Auto Pause", - "If checked, switching windows will pause the game", - "autoPause"), - ]; - super.create(); + public override function new() { + super(); + add(new Checkbox( + "Antialiasing", + "If unchecked, will disable antialiasing on every sprite. Can boost performances at the cost of sharper, more pixely sprites", + "antialiasing")); + add(new Checkbox( + "Pixel Perfect Effect", + "If checked, Week 6 will have a pixel perfect effect to it enabled, aligning every pixel on the screen.", + "week6PixelPerfect")); + add(new Checkbox( + "Flashing Menu", + "If unchecked, will disable menu flashing when you select an option in the Main Menu, and other flashs will be slower", + "flashingMenu")); + add(new Checkbox( + "Low Memory Mode", + "If checked, will disable certain background elements in stages to reduce memory usage.", + "lowMemoryMode")); + add(new Checkbox( + "Auto Pause", + "If checked, switching windows will pause the game", + "autoPause")); } } \ No newline at end of file diff --git a/source/funkin/options/categories/DebugOptions.hx b/source/funkin/options/categories/DebugOptions.hx index a01dbe2e..0a355730 100644 --- a/source/funkin/options/categories/DebugOptions.hx +++ b/source/funkin/options/categories/DebugOptions.hx @@ -3,17 +3,15 @@ package funkin.options.categories; import funkin.windows.WindowsAPI; class DebugOptions extends OptionsScreen { - public override function create() { - options = [ - #if windows - new TextOption( - "Show Console", - "Select this to show the debug console, which contains log information about the game.", - function() { - WindowsAPI.allocConsole(); - }), - #end - ]; - super.create(); + public override function new() { + super(); + #if windows + add(new TextOption( + "Show Console", + "Select this to show the debug console, which contains log information about the game.", + function() { + WindowsAPI.allocConsole(); + })); + #end } } \ No newline at end of file diff --git a/source/funkin/options/categories/GameplayOptions.hx b/source/funkin/options/categories/GameplayOptions.hx index 32e574b6..9d04023c 100644 --- a/source/funkin/options/categories/GameplayOptions.hx +++ b/source/funkin/options/categories/GameplayOptions.hx @@ -1,25 +1,23 @@ package funkin.options.categories; class GameplayOptions extends OptionsScreen { - public override function create() { - options = [ - new Checkbox( - "Downscroll", - "If checked, notes will go from up to down instead of down to up, like if they were falling", - "downscroll"), - new Checkbox( - "Ghost Tapping", - "If unchecked, trying to hit any strum that have no note that can be hit will cause a miss.", - "ghostTapping"), - new Checkbox( - "Naughtyness", - "If unchecked, will censor Week 7 cutscenes", - "naughtyness"), - new Checkbox( - "Camera Zoom on Beat", - "If unchecked, will disable camera zooming every 4 beats", - "camZoomOnBeat"), - ]; - super.create(); + public override function new() { + super(); + add(new Checkbox( + "Downscroll", + "If checked, notes will go from up to down instead of down to up, like if they were falling", + "downscroll")); + add(new Checkbox( + "Ghost Tapping", + "If unchecked, trying to hit any strum that have no note that can be hit will cause a miss.", + "ghostTapping")); + add(new Checkbox( + "Naughtyness", + "If unchecked, will censor Week 7 cutscenes", + "naughtyness")); + add(new Checkbox( + "Camera Zoom on Beat", + "If unchecked, will disable camera zooming every 4 beats", + "camZoomOnBeat")); } } \ No newline at end of file diff --git a/source/funkin/options/categories/MiscOptions.hx b/source/funkin/options/categories/MiscOptions.hx index a45ad587..48a4492b 100644 --- a/source/funkin/options/categories/MiscOptions.hx +++ b/source/funkin/options/categories/MiscOptions.hx @@ -2,33 +2,31 @@ package funkin.options.categories; class MiscOptions extends OptionsScreen { - public override function create() { - options = [ - #if UPDATE_CHECKING - new Checkbox( - "Enable Beta Updates", - "If checked, will also include beta (prereleases) updates in the update checking.", - "betaUpdates"), - new TextOption( - "Check for Updates", - "Select this option to check for new engine updates.", - function() { - var report = funkin.updating.UpdateUtil.checkForUpdates(); - if (report.newUpdate) { - FlxG.switchState(new funkin.updating.UpdateAvailableScreen(report)); - } else { - CoolUtil.playMenuSFX(CANCEL); - updateDescText("No update found."); - } - }), - #end - new TextOption( - "Reset Save Data", - "Select this option to reset save data. This will remove all of your highscores", - function() { - - }) - ]; - super.create(); + public override function new() { + super(); + #if UPDATE_CHECKING + add(new Checkbox( + "Enable Beta Updates", + "If checked, will also include beta (prereleases) updates in the update checking.", + "betaUpdates"));, + add(new TextOption( + "Check for Updates", + "Select this option to check for new engine updates.", + function() { + var report = funkin.updating.UpdateUtil.checkForUpdates(); + if (report.newUpdate) { + FlxG.switchState(new funkin.updating.UpdateAvailableScreen(report)); + } else { + CoolUtil.playMenuSFX(CANCEL); + updateDescText("No update found."); + } + }));, + #end + add(new TextOption( + "Reset Save Data", + "Select this option to reset save data. This will remove all of your highscores", + function() { + // TODO: SAVE DATA RESETTING + })); } } \ No newline at end of file diff --git a/source/funkin/options/type/TextOption.hx b/source/funkin/options/type/TextOption.hx index c2aa9fd9..4549659f 100644 --- a/source/funkin/options/type/TextOption.hx +++ b/source/funkin/options/type/TextOption.hx @@ -1,5 +1,6 @@ package funkin.options.type; +import flixel.effects.FlxFlicker; class TextOption extends OptionType { public var selectCallback:Void->Void; @@ -16,8 +17,15 @@ class TextOption extends OptionType { add(__text = new Alphabet(100, 20, text, true)); } + public override function draw() { + super.draw(); + } public override function onSelect() { super.onSelect(); + CoolUtil.playMenuSFX(CONFIRM); + FlxFlicker.flicker(this, 1, Options.flashingMenu ? 0.06 : 0.15, true, false, function(t) { + + }); selectCallback(); } } \ No newline at end of file