Merge branch 'FunkinCrew:main' into debelop-freeplay-patch

This commit is contained in:
rich 2024-05-15 16:31:57 +04:00 committed by GitHub
commit 7a19bd4b50
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 111 additions and 39 deletions

View file

@ -4,6 +4,24 @@ All notable changes will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.3.3] - 2024-05-14
### Changed
- Cleaned up some code in `PlayAnimationSongEvent.hx` (thanks BurgerBalls!)
### Fixed
- Fix Web Loading Bar (thanks lemz1!)
- Don't allow any more inputs when exiting freeplay (thanks gamerbros!)
- Fixed using mouse wheel to scroll on freeplay (thanks JugieNoob!)
- Fixed the reset's of the health icons, score, and notes when re-entering gameplay from gameover (thanks ImCodist!)
- Fixed the chart editor character selector's hitbox width (thanks MadBear422!)
- Fixed camera stutter once a wipe transition to the Main Menu completes (thanks ImCodist!)
- Fixed an issue where hold note would be invisible for a single frame (thanks ImCodist!)
- Fix tween accumulation on title screen when pressing Y multiple times (thanks TheGaloXx!)
- Fix for a game over easter egg so you don't accidentally exit it when viewing
- Fix a crash when querying FlxG.state in the crash handler
- Fix an issue where the Freeplay menu never displays 100% clear
- Chart debug key now properly returns you to the previous chart editor session if you were playtesting a chart (thanks nebulazorua!)
- Hopefully fixed Freeplay crashes on AMD gpu's
## [0.3.2] - 2024-05-03 ## [0.3.2] - 2024-05-03
### Added ### Added
- Added `,` and `.` keybinds to the Chart Editor. These place Focus Camera events at the playhead, for the opponent and player respectively. - Added `,` and `.` keybinds to the Chart Editor. These place Focus Camera events at the playhead, for the opponent and player respectively.

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<project> <project>
<!-- _________________________ Application Settings _________________________ --> <!-- _________________________ Application Settings _________________________ -->
<app title="Friday Night Funkin'" file="Funkin" packageName="com.funkin.fnf" package="com.funkin.fnf" main="Main" version="0.3.2" company="ninjamuffin99" /> <app title="Friday Night Funkin'" file="Funkin" packageName="com.funkin.fnf" package="com.funkin.fnf" main="Main" version="0.3.3" company="ninjamuffin99" />
<!--Switch Export with Unique ApplicationID and Icon--> <!--Switch Export with Unique ApplicationID and Icon-->
<set name="APP_ID" value="0x0100f6c013bbc000" /> <set name="APP_ID" value="0x0100f6c013bbc000" />

2
assets

@ -1 +1 @@
Subproject commit 962130b2243a839106607d08a11599b1857bf8b3 Subproject commit 783f22e741c85223da7f3f815b28fc4c6f240cbc

View file

