From 7f112ba2696643098e6bfab0853f4a220811532a Mon Sep 17 00:00:00 2001 From: Yoshman29 <81191621+YoshiCrafter29@users.noreply.github.com> Date: Wed, 2 Nov 2022 14:36:14 +0100 Subject: [PATCH] options desc --- buildnumber.txt | 2 +- source/funkin/game/PlayState.hx | 4 +- source/funkin/options/OptionsScreen.hx | 41 ++++++++++++------- .../options/categories/BehaviourOptions.hx | 6 +-- .../options/categories/GameplayOptions.hx | 6 +-- .../options/categories/SaveDataOptions.hx | 2 +- 6 files changed, 36 insertions(+), 25 deletions(-) diff --git a/buildnumber.txt b/buildnumber.txt index 14e963ae..9a32da21 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -975 \ No newline at end of file +984 \ No newline at end of file diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index c635d205..a5ad33a4 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -429,9 +429,7 @@ class PlayState extends MusicBeatState private function generateSong(dataPath:String, ?songData:SwagSong):Void { if (songData == null) songData = SONG; - - Conductor.reset(); - + Conductor.changeBPM(songData.bpm); curSong = songData.song; diff --git a/source/funkin/options/OptionsScreen.hx b/source/funkin/options/OptionsScreen.hx index aabd3eba..c607ad42 100644 --- a/source/funkin/options/OptionsScreen.hx +++ b/source/funkin/options/OptionsScreen.hx @@ -1,5 +1,6 @@ package funkin.options; +import flixel.addons.display.FlxBackdrop; import funkin.ui.FunkinText; import flixel.text.FlxText; import flixel.math.FlxMath; @@ -21,6 +22,7 @@ class OptionsScreen extends MusicBeatState { // public var bgColor:FlxColor = 0xFFFDE871; public var bg:FlxSprite; + public var descDrop:FlxBackdrop; public var descBG:FlxSprite; public var descText:FunkinText; @@ -28,7 +30,6 @@ class OptionsScreen extends MusicBeatState { public var options:Array = []; - private var transparentFormat:FlxTextFormat; private var descLetters:Float = 0; public var descSpeed:Float = 35; @@ -50,16 +51,23 @@ class OptionsScreen extends MusicBeatState { bg.antialiasing = true; add(bg); - descText = new FunkinText(10, 10, FlxG.width - 20); + descText = new FunkinText(0, 0); descText.alignment = CENTER; - add(descText); + 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); for(k=>option in options) { option.setPosition(k * 20, 10 + (k * optionHeight)); add(option); } - - transparentFormat = new FlxTextFormat(FlxColor.TRANSPARENT); changeSelection(1); } @@ -83,11 +91,9 @@ class OptionsScreen extends MusicBeatState { option.x = -50 + (Math.abs(angle) * 150); } - var offset:Int; - if (Std.int(descLetters) != (offset = Std.int(Math.min(descText.text.length, descLetters += elapsed * descSpeed)))) { - descText.clearFormats(); - descText.addFormat(transparentFormat, offset, descText.text.length); - } + + descBG.alpha = (descDrop.alpha = lerp(descDrop.alpha, 1, 0.25)) * 0.75; + descDrop.x -= elapsed * 200; } public function exit() { @@ -110,10 +116,17 @@ class OptionsScreen extends MusicBeatState { } public function updateDesc() { - descLetters = 0; - descText.text = options[curSelected].desc; - descSpeed = descText.text.length; - descText.addFormat(transparentFormat, 0, descText.text.length); + descText.text = '/ ${options[curSelected].desc} /'; + @:privateAccess descText.regenGraphic(); //updates the thing + + descDrop.loadFrame(descText.frame); + descDrop.y = Std.int(FlxG.height - 10 - descText.height); + + descBG.setGraphicSize(FlxG.width + 2, Std.int(descText.height + 20) + 1); + descBG.updateHitbox(); + + descBG.alpha = descDrop.alpha = 0; + descBG.y = FlxG.height - descBG.height + 1; } public override function destroy() { diff --git a/source/funkin/options/categories/BehaviourOptions.hx b/source/funkin/options/categories/BehaviourOptions.hx index 48dd90e1..2a673f76 100644 --- a/source/funkin/options/categories/BehaviourOptions.hx +++ b/source/funkin/options/categories/BehaviourOptions.hx @@ -5,15 +5,15 @@ class BehaviourOptions extends OptionsScreen { options = [ new Checkbox( "Naughtyness", - "If unchecked, will censor Week 7 cutscenes.", + "If unchecked, will censor Week 7 cutscenes", "naughtyness"), 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.", + "If unchecked, will disable menu flashing when you select an option in the Main Menu, and other flashs will be slower", "flashingMenu"), new Checkbox( "Camera Zoom on Beat", - "If unchecked, will disable camera zooming every 4 beats.", + "If unchecked, will disable camera zooming every 4 beats", "camZoomOnBeat"), ]; super.create(); diff --git a/source/funkin/options/categories/GameplayOptions.hx b/source/funkin/options/categories/GameplayOptions.hx index 92db806f..5cd6b56f 100644 --- a/source/funkin/options/categories/GameplayOptions.hx +++ b/source/funkin/options/categories/GameplayOptions.hx @@ -5,15 +5,15 @@ class GameplayOptions extends OptionsScreen { options = [ new Checkbox( "Downscroll", - "If checked, notes will go from up to down instead of down to up, like if they were falling.", + "If checked, notes will go from up to down instead of down to up, like if they were falling", "downscroll"), new Checkbox( "Auto Pause", - "If checked, switching windows will pause the game.", + "If checked, switching windows will pause the game", "autoPause"), new Checkbox( "Antialiasing", - "If unchecked, will disable antialiasing on every sprite. Can boost performances at the cost of sharper, more pixely sprites.", + "If unchecked, will disable antialiasing on every sprite. Can boost performances at the cost of sharper, more pixely sprites", "antialiasing"), ]; super.create(); diff --git a/source/funkin/options/categories/SaveDataOptions.hx b/source/funkin/options/categories/SaveDataOptions.hx index bbd24b32..9a9cb21b 100644 --- a/source/funkin/options/categories/SaveDataOptions.hx +++ b/source/funkin/options/categories/SaveDataOptions.hx @@ -5,7 +5,7 @@ class SaveDataOptions extends OptionsScreen { options = [ new TextOption( "Reset Save Data", - "Select this option to reset save data. This will remove all of your highscores.", + "Select this option to reset save data. This will remove all of your highscores", function() { // TODO!! })