From f66219ddf6c42c07f0873e148295d426ed1471a1 Mon Sep 17 00:00:00 2001 From: Carson Kompon Date: Fri, 21 May 2021 22:49:40 -0400 Subject: [PATCH 01/15] Added getRenderedNoteHit to the modchart docs This was undocumented and has been a huge help to me, so I thought I'd add it to the docs --- docs/modchart.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/modchart.md b/docs/modchart.md index 16dc90f32b..72bfe960be 100644 --- a/docs/modchart.md +++ b/docs/modchart.md @@ -243,6 +243,12 @@ Returns the note data of an note (0-3, left, down, up, right) *Note: Rendered Notes id's are special in the way that they act. 0 = closest note to any receptor, last index = the farthest away from any receptor.* +##### getRenderedNoteHit(int id) + +Returns whether a rendered note must be hit by the player or not + +*Note: Rendered Notes id's are special in the way that they act. 0 = closest note to any receptor, last index = the farthest away from any receptor.* + ##### isSustain(int id) Returns whether a rendered note is a sustain note or not (if they appear as the trail) From a5d24d2196ff50232d11c35b399456e56608ed51 Mon Sep 17 00:00:00 2001 From: Carson Kompon Date: Fri, 21 May 2021 22:53:36 -0400 Subject: [PATCH 02/15] Corrected the description of anyNotes anyNotes returns true if the amount of rendered notes != 0, it previously stated that it returned the number of rendered notes on the screen --- docs/modchart.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modchart.md b/docs/modchart.md index 72bfe960be..cc0316b81a 100644 --- a/docs/modchart.md +++ b/docs/modchart.md @@ -281,7 +281,7 @@ Returns what the game would normally put the specified rendered note x. ##### anyNotes() -Returns the number of rendered notes on the screen. +Returns true if there are rendered notes, and returns false if there are none ##### getRenderedNoteStrumtime(int id) From cc023d96d97f646bf699e4e8d61e8cfdeacba24e Mon Sep 17 00:00:00 2001 From: Carson Kompon Date: Sat, 22 May 2021 01:57:00 -0400 Subject: [PATCH 03/15] Changed getCamX/Y to getCameraX/Y There is no getCamX/Y, and causes the game to crash :p --- docs/modchart.md | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/docs/modchart.md b/docs/modchart.md index cc0316b81a..40a6a9218d 100644 --- a/docs/modchart.md +++ b/docs/modchart.md @@ -191,11 +191,11 @@ Returns the hud's y position Set's the current camera's position in space -##### getCamX() +##### getCameraX() Returns the current camera's x position -##### getCamY() +##### getCameraY() Returns the current camera's y position @@ -424,3 +424,34 @@ Smoothly fade in to an alpha ##### tweenFadeOut(string/int id, float toAlpha, float time, string onComplete) Smoothly fade out to an alpha + + + + + + +### Window & Screen + +##### getWindowX() + +Returns the window's x position + +##### getWindowY() + +Returns the window's y position + +##### getScreenWidth() + +Returns the width of the screen + +##### getScreenHeight() + +Returns the height of the screen + +##### setWindowPos(int x, int y) + +Sets the window's position + +##### resizeWindow(int width, int height) + +Resizes the window From c9e6409782383442f25f87d73fb595e63943cc65 Mon Sep 17 00:00:00 2001 From: Carson Kompon Date: Sat, 22 May 2021 21:19:51 -0400 Subject: [PATCH 04/15] Added setActorScaleXY, setActorFlipX, and setActorFlipY setActorScaleXY(float scaleX, float scaleY, int/string id) setActorFlipX(bool flip, int/string id) setActorFlipY(bool flip, int/string id) --- source/ModchartState.hx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/source/ModchartState.hx b/source/ModchartState.hx index 08e59ba600..64dac14cd5 100644 --- a/source/ModchartState.hx +++ b/source/ModchartState.hx @@ -512,7 +512,21 @@ class ModchartState Lua_helper.add_callback(lua,"setActorScale", function(scale:Float,id:String) { getActorByName(id).setGraphicSize(Std.int(getActorByName(id).width * scale)); }); + + Lua_helper.add_callback(lua, "setActorScaleXY", function(scaleX:Float, scaleY:Float, id:String) + { + getActorByName(id).setGraphicSize(Std.int(getActorByName(id).width * scaleX), Std.int(getActorByName(id).height * scaleY)); + }); + Lua_helper.add_callback(lua, "setActorFlipX", function(flip:Bool, id:String) + { + getActorByName(id).flipX = flip; + }); + + Lua_helper.add_callback(lua, "setActorFlipY", function(flip:Bool, id:String) + { + getActorByName(id).flipY = flip; + }); Lua_helper.add_callback(lua,"getActorWidth", function (id:String) { return getActorByName(id).width; From 300c9f8baa530f1763dc715d61e5b5700d0eba27 Mon Sep 17 00:00:00 2001 From: Carson Kompon Date: Sat, 22 May 2021 21:37:47 -0400 Subject: [PATCH 05/15] Added setActorScaleXY, setActorFlipX and setActorFlipY Also removed the non-existent setActorScaleX and setActorScaleY --- docs/modchart.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/modchart.md b/docs/modchart.md index 40a6a9218d..6d872c5fc7 100644 --- a/docs/modchart.md +++ b/docs/modchart.md @@ -381,13 +381,17 @@ Set's the angle for the sprite id Set's the scale for the sprite id -##### setActorScaleX(float x, string/int id) **Currently broken** +##### setActorScaleXY(float scaleX, float scaleY, string/int id) -Set's the scale x for the sprite id +Set's the x and y scale for the sprite id -##### setActorScaleY(float y, string/int id) **Currently broken** +##### setActorFlipX(bool flip, string/int id) -Set's the scale y for the sprite id +Set's the x flip for the sprite id + +##### setActorFlipY(bool flip, string/int id) + +Set's the y flip for the sprite id ##### getActorWidth(string/int id) From 88e3505458fa98f4507a83e3aac7d6881e4c084d Mon Sep 17 00:00:00 2001 From: Carson Kompon Date: Sat, 22 May 2021 22:09:21 -0400 Subject: [PATCH 06/15] Added setStrumlineY This is essential for making maps with moving arrows --- source/ModchartState.hx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/ModchartState.hx b/source/ModchartState.hx index 64dac14cd5..62fdeb7bcb 100644 --- a/source/ModchartState.hx +++ b/source/ModchartState.hx @@ -400,6 +400,13 @@ class ModchartState PlayState.instance.camHUD.zoom = zoomAmount; }); + // strumline + + Lua_helper.add_callback(lua, "setStrumlineY", function(y:Float) + { + PlayState.instance.strumLine.y = y; + }); + // actors Lua_helper.add_callback(lua,"getRenderedNotes", function() { From f20493cd84cbbca5c87e6621912085a130f89d50 Mon Sep 17 00:00:00 2001 From: Carson Kompon Date: Sat, 22 May 2021 22:11:50 -0400 Subject: [PATCH 07/15] Added setStrumLineY From https://github.com/KadeDev/Kade-Engine/pull/551 --- docs/modchart.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/modchart.md b/docs/modchart.md index 6d872c5fc7..5bf68a5889 100644 --- a/docs/modchart.md +++ b/docs/modchart.md @@ -207,6 +207,12 @@ Set's the current camera's zoom Set's the hud's zoom +### Strumline + +##### setStrumlineY(float y) + +Set's the y position of the strumLine + ### Actors ##### getRenderedNotes() From d55c0bf45ee872989e4efc7a6d2948e01eafd89f Mon Sep 17 00:00:00 2001 From: Kade M Date: Mon, 24 May 2021 18:26:44 -0700 Subject: [PATCH 08/15] polish --- source/OptionsMenu.hx | 43 ++++++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/source/OptionsMenu.hx b/source/OptionsMenu.hx index 31428057e0..448b1ef17e 100644 --- a/source/OptionsMenu.hx +++ b/source/OptionsMenu.hx @@ -1,5 +1,7 @@ package; +import flixel.tweens.FlxEase; +import flixel.tweens.FlxTween; import openfl.Lib; import Options; import Controls.Control; @@ -26,9 +28,9 @@ class OptionsMenu extends MusicBeatState new GhostTapOption("Ghost Tapping is when you tap a direction and it doesn't give you a miss."), new Judgement("Customize your Hit Timings (LEFT or RIGHT)"), #if desktop - new FPSCapOption("Cap your FPS (Left for -10, Right for +10. SHIFT to go faster)"), + new FPSCapOption("Cap your FPS"), #end - new ScrollSpeedOption("Change your scroll speed (Left for -0.1, right for +0.1. If it's at 1, it will be chart dependent)"), + new ScrollSpeedOption("Change your scroll speed (1 = Chart dependent)"), new AccuracyDOption("Change how accuracy is calculated. (Accurate = Simple, Complex = Milisecond Based)"), new ResetButtonOption("Toggle pressing R to gameover."), // new OffsetMenu("Get a note offset based off of your inputs!"), @@ -37,7 +39,7 @@ class OptionsMenu extends MusicBeatState new OptionCatagory("Appearance", [ #if desktop new DistractionsAndEffectsOption("Toggle stage distractions that can hinder your gameplay."), - new RainbowFPSOption("Make the FPS Counter Rainbow (Only works with the FPS Counter toggled on and Flashing Lights toggled off)"), + new RainbowFPSOption("Make the FPS Counter Rainbow"), new AccuracyOption("Display accuracy information."), new NPSDisplayOption("Shows your current Notes Per Second."), new SongPositionOption("Show the songs current position (as a bar)"), @@ -63,7 +65,7 @@ class OptionsMenu extends MusicBeatState public static var versionShit:FlxText; var currentSelectedCat:OptionCatagory; - + var blackBorder:FlxSprite; override function create() { var menuBG:FlxSprite = new FlxSprite().loadGraphic(Paths.image("menuDesat")); @@ -89,11 +91,20 @@ class OptionsMenu extends MusicBeatState currentDescription = "none"; - versionShit = new FlxText(5, FlxG.height - 18, 0, "Offset (Left, Right): " + FlxG.save.data.offset + " - Description - " + currentDescription, 12); + versionShit = new FlxText(5, FlxG.height + 40, 0, "Offset (Left, Right, Shift for slow): " + HelperFunctions.truncateFloat(FlxG.save.data.offset,2) + " - Description - " + currentDescription, 12); versionShit.scrollFactor.set(); versionShit.setFormat("VCR OSD Mono", 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); + + blackBorder = new FlxSprite(-30,FlxG.height + 40).makeGraphic((Std.int(versionShit.width + 900)),Std.int(versionShit.height + 600),FlxColor.BLACK); + blackBorder.alpha = 0.5; + + add(blackBorder); + add(versionShit); + FlxTween.tween(versionShit,{y: FlxG.height - 18},2,{ease: FlxEase.elasticInOut}); + FlxTween.tween(blackBorder,{y: FlxG.height - 18},2, {ease: FlxEase.elasticInOut}); + super.create(); } @@ -127,6 +138,7 @@ class OptionsMenu extends MusicBeatState if (isCat) { + if (currentSelectedCat.getOptions()[curSelected].getAccept()) { if (FlxG.keys.pressed.SHIFT) @@ -159,8 +171,12 @@ class OptionsMenu extends MusicBeatState else if (FlxG.keys.pressed.LEFT) FlxG.save.data.offset -= 0.1; - versionShit.text = "Offset (Left, Right, Shift for slow): " + HelperFunctions.truncateFloat(FlxG.save.data.offset,2) + " - Description - " + currentDescription; + } + if (currentSelectedCat.getOptions()[curSelected].getAccept()) + versionShit.text = currentSelectedCat.getOptions()[curSelected].getValue() + " - Description - " + currentDescription; + else + versionShit.text = "Offset (Left, Right, Shift for slow): " + HelperFunctions.truncateFloat(FlxG.save.data.offset,2) + " - Description - " + currentDescription; } else { @@ -175,8 +191,6 @@ class OptionsMenu extends MusicBeatState FlxG.save.data.offset += 0.1; else if (FlxG.keys.pressed.LEFT) FlxG.save.data.offset -= 0.1; - - versionShit.text = "Offset (Left, Right, Shift for slow): " + HelperFunctions.truncateFloat(FlxG.save.data.offset,2) + " - Description - " + currentDescription; } @@ -234,8 +248,15 @@ class OptionsMenu extends MusicBeatState currentDescription = currentSelectedCat.getOptions()[curSelected].getDescription(); else currentDescription = "Please select a category"; - versionShit.text = "Offset (Left, Right, Shift for slow): " + HelperFunctions.truncateFloat(FlxG.save.data.offset,2) + " - Description - " + currentDescription; - + if (isCat) + { + if (currentSelectedCat.getOptions()[curSelected].getAccept()) + versionShit.text = currentSelectedCat.getOptions()[curSelected].getValue() + " - Description - " + currentDescription; + else + versionShit.text = "Offset (Left, Right, Shift for slow): " + HelperFunctions.truncateFloat(FlxG.save.data.offset,2) + " - Description - " + currentDescription; + } + else + versionShit.text = "Offset (Left, Right, Shift for slow): " + HelperFunctions.truncateFloat(FlxG.save.data.offset,2) + " - Description - " + currentDescription; // selector.y = (70 * curSelected) + 30; var bullShit:Int = 0; @@ -255,4 +276,4 @@ class OptionsMenu extends MusicBeatState } } } -} \ No newline at end of file +} From 7ff4cd9214f1754551399e75720ffa915d6fa076 Mon Sep 17 00:00:00 2001 From: Kade M Date: Mon, 24 May 2021 18:27:04 -0700 Subject: [PATCH 09/15] puyo is going to get mad at me for doing this lol --- source/Options.hx | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/source/Options.hx b/source/Options.hx index cb39f74311..b4764ca57b 100644 --- a/source/Options.hx +++ b/source/Options.hx @@ -63,6 +63,7 @@ class Option return description; } + public function getValue():String { return throw "stub!"; }; // Returns whether the label is to be updated. public function press():Bool { return throw "stub!"; } @@ -274,14 +275,16 @@ class Judgement extends Option FlxG.save.data.frames = Conductor.safeFrames; Conductor.recalculateTimings(); + return true; + } - OptionsMenu.versionShit.text = "Current Safe Frames: " + Conductor.safeFrames + " - Description - " + description + + override function getValue():String { + return Conductor.safeFrames + " - " + " - SIK: " + HelperFunctions.truncateFloat(45 * Conductor.timeScale, 0) + "ms GD: " + HelperFunctions.truncateFloat(90 * Conductor.timeScale, 0) + "ms BD: " + HelperFunctions.truncateFloat(135 * Conductor.timeScale, 0) + "ms SHT: " + HelperFunctions.truncateFloat(155 * Conductor.timeScale, 0) + "ms TOTAL: " + HelperFunctions.truncateFloat(Conductor.safeZoneOffset,0) + "ms"; - return true; } override function right():Bool { @@ -293,13 +296,6 @@ class Judgement extends Option FlxG.save.data.frames = Conductor.safeFrames; Conductor.recalculateTimings(); - - OptionsMenu.versionShit.text = "Current Safe Frames: " + Conductor.safeFrames + " - Description - " + description + - " - SIK: " + HelperFunctions.truncateFloat(44 * Conductor.timeScale, 0) + - "ms GD: " + HelperFunctions.truncateFloat(45 * Conductor.timeScale, 0) + - "ms BD: " + HelperFunctions.truncateFloat(90 * Conductor.timeScale, 0) + - "ms SHT: " + HelperFunctions.truncateFloat(135 * Conductor.timeScale, 0) + - "ms TOTAL: " + HelperFunctions.truncateFloat(Conductor.safeZoneOffset,0) + "ms"; return true; } } @@ -357,8 +353,6 @@ class FPSCapOption extends Option FlxG.save.data.fpsCap = FlxG.save.data.fpsCap + 10; (cast (Lib.current.getChildAt(0), Main)).setFPSCap(FlxG.save.data.fpsCap); - OptionsMenu.versionShit.text = "Current FPS Cap: " + FlxG.save.data.fpsCap + " - Description - " + description; - return true; } @@ -370,13 +364,14 @@ class FPSCapOption extends Option else FlxG.save.data.fpsCap = FlxG.save.data.fpsCap - 10; (cast (Lib.current.getChildAt(0), Main)).setFPSCap(FlxG.save.data.fpsCap); - - OptionsMenu.versionShit.text = "Current FPS Cap: " + FlxG.save.data.fpsCap + - (FlxG.save.data.fpsCap == Application.current.window.displayMode.refreshRate ? "Hz (Refresh Rate)" : "") - + " - Description - " + description; - return true; } + + override function getValue():String + { + return "Current FPS Cap: " + FlxG.save.data.fpsCap + + (FlxG.save.data.fpsCap == Application.current.window.displayMode.refreshRate ? "Hz (Refresh Rate)" : ""); + } } @@ -407,11 +402,13 @@ class ScrollSpeedOption extends Option if (FlxG.save.data.scrollSpeed > 10) FlxG.save.data.scrollSpeed = 10; - - OptionsMenu.versionShit.text = "Current Scroll Speed: " + HelperFunctions.truncateFloat(FlxG.save.data.scrollSpeed,1) + " - Description - " + description; return true; } + override function getValue():String { + return "Current Scroll Speed: " + HelperFunctions.truncateFloat(FlxG.save.data.scrollSpeed,1); + } + override function left():Bool { FlxG.save.data.scrollSpeed -= 0.1; @@ -421,8 +418,6 @@ class ScrollSpeedOption extends Option if (FlxG.save.data.scrollSpeed > 10) FlxG.save.data.scrollSpeed = 10; - - OptionsMenu.versionShit.text = "Current Scroll Speed: " + HelperFunctions.truncateFloat(FlxG.save.data.scrollSpeed,1) + " - Description - " + description; return true; } } @@ -602,4 +597,4 @@ class BotPlay extends Option private override function updateDisplay():String return "BotPlay " + (FlxG.save.data.botplay ? "on" : "off"); -} \ No newline at end of file +} From b72908264d15da9a161001b4d8c286c2b644a130 Mon Sep 17 00:00:00 2001 From: Kade M Date: Mon, 24 May 2021 19:13:57 -0700 Subject: [PATCH 10/15] pog changes --- source/ChartingState.hx | 113 ++++++++++++++++++++++----------------- source/KadeEngineData.hx | 3 ++ source/MainMenuState.hx | 36 ++++++++----- source/Options.hx | 23 ++++++++ source/OptionsMenu.hx | 1 + source/PlayState.hx | 15 +++--- source/TitleState.hx | 2 + 7 files changed, 127 insertions(+), 66 deletions(-) diff --git a/source/ChartingState.hx b/source/ChartingState.hx index 105d2a1808..122af1e341 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -1,5 +1,6 @@ package; +import flixel.FlxCamera; import flixel.addons.ui.FlxUIText; import haxe.zip.Writer; import Conductor.BPMChangeEvent; @@ -42,6 +43,10 @@ class ChartingState extends MusicBeatState { var _file:FileReference; + public var playClaps:Bool = false; + + public var snap:Int = 2; + var UI_box:FlxUITabMenu; /** @@ -91,6 +96,8 @@ class ChartingState extends MusicBeatState private var lastNote:Note; var claps:Array = []; + public var snapText:FlxText; + override function create() { curSection = lastSection; @@ -117,6 +124,9 @@ class ChartingState extends MusicBeatState gridBG = FlxGridOverlay.create(GRID_SIZE, GRID_SIZE, GRID_SIZE * 8, GRID_SIZE * 16); add(gridBG); + snapText = new FlxText(-100,10,0,"Snap: 1/" + snap + " (Control + Left or Right to change.)\nAdd Notes: 1-8 (or click)\n", 24); + snapText.scrollFactor.set(); + gridBlackLine = new FlxSprite(gridBG.x + gridBG.width / 2).makeGraphic(2, Std.int(gridBG.height), FlxColor.BLACK); add(gridBlackLine); @@ -183,6 +193,10 @@ class ChartingState extends MusicBeatState add(curRenderedNotes); add(curRenderedSustains); + add(snapText); + + + super.create(); } @@ -263,6 +277,14 @@ class ChartingState extends MusicBeatState stepperSongVol.value = FlxG.sound.music.volume; stepperSongVol.name = 'song_instvol'; + + var hitsounds = new FlxUICheckBox(10, stepperSongVol.y + 35, null, null, "Play hitsounds", 100); + hitsounds.checked = false; + hitsounds.callback = function() + { + playClaps = hitsounds.checked; + }; + var stepperSongVolLabel = new FlxText(74, 110, 'Instrumental Volume'); var characters:Array = CoolUtil.coolTextFile(Paths.txt('characterList')); @@ -328,7 +350,8 @@ class ChartingState extends MusicBeatState tab_group_song.add(stepperVocalVolLabel); tab_group_song.add(stepperSongVol); tab_group_song.add(stepperSongVolLabel); - + tab_group_song.add(hitsounds); + var tab_group_assets = new FlxUI(null, UI_box); tab_group_assets.name = "Assets"; tab_group_assets.add(noteStyleDropDown); @@ -436,7 +459,6 @@ class ChartingState extends MusicBeatState var applyLength:FlxButton = new FlxButton(10, 100, 'Apply Data'); - tab_group_note.add(writingNotesText); tab_group_note.add(stepperSusLength); tab_group_note.add(stepperSusLengthLabel); tab_group_note.add(applyLength); @@ -608,6 +630,8 @@ class ChartingState extends MusicBeatState { updateHeads(); + snapText.text = "Snap: " + snap; + curStep = recalculateSteps(); if (FlxG.keys.justPressed.ALT && UI_box.selected_tab == 0) @@ -615,64 +639,57 @@ class ChartingState extends MusicBeatState writingNotes = !writingNotes; } - if (writingNotes) - writingNotesText.text = "WRITING NOTES"; - else - writingNotesText.text = ""; - + if (FlxG.keys.pressed.CONTROL && FlxG.keys.justPressed.RIGHT) + snap = snap * 2; + if (FlxG.keys.pressed.CONTROL && FlxG.keys.justPressed.LEFT) + snap = Math.round(snap / 2); + if (snap >= 192) + snap = 192; + if (snap <= 2) + snap = 2; Conductor.songPosition = FlxG.sound.music.time; _song.song = typingShit.text; - var upP = controls.UP_P; - var rightP = controls.RIGHT_P; - var downP = controls.DOWN_P; - var leftP = controls.LEFT_P; + var left = FlxG.keys.justPressed.ONE; + var down = FlxG.keys.justPressed.TWO; + var up = FlxG.keys.justPressed.THREE; + var right = FlxG.keys.justPressed.FOUR; + var leftO = FlxG.keys.justPressed.FIVE; + var downO = FlxG.keys.justPressed.SIX; + var upO = FlxG.keys.justPressed.SEVEN; + var rightO = FlxG.keys.justPressed.EIGHT; - var controlArray:Array = [leftP, downP, upP, rightP]; + var pressArray = [left, down, up, right, leftO, downO, upO, rightO]; - if ((upP || rightP || downP || leftP) && writingNotes) + for (p in 0...pressArray.length) { - for(i in 0...controlArray.length) - { - if (controlArray[i]) - { - for (n in 0..._song.notes[curSection].sectionNotes.length) - { - var note = _song.notes[curSection].sectionNotes[n]; - if (note == null) - continue; - if (note[0] == Conductor.songPosition && note[1] % 4 == i) - { - trace('GAMING'); - _song.notes[curSection].sectionNotes.remove(note); - } - } - trace('adding note'); - _song.notes[curSection].sectionNotes.push([Conductor.songPosition, i, 0]); - updateGrid(); - } - } - + var i = pressArray[p]; + if (i) + addNote(new Note(Conductor.songPosition,p)); } strumLine.y = getYfromStrum((Conductor.songPosition - sectionStartTime()) % (Conductor.stepCrochet * _song.notes[curSection].lengthInSteps)); - curRenderedNotes.forEach(function(note:Note) + + + if (playClaps) { - if (FlxG.sound.music.playing) + curRenderedNotes.forEach(function(note:Note) { - FlxG.overlap(strumLine, note, function(_, _) + if (FlxG.sound.music.playing) { - if(!claps.contains(note)) + FlxG.overlap(strumLine, note, function(_, _) { - claps.push(note); - if(_song.notes[curSection].mustHitSection) FlxG.sound.play(Paths.sound('CLAP')); - else FlxG.sound.play(Paths.sound('SNAP')); - } - }); - } - }); - + if(!claps.contains(note)) + { + claps.push(note); + if(_song.notes[curSection].mustHitSection) FlxG.sound.play(Paths.sound('CLAP')); + else FlxG.sound.play(Paths.sound('SNAP')); + } + }); + } + }); + } /*curRenderedNotes.forEach(function(note:Note) { if (strumLine.overlaps(note) && strumLine.y == note.y) // yandere dev type shit { @@ -857,7 +874,7 @@ class ChartingState extends MusicBeatState var shiftThing:Int = 1; if (FlxG.keys.pressed.SHIFT) shiftThing = 4; - if (!writingNotes) + if (!FlxG.keys.pressed.CONTROL) { if (FlxG.keys.justPressed.RIGHT || FlxG.keys.justPressed.D) changeSection(curSection + shiftThing); @@ -892,7 +909,7 @@ class ChartingState extends MusicBeatState FlxG.sound.music.pause(); vocals.pause(); - FlxG.sound.music.time -= (FlxG.mouse.wheel * Conductor.stepCrochet * 0.4); + FlxG.sound.music.time -= (FlxG.mouse.wheel * Conductor.crochet / snap * 0.4); vocals.time = FlxG.sound.music.time; } diff --git a/source/KadeEngineData.hx b/source/KadeEngineData.hx index 34528b233c..0627c24ae2 100644 --- a/source/KadeEngineData.hx +++ b/source/KadeEngineData.hx @@ -72,6 +72,9 @@ class KadeEngineData if (FlxG.save.data.botplay == null) FlxG.save.data.botplay = false; + if (FlxG.save.data.cpuStrums == null) + FlxG.save.data.cpuStrums = false; + Conductor.recalculateTimings(); Main.watermarks = FlxG.save.data.watermark; diff --git a/source/MainMenuState.hx b/source/MainMenuState.hx index dc699de312..ef71372e00 100644 --- a/source/MainMenuState.hx +++ b/source/MainMenuState.hx @@ -35,7 +35,7 @@ class MainMenuState extends MusicBeatState var newGaming:FlxText; var newGaming2:FlxText; - var newInput:Bool = true; + public static var firstStart:Bool = true; public static var nightly:String = ""; @@ -44,6 +44,7 @@ class MainMenuState extends MusicBeatState var magenta:FlxSprite; var camFollow:FlxObject; + public static var finishedFunnyMove:Bool = false; override function create() { @@ -59,9 +60,9 @@ class MainMenuState extends MusicBeatState persistentUpdate = persistentDraw = true; - var bg:FlxSprite = new FlxSprite(-80).loadGraphic(Paths.image('menuBG')); + var bg:FlxSprite = new FlxSprite(-100).loadGraphic(Paths.image('menuBG')); bg.scrollFactor.x = 0; - bg.scrollFactor.y = 0.15; + bg.scrollFactor.y = 0.10; bg.setGraphicSize(Std.int(bg.width * 1.1)); bg.updateHitbox(); bg.screenCenter(); @@ -73,7 +74,7 @@ class MainMenuState extends MusicBeatState magenta = new FlxSprite(-80).loadGraphic(Paths.image('menuDesat')); magenta.scrollFactor.x = 0; - magenta.scrollFactor.y = 0.15; + magenta.scrollFactor.y = 0.10; magenta.setGraphicSize(Std.int(magenta.width * 1.1)); magenta.updateHitbox(); magenta.screenCenter(); @@ -90,7 +91,7 @@ class MainMenuState extends MusicBeatState for (i in 0...optionShit.length) { - var menuItem:FlxSprite = new FlxSprite(0, 60 + (i * 160)); + var menuItem:FlxSprite = new FlxSprite(0, FlxG.height * 1.6); menuItem.frames = tex; menuItem.animation.addByPrefix('idle', optionShit[i] + " basic", 24); menuItem.animation.addByPrefix('selected', optionShit[i] + " white", 24); @@ -100,8 +101,17 @@ class MainMenuState extends MusicBeatState menuItems.add(menuItem); menuItem.scrollFactor.set(); menuItem.antialiasing = true; + if (firstStart) + FlxTween.tween(menuItem,{y: 60 + (i * 160)},1 + (i * 0.25) ,{ease: FlxEase.bounceInOut, onComplete: function(flxTween:FlxTween) + { + finishedFunnyMove = true; + }}); + else + menuItem.y = 60 + (i * 160); } + firstStart = false; + FlxG.camera.follow(camFollow, null, 0.60 * (60 / FlxG.save.data.fpsCap)); var versionShit:FlxText = new FlxText(5, FlxG.height - 18, 0, gameVer + (Main.watermarks ? " FNF - " + kadeEngineVer + " Kade Engine" : ""), 12); @@ -231,18 +241,20 @@ class MainMenuState extends MusicBeatState function changeItem(huh:Int = 0) { - curSelected += huh; - - if (curSelected >= menuItems.length) - curSelected = 0; - if (curSelected < 0) - curSelected = menuItems.length - 1; + if (finishedFunnyMove) + { + curSelected += huh; + if (curSelected >= menuItems.length) + curSelected = 0; + if (curSelected < 0) + curSelected = menuItems.length - 1; + } menuItems.forEach(function(spr:FlxSprite) { spr.animation.play('idle'); - if (spr.ID == curSelected) + if (spr.ID == curSelected && finishedFunnyMove) { spr.animation.play('selected'); camFollow.setPosition(spr.getGraphicMidpoint().x, spr.getGraphicMidpoint().y); diff --git a/source/Options.hx b/source/Options.hx index b4764ca57b..f3a1473ac7 100644 --- a/source/Options.hx +++ b/source/Options.hx @@ -103,6 +103,29 @@ class DFJKOption extends Option } } +class CpuStrums extends Option +{ + public function new(desc:String) + { + super(); + description = desc; + } + + public override function press():Bool + { + FlxG.save.data.cpuStrums = !FlxG.save.data.cpuStrums; + + display = updateDisplay(); + return true; + } + + private override function updateDisplay():String + { + return FlxG.save.data.dfjk ? "Light CPU Strums" : "CPU Strums stay static"; + } + +} + class DownscrollOption extends Option { public function new(desc:String) diff --git a/source/OptionsMenu.hx b/source/OptionsMenu.hx index 448b1ef17e..51563481a0 100644 --- a/source/OptionsMenu.hx +++ b/source/OptionsMenu.hx @@ -43,6 +43,7 @@ class OptionsMenu extends MusicBeatState new AccuracyOption("Display accuracy information."), new NPSDisplayOption("Shows your current Notes Per Second."), new SongPositionOption("Show the songs current position (as a bar)"), + new CpuStrums("CPU's strumline lights up when a note hits it."), #else new DistractionsAndEffectsOption("Toggle stage distractions that can hinder your gameplay.") #end diff --git a/source/PlayState.hx b/source/PlayState.hx index b2a5fc3be6..7b31a0afca 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2374,14 +2374,17 @@ class PlayState extends MusicBeatState }); } - cpuStrums.forEach(function(spr:FlxSprite) + if (FlxG.save.data.cpuStrums) { - if (spr.animation.finished) + cpuStrums.forEach(function(spr:FlxSprite) { - spr.animation.play('static'); - spr.centerOffsets(); - } - }); + if (spr.animation.finished) + { + spr.animation.play('static'); + spr.centerOffsets(); + } + }); + } if (!inCutscene) keyShit(); diff --git a/source/TitleState.hx b/source/TitleState.hx index 213d816aca..3bf0d80b66 100644 --- a/source/TitleState.hx +++ b/source/TitleState.hx @@ -304,6 +304,8 @@ class TitleState extends MusicBeatState transitioning = true; // FlxG.sound.music.stop(); + MainMenuState.firstStart = true; + new FlxTimer().start(2, function(tmr:FlxTimer) { // Get current version of Kade Engine From e991a71ca920ad6ce6411e73ada10d51d18ff4e6 Mon Sep 17 00:00:00 2001 From: Kade M Date: Mon, 24 May 2021 19:21:39 -0700 Subject: [PATCH 11/15] fancy shit --- source/ChartingState.hx | 10 ++++++++-- source/MainMenuState.hx | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/source/ChartingState.hx b/source/ChartingState.hx index 122af1e341..61b3105018 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -124,7 +124,12 @@ class ChartingState extends MusicBeatState gridBG = FlxGridOverlay.create(GRID_SIZE, GRID_SIZE, GRID_SIZE * 8, GRID_SIZE * 16); add(gridBG); - snapText = new FlxText(-100,10,0,"Snap: 1/" + snap + " (Control + Left or Right to change.)\nAdd Notes: 1-8 (or click)\n", 24); + var blackBorder:FlxSprite = new FlxSprite(60,10).makeGraphic(120,100,FlxColor.BLACK); + blackBorder.scrollFactor.set(); + + blackBorder.alpha = 0.3; + + snapText = new FlxText(60,10,0,"Snap: 1/" + snap + " (Control + Left or Right to change.)\nAdd Notes: 1-8 (or click)\n", 14); snapText.scrollFactor.set(); gridBlackLine = new FlxSprite(gridBG.x + gridBG.width / 2).makeGraphic(2, Std.int(gridBG.height), FlxColor.BLACK); @@ -193,6 +198,7 @@ class ChartingState extends MusicBeatState add(curRenderedNotes); add(curRenderedSustains); + add(blackBorder); add(snapText); @@ -630,7 +636,7 @@ class ChartingState extends MusicBeatState { updateHeads(); - snapText.text = "Snap: " + snap; + snapText.text = "Snap: 1/" + snap + " (Control + Left or Right to change.)\nAdd Notes: 1-8 (or click)\n"; curStep = recalculateSteps(); diff --git a/source/MainMenuState.hx b/source/MainMenuState.hx index ef71372e00..93c0881b08 100644 --- a/source/MainMenuState.hx +++ b/source/MainMenuState.hx @@ -102,7 +102,7 @@ class MainMenuState extends MusicBeatState menuItem.scrollFactor.set(); menuItem.antialiasing = true; if (firstStart) - FlxTween.tween(menuItem,{y: 60 + (i * 160)},1 + (i * 0.25) ,{ease: FlxEase.bounceInOut, onComplete: function(flxTween:FlxTween) + FlxTween.tween(menuItem,{y: 60 + (i * 160)},1 + (i * 0.25) ,{ease: FlxEase.expoInOut, onComplete: function(flxTween:FlxTween) { finishedFunnyMove = true; }}); From b047eb7a723d5ad27f27e7cc6a735321a4f67dac Mon Sep 17 00:00:00 2001 From: Kade M Date: Mon, 24 May 2021 19:46:07 -0700 Subject: [PATCH 12/15] more fixes and other crap --- source/Alphabet.hx | 9 ++++++++- source/FreeplayState.hx | 2 +- source/Options.hx | 2 +- source/OptionsMenu.hx | 2 +- source/PlayState.hx | 29 ++++++++++++++++------------- 5 files changed, 27 insertions(+), 17 deletions(-) diff --git a/source/Alphabet.hx b/source/Alphabet.hx index c16de50fb9..56d07e23b0 100644 --- a/source/Alphabet.hx +++ b/source/Alphabet.hx @@ -1,5 +1,7 @@ package; +import flixel.tweens.FlxEase; +import flixel.tweens.FlxTween; import flixel.FlxG; import flixel.FlxSprite; import flixel.graphics.frames.FlxAtlasFrames; @@ -36,11 +38,13 @@ class Alphabet extends FlxSpriteGroup var xPosResetted:Bool = false; var lastWasSpace:Bool = false; + var listOAlphabets:List = new List(); + var splitWords:Array = []; var isBold:Bool = false; - public function new(x:Float, y:Float, text:String = "", ?bold:Bool = false, typed:Bool = false) + public function new(x:Float, y:Float, text:String = "", ?bold:Bool = false, typed:Bool = false, shouldMove:Bool = false) { super(x, y); @@ -58,6 +62,7 @@ class Alphabet extends FlxSpriteGroup { addText(); } + } } @@ -93,6 +98,7 @@ class Alphabet extends FlxSpriteGroup // var letter:AlphaCharacter = new AlphaCharacter(30 * loopNum, 0); var letter:AlphaCharacter = new AlphaCharacter(xPos, 0); + listOAlphabets.add(letter); if (isBold) letter.createBold(character); @@ -178,6 +184,7 @@ class Alphabet extends FlxSpriteGroup // var letter:AlphaCharacter = new AlphaCharacter(30 * loopNum, 0); var letter:AlphaCharacter = new AlphaCharacter(xPos, 55 * yMulti); + listOAlphabets.add(letter); letter.row = curRow; if (isBold) { diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx index 53af317022..97366d3d3e 100644 --- a/source/FreeplayState.hx +++ b/source/FreeplayState.hx @@ -76,7 +76,7 @@ class FreeplayState extends MusicBeatState for (i in 0...songs.length) { - var songText:Alphabet = new Alphabet(0, (70 * i) + 30, songs[i].songName, true, false); + var songText:Alphabet = new Alphabet(0, (70 * i) + 30, songs[i].songName, true, false, true); songText.isMenuItem = true; songText.targetY = i; grpSongs.add(songText); diff --git a/source/Options.hx b/source/Options.hx index f3a1473ac7..6b324d58af 100644 --- a/source/Options.hx +++ b/source/Options.hx @@ -302,7 +302,7 @@ class Judgement extends Option } override function getValue():String { - return Conductor.safeFrames + " - " + + return "Safe Frames: " + Conductor.safeFrames + " - SIK: " + HelperFunctions.truncateFloat(45 * Conductor.timeScale, 0) + "ms GD: " + HelperFunctions.truncateFloat(90 * Conductor.timeScale, 0) + "ms BD: " + HelperFunctions.truncateFloat(135 * Conductor.timeScale, 0) + diff --git a/source/OptionsMenu.hx b/source/OptionsMenu.hx index 51563481a0..3526ccc6e0 100644 --- a/source/OptionsMenu.hx +++ b/source/OptionsMenu.hx @@ -83,7 +83,7 @@ class OptionsMenu extends MusicBeatState for (i in 0...options.length) { - var controlLabel:Alphabet = new Alphabet(0, (70 * i) + 30, options[i].getName(), true, false); + var controlLabel:Alphabet = new Alphabet(0, (70 * i) + 30, options[i].getName(), true, false, true); controlLabel.isMenuItem = true; controlLabel.targetY = i; grpControls.add(controlLabel); diff --git a/source/PlayState.hx b/source/PlayState.hx index 7b31a0afca..8b8f5675b4 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2288,21 +2288,24 @@ class PlayState extends MusicBeatState dad.playAnim('singLEFT' + altAnim, true); } - cpuStrums.forEach(function(spr:FlxSprite) + if (FlxG.save.data.cpuStrums) { - if (Math.abs(daNote.noteData) == spr.ID) + cpuStrums.forEach(function(spr:FlxSprite) { - spr.animation.play('confirm', true); - } - if (spr.animation.curAnim.name == 'confirm' && !curStage.startsWith('school')) - { - spr.centerOffsets(); - spr.offset.x -= 13; - spr.offset.y -= 13; - } - else - spr.centerOffsets(); - }); + if (Math.abs(daNote.noteData) == spr.ID) + { + spr.animation.play('confirm', true); + } + if (spr.animation.curAnim.name == 'confirm' && !curStage.startsWith('school')) + { + spr.centerOffsets(); + spr.offset.x -= 13; + spr.offset.y -= 13; + } + else + spr.centerOffsets(); + }); + } #if windows if (luaModchart != null) From 1165994d3e7c33d5cb862fca1803dfa2426d25be Mon Sep 17 00:00:00 2001 From: Kade M Date: Mon, 24 May 2021 19:48:22 -0700 Subject: [PATCH 13/15] oops --- source/Options.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Options.hx b/source/Options.hx index 6b324d58af..ff961491b2 100644 --- a/source/Options.hx +++ b/source/Options.hx @@ -121,7 +121,7 @@ class CpuStrums extends Option private override function updateDisplay():String { - return FlxG.save.data.dfjk ? "Light CPU Strums" : "CPU Strums stay static"; + return FlxG.save.data.cpuStrums ? "Light CPU Strums" : "CPU Strums stay static"; } } From 99e5ac3c855ddbb9b376bc57b1683ba45a8a2596 Mon Sep 17 00:00:00 2001 From: Kade M Date: Mon, 24 May 2021 20:30:02 -0700 Subject: [PATCH 14/15] snapping progress --- source/ChartingState.hx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/source/ChartingState.hx b/source/ChartingState.hx index 61b3105018..64b33bcb53 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -45,7 +45,7 @@ class ChartingState extends MusicBeatState public var playClaps:Bool = false; - public var snap:Int = 2; + public var snap:Int = 1; var UI_box:FlxUITabMenu; @@ -615,6 +615,12 @@ class ChartingState extends MusicBeatState else return _song.notes[curSection].lengthInSteps; }*/ + + function stepStartTime(step):Float + { + return _song.bpm / (step / 4) / 60; + } + function sectionStartTime():Float { var daBPM:Int = _song.bpm; @@ -651,8 +657,8 @@ class ChartingState extends MusicBeatState snap = Math.round(snap / 2); if (snap >= 192) snap = 192; - if (snap <= 2) - snap = 2; + if (snap <= 1) + snap = 1; Conductor.songPosition = FlxG.sound.music.time; _song.song = typingShit.text; @@ -915,7 +921,8 @@ class ChartingState extends MusicBeatState FlxG.sound.music.pause(); vocals.pause(); - FlxG.sound.music.time -= (FlxG.mouse.wheel * Conductor.crochet / snap * 0.4); + FlxG.sound.music.time += (FlxG.mouse.wheel * Conductor.stepCrochet / snap); + vocals.time = FlxG.sound.music.time; } From e02d9a546f1a3a13189de123e95d3c965810e87d Mon Sep 17 00:00:00 2001 From: Kade M Date: Mon, 24 May 2021 20:45:15 -0700 Subject: [PATCH 15/15] lock at 1 snap for now --- source/ChartingState.hx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/ChartingState.hx b/source/ChartingState.hx index 64b33bcb53..1b090d8121 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -651,14 +651,14 @@ class ChartingState extends MusicBeatState writingNotes = !writingNotes; } - if (FlxG.keys.pressed.CONTROL && FlxG.keys.justPressed.RIGHT) + /*if (FlxG.keys.pressed.CONTROL && FlxG.keys.justPressed.RIGHT) snap = snap * 2; if (FlxG.keys.pressed.CONTROL && FlxG.keys.justPressed.LEFT) snap = Math.round(snap / 2); if (snap >= 192) snap = 192; if (snap <= 1) - snap = 1; + snap = 1;*/ Conductor.songPosition = FlxG.sound.music.time; _song.song = typingShit.text; @@ -921,7 +921,7 @@ class ChartingState extends MusicBeatState FlxG.sound.music.pause(); vocals.pause(); - FlxG.sound.music.time += (FlxG.mouse.wheel * Conductor.stepCrochet / snap); + FlxG.sound.music.time = curStep * Conductor.stepCrochet - (FlxG.mouse.wheel * Conductor.stepCrochet / snap); vocals.time = FlxG.sound.music.time; }