@ -1,31 +1,31 @@
# Funkin' Debug Hotkeys # Funkin' Debug Hotkeys
`F4` (EVERYWHERE) - Leave Current State and move to Main Menu Most of this functionality is only available on debug builds of the game!
`F5` (EVERYWHERE) - Hot Reload Data Files
`Y` (Title Screen) - WOAH ## Any State
- `F2`: ***OVERLAY***: Enables the Flixel debug overlay, which has partial support for scripting.
- `F3`: ***SCREENSHOT***: Takes a screenshot of the game and saves it to the local `screenshots` directory. Works outside of debug builds too!
- `F4`: ***EJECT***: Forcibly switch state to the Main Menu (with no extra transition). Useful if you're stuck in a level and you need to get out!
- `F5`: ***HOT RELOAD***: Forcibly reload the game's scripts and data files, then restart the current state. If any files in the `assets` folder have been modified, the game should process the changes for you! NOTE: Known bug, this does not reset song charts or song scripts, but it should reset everything else (such as stage layout data and character animation data).
- `CTRL-SHIFT-L`: ***FORCE CRASH***: Immediately crash the game with a detailed crash log and a stack trace.
`~` (Main Menu) - Access Debug Menu ## **Play State**
- `H`: ***HIDE UI***: Makes the user interface invisible. Works in Pause Menu, great for screenshots.
- `1`: ***END SONG***: Immediately ends the song and moves to Results Screen on Freeplay, or next song on Story Mode.
- `2`: ***GAIN HEALTH***: Debug function, add 10% to the player's health.
- `3`: ***LOSE HEALTH***: Debug function, subtract 5% to the player's health.
- `9`: NEATO!
- `PAGEUP` (MacOS: `Fn-Up`): ***FORWARDS TIME TRAVEL****: Move forward by 2 sections. Hold SHIFT to move forward by 20 sections instead.
- `PAGEDOWN` (MacOS: `Fn-Down`): ***BACKWARDS TIME TRAVEL****: Move backward by 2 sections. Hold SHIFT to move backward by 20 sections instead.
`U` (Play) - Open Stage Editor State ## **Freeplay State**
`H` (Play) - Show/Hide HUD - `F` (Freeplay Menu) - Move to Favorites
`1` (Play) - End Song - `Q` (Freeplay Menu) - Back one category
`2` (Play) - Add 10% Health - `E` (Freeplay Menu) - Forward one category
`3` (Play) - Subtract 5% Health
`7` (Play) - (NOT WORKING) Open Chart Editor
`8` (Play) - Open Animation Editor
`9` (Play) - (Easter Egg) Classic Health Icon
`PGUP`/`Fn+Up` (Play) - Skip Forward In Time
`PGDN`/`Fn+Down` (Play) - 🦃 That's right, we're going to go BACK IN TIME
`F` (Freeplay Menu) - Move to Favorites ## **Title State**
`P` (Freeplay Menu) - Switch to Pico (probably doesn't work) - `Y` - WOAH
`T` (Freeplay Menu) - Start typing in search bar
`Q` (Freeplay Menu) - Back one letter
`E` (Freeplay Menu) - Forward one letter
`Arrows` (Stage Editor) - Move Prop ## **Main Menu**
`Ctrl-Z` (Stage Editor) - Undo - `~`: ***DEBUG****: Opens a menu to access the Chart Editor and other work-in-progress editors. Rebindable in the options menu.
`Y` (Stage Editor) - Leave Stage Editor - `CTRL-ALT-SHIFT-W`: ***ALL ACCESS***: Unlocks all songs in Freeplay. Only available on debug builds.
`H` (Pause Menu) - Hide the Pause Menu UI (good for screenshots!)

View file

@ -40,8 +40,8 @@ class StrokeShader extends FlxShader
void main() void main()
{ {
vec4 sample = flixel_texture2D(bitmap, openfl_TextureCoordv); vec4 gay = flixel_texture2D(bitmap, openfl_TextureCoordv);
if (sample.a == 0.) { if (gay.a == 0.) {
float w = size.x / openfl_TextureSize.x; float w = size.x / openfl_TextureSize.x;
float h = size.y / openfl_TextureSize.y; float h = size.y / openfl_TextureSize.y;
@ -49,9 +49,9 @@ class StrokeShader extends FlxShader
|| flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x - w, openfl_TextureCoordv.y)).a != 0. || flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x - w, openfl_TextureCoordv.y)).a != 0.
|| flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x, openfl_TextureCoordv.y + h)).a != 0. || flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x, openfl_TextureCoordv.y + h)).a != 0.
|| flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x, openfl_TextureCoordv.y - h)).a != 0.) || flixel_texture2D(bitmap, vec2(openfl_TextureCoordv.x, openfl_TextureCoordv.y - h)).a != 0.)
sample = color; gay = color;
} }
gl_FragColor = sample; gl_FragColor = gay;
} }
') ')
public function new(color:FlxColor = 0xFFFFFFFF, width:Float = 1, height:Float = 1) public function new(color:FlxColor = 0xFFFFFFFF, width:Float = 1, height:Float = 1)

View file

