From 3d4646ac1c4e013b51822ce17e2cb2cc1948a0fe Mon Sep 17 00:00:00 2001 From: "not.weuz" Date: Tue, 3 May 2022 02:32:11 +1400 Subject: [PATCH] 1.1.1.1.1.1.1..1.11.1.1.1.1.11.1..1.1.1.1..1 --- source/ClientPrefs.hx | 3 + source/CoolUtil.hx | 2 +- source/MainMenuState.hx | 109 +++++++++++++++++++++++--------- source/ModsMenuState.hx | 10 +-- source/PlayState.hx | 7 +- source/options/NotesSubState.hx | 22 ++++++- 6 files changed, 111 insertions(+), 42 deletions(-) diff --git a/source/ClientPrefs.hx b/source/ClientPrefs.hx index 494d0c28..457bb696 100644 --- a/source/ClientPrefs.hx +++ b/source/ClientPrefs.hx @@ -182,6 +182,9 @@ class ClientPrefs { if(FlxG.save.data.flashing != null) { flashing = FlxG.save.data.flashing; } + if(FlxG.save.data.holdNoteVisibility != null) { + holdNoteVisibility = FlxG.save.data.holdNoteVisibility; + } if(FlxG.save.data.globalAntialiasing != null) { globalAntialiasing = FlxG.save.data.globalAntialiasing; } diff --git a/source/CoolUtil.hx b/source/CoolUtil.hx index e6687846..f1b7f6b3 100644 --- a/source/CoolUtil.hx +++ b/source/CoolUtil.hx @@ -50,7 +50,7 @@ class CoolUtil return Math.max(min, Math.min(max, value)); } - public static function cameraZoom(target, zoomLevel, speed, style, type) + public static function cameraZoom(target, zoomLevel:Float, speed, style, type) { FlxTween.tween(target, {zoom: zoomLevel}, speed, {ease: style, type: type}); } diff --git a/source/MainMenuState.hx b/source/MainMenuState.hx index 00b12795..cd280222 100644 --- a/source/MainMenuState.hx +++ b/source/MainMenuState.hx @@ -16,6 +16,10 @@ import flixel.math.FlxMath; import flixel.tweens.FlxEase; import flixel.tweens.FlxTween; import flixel.util.FlxColor; +#if MODS_ALLOWED +import sys.FileSystem; +import sys.io.File; +#end import lime.app.Application; import Achievements; import editors.MasterEditorMenu; @@ -43,6 +47,11 @@ class MainMenuState extends MusicBeatState 'options' ]; + #if MODS_ALLOWED + var customOption:String; + var customOptionLink:String; + #end + var magenta:FlxSprite; var camFollow:FlxObject; var camFollowPos:FlxObject; @@ -75,35 +84,46 @@ class MainMenuState extends MusicBeatState persistentUpdate = persistentDraw = true; var yScroll:Float = Math.max(0.25 - (0.05 * (optionShit.length - 4)), 0.1); - var bg:FlxSprite = new FlxSprite(-80).loadGraphic(Paths.image('menuBG')); - bg.scrollFactor.set(0, yScroll); - bg.setGraphicSize(Std.int(bg.width * 1.175)); - bg.updateHitbox(); - bg.screenCenter(); - bg.antialiasing = ClientPrefs.globalAntialiasing; - add(bg); - - if(ClientPrefs.themedmainmenubg == true) { - var hours:Int = Date.now().getHours(); - if(hours > 18) { - bg.color = 0x4d39ff; // 0x6939ff - } else if(hours < 18) null; - } - - camFollow = new FlxObject(0, 0, 1, 1); - camFollowPos = new FlxObject(0, 0, 1, 1); - add(camFollow); - add(camFollowPos); - - magenta = new FlxSprite(-80).loadGraphic(Paths.image('menuDesat')); - magenta.scrollFactor.set(0, yScroll); - magenta.setGraphicSize(Std.int(magenta.width * 1.175)); - magenta.updateHitbox(); - magenta.screenCenter(); - magenta.visible = false; - magenta.antialiasing = ClientPrefs.globalAntialiasing; - magenta.color = 0xFFfd719b; - add(magenta); + var bg:FlxSprite = new FlxSprite(-80).loadGraphic(Paths.image('menuBG')); + bg.scrollFactor.set(0, yScroll); + bg.setGraphicSize(Std.int(bg.width * 1.175)); + bg.updateHitbox(); + bg.screenCenter(); + bg.antialiasing = ClientPrefs.globalAntialiasing; + add(bg); + + if(ClientPrefs.themedmainmenubg == true) { + + var themedBg:FlxSprite = new FlxSprite(-80).loadGraphic(Paths.image('menuDesat')); + themedBg.scrollFactor.set(0, yScroll); + themedBg.setGraphicSize(Std.int(bg.width)); + themedBg.updateHitbox(); + themedBg.screenCenter(); + themedBg.antialiasing = ClientPrefs.globalAntialiasing; + add(themedBg); + + var hours:Int = Date.now().getHours(); + if(hours > 18) { + themedBg.color = 0x545f8a; // 0x6939ff + } else if(hours > 8) { + themedBg.loadGraphic(Paths.image('menuBG')); + } + } + + camFollow = new FlxObject(0, 0, 1, 1); + camFollowPos = new FlxObject(0, 0, 1, 1); + add(camFollow); + add(camFollowPos); + + magenta = new FlxSprite(-80).loadGraphic(Paths.image('menuDesat')); + magenta.scrollFactor.set(0, yScroll); + magenta.setGraphicSize(Std.int(magenta.width * 1.175)); + magenta.updateHitbox(); + magenta.screenCenter(); + magenta.visible = false; + magenta.antialiasing = ClientPrefs.globalAntialiasing; + magenta.color = 0xFFfd719b; + add(magenta); // magenta.scrollFactor.set(); @@ -116,6 +136,9 @@ class MainMenuState extends MusicBeatState }*/ var curoffset:Float = 100; + #if MODS_ALLOWED + pushModMenuItemsToList(Paths.currentModDirectory); + #end for (i in 0...optionShit.length) { @@ -170,6 +193,32 @@ class MainMenuState extends MusicBeatState super.create(); } + #if MODS_ALLOWED + private var modsAdded:Array = []; + function pushModMenuItemsToList(folder:String) + { + if(modsAdded.contains(folder)) return; + + var menuitemsFile:String = null; + if(folder != null && folder.trim().length > 0) menuitemsFile = Paths.mods(folder + '/data/menuitems.txt'); + else menuitemsFile = Paths.mods('data/menuitems.txt'); + + if (FileSystem.exists(menuitemsFile)) + { + var firstarray:Array = File.getContent(menuitemsFile).split('\n'); + if (firstarray[0].length > 0) { + var arr:Array = firstarray[0].split('||'); + //if(arr.length == 1) arr.push(folder); + optionShit.push(arr[0]); + customOption = arr[0]; + customOptionLink = arr[1]; + } + } + modsAdded.push(folder); + } + #end + + #if ACHIEVEMENTS_ALLOWED // Unlocks "Freaky on a Friday Night" achievement function giveAchievement() { @@ -219,6 +268,8 @@ class MainMenuState extends MusicBeatState if (optionShit[curSelected] == 'donate') { CoolUtil.browserLoad('https://www.youtube.com/watch?v=dQw4w9WgXcQ'); // WHOEVER DELETES THIS IS GAY + } else if (optionShit[curSelected] == customOption) { + CoolUtil.browserLoad(customOptionLink); } else { diff --git a/source/ModsMenuState.hx b/source/ModsMenuState.hx index f8eda31e..ad304275 100644 --- a/source/ModsMenuState.hx +++ b/source/ModsMenuState.hx @@ -14,7 +14,6 @@ import flixel.math.FlxMath; import flixel.text.FlxText; import flixel.util.FlxColor; import flixel.tweens.FlxTween; -import flixel.tweens.FlxEase; import lime.utils.Assets; import flixel.system.FlxSound; import openfl.utils.Assets as OpenFlAssets; @@ -71,9 +70,6 @@ class ModsMenuState extends MusicBeatState Paths.clearUnusedMemory(); WeekData.setDirectoryFromWeek(); - camera.zoom = 2.2; - CoolUtil.cameraZoom(camera, 1, .5, FlxEase.sineOut, ONESHOT); - #if desktop // Updating Discord Rich Presence DiscordClient.changePresence("In the Menus", null); @@ -246,7 +242,6 @@ class ModsMenuState extends MusicBeatState updateButtonToggle(); FlxG.sound.play(Paths.sound('scrollMenu'), 0.6); }); - buttonEnableAll.setGraphicSize(170, 50); buttonEnableAll.updateHitbox(); buttonEnableAll.label.setFormat(Paths.font("vcr.ttf"), 24, FlxColor.BLACK, CENTER); @@ -481,7 +476,6 @@ class ModsMenuState extends MusicBeatState colorTween.cancel(); } FlxG.sound.play(Paths.sound('cancelMenu')); - CoolUtil.cameraZoom(camera, 2, .5, FlxEase.backOut, ONESHOT); FlxG.mouse.visible = false; saveTxt(); if(needaReset) @@ -498,12 +492,12 @@ class ModsMenuState extends MusicBeatState } } - if(controls.UI_UP_P) + if(controls.UI_UP_P || FlxG.mouse.wheel > 0) { changeSelection(-1); FlxG.sound.play(Paths.sound('scrollMenu')); } - if(controls.UI_DOWN_P) + if(controls.UI_DOWN_P || FlxG.mouse.wheel < 0) { changeSelection(1); FlxG.sound.play(Paths.sound('scrollMenu')); diff --git a/source/PlayState.hx b/source/PlayState.hx index 05f5141d..a72cabd1 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2377,7 +2377,6 @@ class PlayState extends MusicBeatState //Jesus fuck this took me so much mother fucking time AAAAAAAAAA if(strumScroll && daNote.isSustainNote) { - daNote.alpha = ClientPrefs.holdNoteVisibility; if (daNote.animation.curAnim.name.endsWith('end')) { daNote.y += 10.5 * (fakeCrochet / 400) * 1.5 * songSpeed + (46 * (songSpeed - 1)); daNote.y -= 46 * (1 - (fakeCrochet / 600)) * songSpeed; @@ -2397,6 +2396,12 @@ class PlayState extends MusicBeatState opponentNoteHit(daNote); } + if (daNote.isSustainNote) { + if (daNote.mustPress) { + daNote.alpha = ClientPrefs.holdNoteVisibility; + } + } + if(daNote.mustPress && cpuControlled) { if(daNote.isSustainNote) { if(daNote.canBeHit) { diff --git a/source/options/NotesSubState.hx b/source/options/NotesSubState.hx index cdbd4ce7..17973473 100644 --- a/source/options/NotesSubState.hx +++ b/source/options/NotesSubState.hx @@ -31,6 +31,7 @@ class NotesSubState extends MusicBeatSubstate { private static var curSelected:Int = 0; private static var typeSelected:Int = 0; + public static var bg:FlxSprite; private var grpNumbers:FlxTypedGroup; private var grpNotes:FlxTypedGroup; private var shaderArray:Array = []; @@ -45,7 +46,7 @@ class NotesSubState extends MusicBeatSubstate public function new() { super(); - var bg:FlxSprite = new FlxSprite().loadGraphic(Paths.image('menuDesat')); + bg = new FlxSprite().loadGraphic(Paths.image('menuDesat')); bg.color = 0xFFea71fd; bg.screenCenter(); bg.antialiasing = ClientPrefs.globalAntialiasing; @@ -60,6 +61,10 @@ class NotesSubState extends MusicBeatSubstate grpNumbers = new FlxTypedGroup(); add(grpNumbers); + var resetText:FlxText = new FlxText(12, FlxG.height - 40, "Press CONTROL to reset selected arrow.", 80); + resetText.setFormat("VCR OSD Mono", 24, FlxColor.WHITE, CENTER); + add(resetText); + for (i in 0...ClientPrefs.arrowHSV.length) { var yPos:Float = (165 * i) + 35; for (j in 0...3) { @@ -142,10 +147,11 @@ class NotesSubState extends MusicBeatSubstate changeType(1); FlxG.sound.play(Paths.sound('scrollMenu')); } - if(controls.RESET) { + if(controls.RESET || FlxG.keys.justPressed.CONTROL) { for (i in 0...3) { resetValue(curSelected, i); } + FlxG.camera.flash(FlxColor.BLACK, 1); FlxG.sound.play(Paths.sound('scrollMenu')); } if (controls.ACCEPT && nextAccept <= 0) { @@ -180,7 +186,7 @@ class NotesSubState extends MusicBeatSubstate changingNote = false; FlxG.sound.play(Paths.sound('cancelMenu')); } - + if(nextAccept > 0) { nextAccept -= 1; } @@ -213,6 +219,16 @@ class NotesSubState extends MusicBeatSubstate item.scale.set(1, 1); hsbText.y = item.y - 70; blackBG.y = item.y - 20; + + if(curSelected == 0) { + bg.color = 0xbf5eff; + } else if(curSelected == 1) { + bg.color = 0x5ee7ff; + } else if(curSelected == 2) { + bg.color = 0x5eff84; + } else if(curSelected == 3) { + bg.color = 0xff5e5e; + } } } FlxG.sound.play(Paths.sound('scrollMenu'));