@ -527,6 +527,14 @@ class Controls extends FlxActionSet
action.inputs[i].inputID = toAdd; action.inputs[i].inputID = toAdd;
} }
hasReplaced = true; hasReplaced = true;
} else if (input.device == KEYBOARD && input.inputID == toAdd) {
// This key is already bound!
if (hasReplaced) {
// Remove the duplicate keybind, don't replace.
action.inputs.remove(input);
} else {
hasReplaced = true;
}
} }
} }
@ -989,6 +997,7 @@ class Controls extends FlxActionSet
for (control in Control.createAll()) for (control in Control.createAll())
{ {
var inputs:Array<Int> = Reflect.field(data, control.getName()); var inputs:Array<Int> = Reflect.field(data, control.getName());
inputs = inputs.unique();
if (inputs != null) if (inputs != null)
{ {
if (inputs.length == 0) { if (inputs.length == 0) {
@ -1038,7 +1047,11 @@ class Controls extends FlxActionSet
var inputs = getInputsFor(control, device); var inputs = getInputsFor(control, device);
isEmpty = isEmpty && inputs.length == 0; isEmpty = isEmpty && inputs.length == 0;
if (inputs.length == 0) inputs = [FlxKey.NONE]; if (inputs.length == 0) {
inputs = [FlxKey.NONE];
} else {
inputs = inputs.unique();
}
Reflect.setField(data, control.getName(), inputs); Reflect.setField(data, control.getName(), inputs);
} }

View file

@ -83,6 +83,8 @@ class GameOverSubState extends MusicBeatSubState
var isChartingMode:Bool = false; var isChartingMode:Bool = false;
var mustNotExit:Bool = false;
var transparent:Bool; var transparent:Bool;
static final CAMERA_ZOOM_DURATION:Float = 0.5; static final CAMERA_ZOOM_DURATION:Float = 0.5;
@ -240,7 +242,7 @@ class GameOverSubState extends MusicBeatSubState
} }
// KEYBOARD ONLY: Return to the menu when pressing the assigned key. // KEYBOARD ONLY: Return to the menu when pressing the assigned key.
if (controls.BACK) if (controls.BACK && !mustNotExit)
{ {
blueballed = false; blueballed = false;
PlayState.instance.deathCounter = 0; PlayState.instance.deathCounter = 0;

View file

@ -826,6 +826,8 @@ class PlayState extends MusicBeatSubState
resetCamera(); resetCamera();
var fromDeathState = isPlayerDying;
persistentUpdate = true; persistentUpdate = true;
persistentDraw = true; persistentDraw = true;
@ -863,8 +865,11 @@ class PlayState extends MusicBeatSubState
if (currentStage != null) currentStage.resetStage(); if (currentStage != null) currentStage.resetStage();
playerStrumline.vwooshNotes(); if (!fromDeathState)
opponentStrumline.vwooshNotes(); {
playerStrumline.vwooshNotes();
opponentStrumline.vwooshNotes();
}
playerStrumline.clean(); playerStrumline.clean();
opponentStrumline.clean(); opponentStrumline.clean();
@ -1075,6 +1080,22 @@ class PlayState extends MusicBeatSubState
function moveToGameOver():Void function moveToGameOver():Void
{ {
// Reset and update a bunch of values in advance for the transition back from the game over substate.
playerStrumline.clean();
opponentStrumline.clean();
songScore = 0;
updateScoreText();
health = Constants.HEALTH_STARTING;
healthLerp = health;
healthBar.value = healthLerp;
iconP1.updatePosition();
iconP2.updatePosition();
// Transition to the game over substate.
var gameOverSubState = new GameOverSubState( var gameOverSubState = new GameOverSubState(
{ {
isChartingMode: isChartingMode, isChartingMode: isChartingMode,

View file

@ -737,8 +737,8 @@ class FreeplayState extends MusicBeatSubState
} }
} }
lerpScore = MathUtil.coolLerp(lerpScore, intendedScore, 0.2); lerpScore = MathUtil.smoothLerp(lerpScore, intendedScore, elapsed, 0.5);
lerpCompletion = MathUtil.coolLerp(lerpCompletion, intendedCompletion, 0.9); lerpCompletion = MathUtil.smoothLerp(lerpCompletion, intendedCompletion, elapsed, 0.5);
if (Math.isNaN(lerpScore)) if (Math.isNaN(lerpScore))
{ {
@ -893,11 +893,24 @@ class FreeplayState extends MusicBeatSubState
spamTimer = 0; spamTimer = 0;
} }
#if !html5
if (FlxG.mouse.wheel != 0) if (FlxG.mouse.wheel != 0)
{ {
dj.resetAFKTimer(); dj.resetAFKTimer();
changeSelection(-Math.round(FlxG.mouse.wheel / 4)); changeSelection(-Math.round(FlxG.mouse.wheel));
} }
#else
if (FlxG.mouse.wheel < 0)
{
dj.resetAFKTimer();
changeSelection(-Math.round(FlxG.mouse.wheel / 8));
}
else if (FlxG.mouse.wheel > 0)
{
dj.resetAFKTimer();
changeSelection(-Math.round(FlxG.mouse.wheel / 8));
}
#end
if (controls.UI_LEFT_P && !FlxG.keys.pressed.CONTROL) if (controls.UI_LEFT_P && !FlxG.keys.pressed.CONTROL)
{ {
@ -914,6 +927,7 @@ class FreeplayState extends MusicBeatSubState
if (controls.BACK) if (controls.BACK)
{ {
busy = true;
FlxTween.globalManager.clear(); FlxTween.globalManager.clear();
FlxTimer.globalManager.clear(); FlxTimer.globalManager.clear();
dj.onIntroDone.removeAll(); dj.onIntroDone.removeAll();

View file

@ -162,7 +162,9 @@ class LoadingState extends MusicBeatSubState
{ {
targetShit = FlxMath.remapToRange(callbacks.numRemaining / callbacks.length, 1, 0, 0, 1); targetShit = FlxMath.remapToRange(callbacks.numRemaining / callbacks.length, 1, 0, 0, 1);
loadBar.scale.x = FlxMath.lerp(loadBar.scale.x, targetShit, 0.50); var lerpWidth:Int = Std.int(FlxMath.lerp(loadBar.width, FlxG.width * targetShit, 0.2));
loadBar.setGraphicSize(lerpWidth, loadBar.height);
loadBar.updateHitbox();
FlxG.watch.addQuick('percentage?', callbacks.numRemaining / callbacks.length); FlxG.watch.addQuick('percentage?', callbacks.numRemaining / callbacks.length);
} }

View file

@ -141,7 +141,9 @@ class CrashHandler
fullContents += '\n'; fullContents += '\n';
fullContents += 'Flixel Current State: ${Type.getClassName(Type.getClass(FlxG.state))}\n'; var currentState = FlxG.state != null ? Type.getClassName(Type.getClass(FlxG.state)) : 'No state loaded';
fullContents += 'Flixel Current State: ${currentState}\n';
fullContents += '\n'; fullContents += '\n';