Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
EliteMasterEric authored Jan 17, 2025
2 parents bb24821 + 3aad825 commit cb131d8
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 173 deletions.
10 changes: 5 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
This patch resolves a critical issue which could cause user's save data to become corrupted. It is recommended that users switch to this version immediately and avoid using version 0.5.2.
### Fixed
- Fixed a critical issue in which the Stage Editor theme value could not be parsed by older versions of the game, resulting in all save data being destroyed.
- Added a check that prevents save data from being loaded if it is corrupted rather than overriding it.
- `optionsChartEditor.chartEditorLiveInputStyle` in the save data converted from an Enum to a String to fix save data compatibility issues.
- Added a check which prevents save data from being loaded if it is corrupted rather than overriding it.
- `optionsStageEditor.theme` in the save data converted from an Enum to a String to fix save data compatibility issues.
- In the future, Enum values should not be used in order to prevent incompatibilities caused by introducing new types to the save data that older versions cannot parse.
- Fixed an issue where some publicly distributed release builds of the game were not updated to the latest version.

- `optionsChartEditor.theme` in the save data converted from an Enum to a String to fix save data compatibility issues.
- `optionsChartEditor.chartEditorLiveInputStyle` in the save data converted from an Enum to a String to fix save data compatibility issues.
- Fixed an issue where some publicly distributed builds of the game were debug builds instead of release builds.

## [0.5.2] - 2024-10-11
### Added
Expand Down Expand Up @@ -429,7 +429,7 @@ which would remove their rank if they had a lower one.
- Improvements to video cutscenes and dialogue, allowing them to be easily skipped or restarted.
- Updated Polymod by several major versions, allowing for fully dynamic asset replacement and support for scripted classes.
- Completely refactored almost every part of the game's code for performance, stability, and extensibility.
- This is not the Ludem Dare game held together with sticks and glue you played three years ago.
- This is not the Ludum Dare game held together with sticks and glue you played three years ago.
- Characters, stages, songs, story levels, and dialogue are now built from JSON data registries rather than being hardcoded.
- All of these also support attaching scripts for custom behavior, more documentation on this soon.
- You can forcibly reload the game's JSON data and scripts by pressing F5.
Expand Down
2 changes: 1 addition & 1 deletion art
Submodule art updated 98 files
+ Funkin.bmp
+ FunkinAlt.bmp
+0 −5 convertOGGToMP3.sh
+ discord/album-expansion1.jpg
+ discord/album-expansion2.png
+ discord/album-volume1.jpg
+ discord/album-volume1b.jpg
+ discord/album-volume2.jpg
+ discord/album-volume3.jpg
+ discord/album-volume4.jpg
+ discord/icon-bf-old.png
+ discord/icon-bf-pixel.png
+ discord/icon-bf.png
+ discord/icon-dad.png
+ discord/icon-darnell-blazin.png
+ discord/icon-darnell.png
+ discord/icon-face.png
+ discord/icon-gf.png
+ discord/icon-mom-car.png
+ discord/icon-mom.png
+ discord/icon-monster-christmas.png
+ discord/icon-monster.png
+ discord/icon-parents-christmas.png
+ discord/icon-pico.png
+ discord/icon-senpai-angry.png
+ discord/icon-senpai.png
+ discord/icon-spirit.png
+ discord/icon-spooky-dark.png
+ discord/icon-spooky.png
+ discord/icon-tankman-atlas.png
+ discord/icon-tankman.png
+ flashFiles/CLICK HERE TO PLAY asset.fla
+ flashFiles/Campaign_Menu_UI_Weekend1.fla
+ flashFiles/Can Arc NEWER.fla
+ flashFiles/Christmas Erect Background Assets V3(1).fla
+ flashFiles/Darnell Fighting Animations V2.fla
+ flashFiles/Freeplay redesign assets VER2 compact.fla
+ flashFiles/GF character select.fla
+ flashFiles/GF_character_select.fla
+ flashFiles/NOTE assets UPDATED.fla
+ flashFiles/Nene character select v2.fla
+ flashFiles/Nene christmas assets.fla
+ flashFiles/Nene_character_select_v2.fla
+ flashFiles/PICO bg ERECT.fla
+ flashFiles/Pico Can Explosion Death.fla
+ flashFiles/Pico Christmas assetss.fla
+ flashFiles/Pico Fighting Animations V3.fla
+ flashFiles/Pico Gut Punch Death Assets.fla
+ flashFiles/RESULTS BOYFRIEND EXCELLENT RANK final v2.fla
+ flashFiles/RESULTS BOYFRIEND GREAT RANK final.fla
+ flashFiles/RESULTS BOYFRIEND LOSS RANK final v2.fla
+ flashFiles/RESULTS BOYFRIEND PERFECT RANK final.fla
+ flashFiles/RESULTS_BOYFRIEND_EXCELLENT_RANK_FINAL.fla
+ flashFiles/RESULTS_BOYFRIEND_LOSS_RANK_final.fla
+ flashFiles/RESULTS_BOYFRIEND_PERFECT_RANK_semi_final.fla
+ flashFiles/Week 4 Erect.fla
+ flashFiles/Weekend1 BG no puddles.fla
+ flashFiles/Weekend1 ERECT BG.fla
+ flashFiles/bf_pico_slides_packaged_v2.fla
+ flashFiles/boyfriend character select v2.fla
+ flashFiles/boyfriend freeplay animations v5.fla
+ flashFiles/boyfriend_character_select_v2.fla
+ flashFiles/campaign_menu_UI_assets.fla
+ flashFiles/character select assets for cam.fla
+ flashFiles/character unlock backing card v2.fla
+ flashFiles/digital numbers results.fla
+ flashFiles/dipshit lights.fla
+ flashFiles/fake out death final alt.fla
+ flashFiles/freeplay album credits assets v4(1).fla
+ flashFiles/freeplay capsule text.fla
+ flashFiles/freeplay rank badges v2.fla
+ flashFiles/freeplay sparks.fla
+ flashFiles/lightning effect.fla
+ flashFiles/loadng stickers set 1.fla
+ flashFiles/lock unlocking v2.fla
+ flashFiles/locked character assets v2.fla
+ flashFiles/pico backing card v2.fla
+ flashFiles/pico burp assets.fla
+ flashFiles/pico character select v2.fla
+ flashFiles/pico confirm card.fla
+ flashFiles/pico doppleganger assets v2.fla
+ flashFiles/pico freeplay assets v7.fla
+ flashFiles/pico good rank final for now(1).fla
+ flashFiles/pico great rank final(1).fla
+ flashFiles/pico loss final.fla
+ flashFiles/pico perfect rank final v2(1).fla
+ flashFiles/pico_character_select_v2.fla
+ flashFiles/results numbers small.fla
+ flashFiles/results ranking assets v2.fla
+ flashFiles/santa speaks assets.fla
+ flashFiles/tankman beat it.fla
+ flashFiles/traffic light animation and cars.fla
+ flashFiles/week 1 erect v3.fla
+ flashFiles/weekend1_fighting_rough_assets.fla
+0 −99 funScripts/chartingSheets/sheetsToCharts.py
+9 −55 funScripts/jsfl/frames.jsfl
+0 −4 optimizePNG.sh
+0 −4 resizeHealthIcons.sh
2 changes: 1 addition & 1 deletion assets
2 changes: 2 additions & 0 deletions source/funkin/modding/PolymodHandler.hx
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ class PolymodHandler
// Parsing rules for various data formats.
parseRules: buildParseRules(),

skipDependencyErrors: true,

// Parse hxc files and register the scripted classes in them.
useScriptedClasses: true,
loadScriptsAsync: #if html5 true #else false #end,
Expand Down
32 changes: 1 addition & 31 deletions source/funkin/play/PlayState.hx
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
package funkin.play;

import flixel.addons.display.FlxPieDial;
import flixel.addons.transition.FlxTransitionableState;
import flixel.addons.transition.Transition;
import flixel.FlxCamera;
import flixel.FlxObject;
import flixel.FlxState;
import flixel.FlxSubState;
import flixel.math.FlxMath;
import flixel.math.FlxPoint;
import flixel.math.FlxRect;
import flixel.text.FlxText;
import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
import flixel.ui.FlxBar;
import flixel.util.FlxColor;
Expand All @@ -22,7 +18,6 @@ import funkin.audio.FunkinSound;
import funkin.audio.VoicesGroup;
import funkin.data.dialogue.conversation.ConversationRegistry;
import funkin.data.event.SongEventRegistry;
import funkin.data.notestyle.NoteStyleData;
import funkin.data.notestyle.NoteStyleRegistry;
import funkin.data.song.SongData.SongCharacterData;
import funkin.data.song.SongData.SongEventData;
Expand All @@ -45,7 +40,6 @@ import funkin.play.cutscene.VanillaCutscenes;
import funkin.play.cutscene.VideoCutscene;
import funkin.play.notes.NoteDirection;
import funkin.play.notes.notekind.NoteKindManager;
import funkin.play.notes.NoteSplash;
import funkin.play.notes.NoteSprite;
import funkin.play.notes.notestyle.NoteStyle;
import funkin.play.notes.Strumline;
Expand All @@ -58,15 +52,9 @@ import funkin.ui.debug.charting.ChartEditorState;
import funkin.ui.debug.stage.StageOffsetSubState;
import funkin.ui.mainmenu.MainMenuState;
import funkin.ui.MusicBeatSubState;
import funkin.ui.options.PreferencesMenu;
import funkin.ui.story.StoryMenuState;
import funkin.ui.transition.LoadingState;
import funkin.util.SerializerUtil;
import haxe.Int64;
import lime.ui.Haptic;
import openfl.display.BitmapData;
import openfl.geom.Rectangle;
import openfl.Lib;
#if FEATURE_DISCORD_RPC
import funkin.api.discord.DiscordClient;
#end
Expand Down Expand Up @@ -760,24 +748,6 @@ class PlayState extends MusicBeatSubState
refresh();
}

public override function draw():Void
{
// if (FlxG.renderBlit)
// {
// camGame.fill(BACKGROUND_COLOR);
// }
// else if (FlxG.renderTile)
// {
// FlxG.log.warn("PlayState background not displayed properly on tile renderer!");
// }
// else
// {
// FlxG.log.warn("PlayState background not displayed properly, unknown renderer!");
// }

super.draw();
}

function assertChartExists():Bool
{
// Returns null if the song failed to load or doesn't have the selected difficulty.
Expand Down Expand Up @@ -2576,7 +2546,7 @@ class PlayState extends MusicBeatSubState

Highscore.tallies.totalNotesHit++;
// Display the hit on the strums
playerStrumline.hitNote(note, !isComboBreak);
playerStrumline.hitNote(note, !event.isComboBreak);
if (event.doesNotesplash) playerStrumline.playNoteSplash(note.noteData.getDirection());
if (note.isHoldNote && note.holdNoteSprite != null) playerStrumline.playNoteHoldCover(note.holdNoteSprite);
vocals.playerVolume = 1;
Expand Down
1 change: 1 addition & 0 deletions source/funkin/ui/debug/DebugMenuSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class DebugMenuSubState extends MusicBeatSubState
#if sys
createItem("OPEN CRASH LOG FOLDER", openLogFolder);
#end
onMenuChange(items.members[0]);
FlxG.camera.focusOn(new FlxPoint(camFocusPoint.x, camFocusPoint.y + 500));
}

Expand Down
115 changes: 35 additions & 80 deletions source/funkin/ui/debug/charting/ChartEditorState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ import funkin.ui.mainmenu.MainMenuState;
import funkin.ui.transition.LoadingState;
import funkin.util.Constants;
import funkin.util.FileUtil;
import funkin.util.MathUtil;
import funkin.util.logging.CrashHandler;
import funkin.util.SortUtil;
import funkin.util.WindowUtil;
Expand Down Expand Up @@ -244,7 +245,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
/**
* Duration, in seconds, for the scroll easing animation.
*/
public static final SCROLL_EASE_DURATION:Float = 0.2;
public static final SCROLL_EASE_DURATION:Float = 0.4;

// Other

Expand Down Expand Up @@ -773,9 +774,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState

/**
* The current process that is lerping the scroll position.
* Used to cancel the previous lerp if the user scrolls again.
*/
var currentScrollEase:Null<VarTween>;
var currentScrollEase:Null<Float>;

/**
* The position where the user middle clicked to place a scroll anchor.
Expand Down Expand Up @@ -2707,6 +2707,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
playbarHeadLayout.playbarHead.width = FlxG.width;
playbarHeadLayout.playbarHead.height = 10;
playbarHeadLayout.playbarHead.styleString = 'padding-left: 0px; padding-right: 0px; border-left: 0px; border-right: 0px;';
playbarHeadLayout.playbarHead.min = 0;

playbarHeadLayout.playbarHead.onDragStart = function(_:DragEvent) {
playbarHeadDragging = true;
Expand All @@ -2723,13 +2724,12 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
}
}

playbarHeadLayout.playbarHead.onDrag = function(_:DragEvent) {
playbarHeadLayout.playbarHead.onDrag = function(d:DragEvent) {
if (playbarHeadDragging)
{
// Set the song position to where the playhead was moved to.
scrollPositionInPixels = (songLengthInPixels) * playbarHeadLayout.playbarHead.value / 100;
// Update the conductor and audio tracks to match.
moveSongToScrollPosition();
currentScrollEase = d.value;
easeSongToScrollPosition(currentScrollEase);
}
}

Expand All @@ -2740,8 +2740,9 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
if (playbarHeadDraggingWasPlaying)
{
playbarHeadDraggingWasPlaying = false;

// Disabled code to resume song playback on drag.
// startAudioPlayback();
startAudioPlayback();
}
}

Expand Down Expand Up @@ -3417,10 +3418,14 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
audioInstTrack.time = -Conductor.instance.instrumentalOffset;
}
}

if (!audioInstTrack.isPlaying && currentScrollEase != scrollPositionInPixels) easeSongToScrollPosition(currentScrollEase);
}

if (audioInstTrack != null && audioInstTrack.isPlaying)
{
currentScrollEase = scrollPositionInPixels;

if (FlxG.keys.pressed.ALT)
{
// If middle mouse panning during song playback, we move ONLY the playhead, without scrolling. Neat!
Expand Down Expand Up @@ -3869,7 +3874,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
}

// Mouse Wheel = Scroll
if (FlxG.mouse.wheel != 0 && !FlxG.keys.pressed.CONTROL)
if (FlxG.mouse.wheel != 0)
{
scrollAmount = -50 * FlxG.mouse.wheel;
shouldPause = true;
Expand Down Expand Up @@ -4057,27 +4062,13 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
shouldPause = true;
}

if (Math.abs(scrollAmount) > GRID_SIZE * 8)
{
shouldEase = true;
}
shouldEase = true;
if (shouldPause) stopAudioPlayback();

// Resync the conductor and audio tracks.
if (scrollAmount != 0 || playheadAmount != 0)
{
this.playheadPositionInPixels += playheadAmount;
if (shouldEase)
{
easeSongToScrollPosition(this.scrollPositionInPixels + scrollAmount);
}
else
{
// Apply the scroll amount.
this.scrollPositionInPixels += scrollAmount;
moveSongToScrollPosition();
}
}
if (shouldPause) stopAudioPlayback();
if (playheadAmount != 0) this.playheadPositionInPixels += playheadAmount;

if (scrollAmount != 0) currentScrollEase += scrollAmount;
}

/**
Expand Down Expand Up @@ -4333,15 +4324,13 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
{
// Scroll up.
var diff:Float = MENU_BAR_HEIGHT - FlxG.mouse.viewY;
scrollPositionInPixels -= diff * 0.5; // Too fast!
moveSongToScrollPosition();
currentScrollEase -= diff * 0.5; // Too fast!
}
else if (FlxG.mouse.viewY > (playbarHeadLayout?.y ?? 0.0))
{
// Scroll down.
var diff:Float = FlxG.mouse.viewY - (playbarHeadLayout?.y ?? 0.0);
scrollPositionInPixels += diff * 0.5; // Too fast!
moveSongToScrollPosition();
currentScrollEase += (diff * 0.5); // Too fast!
}

// Render the selection box.
Expand Down Expand Up @@ -4480,8 +4469,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
var clickedPosInPixels:Float = FlxMath.remapToRange(FlxG.mouse.viewY, (notePreview?.y ?? 0.0), (notePreview?.y ?? 0.0) + (notePreview?.height ?? 0.0),
0, songLengthInPixels);

scrollPositionInPixels = clickedPosInPixels;
moveSongToScrollPosition();
currentScrollEase = clickedPosInPixels;
easeSongToScrollPosition(currentScrollEase);
}
else if (scrollAnchorScreenPos != null)
{
Expand Down Expand Up @@ -4540,15 +4529,13 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
{
// Scroll up.
var diff:Float = MENU_BAR_HEIGHT - FlxG.mouse.viewY;
scrollPositionInPixels -= diff * 0.5; // Too fast!
moveSongToScrollPosition();
currentScrollEase -= (diff * 0.5);
}
else if (FlxG.mouse.viewY > (playbarHeadLayout?.y ?? 0.0))
{
// Scroll down.
var diff:Float = FlxG.mouse.viewY - (playbarHeadLayout?.y ?? 0.0);
scrollPositionInPixels += diff * 0.5; // Too fast!
moveSongToScrollPosition();
currentScrollEase += (diff * 0.5);
}

// Calculate distance between the position dragged to and the original position.
Expand Down Expand Up @@ -5142,18 +5129,15 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
{
if (playbarHeadLayout == null) throw "ERROR: Tried to handle playbar, but playbarHeadLayout is null!";

// Move the playhead to match the song position, if we aren't dragging it.
playbarHeadLayout.playbarHead.pos = currentScrollEase;

playbarHeadLayout.playbarHead.max = songLengthInPixels;

// Make sure the playbar is never nudged out of the correct spot.
playbarHeadLayout.x = 4;
playbarHeadLayout.y = FlxG.height - 48 - 8;

// Move the playhead to match the song position, if we aren't dragging it.
if (!playbarHeadDragging)
{
var songPosPercent = scrollPositionInPixels / (songLengthInPixels) * 100;

if (playbarHeadLayout.playbarHead.value != songPosPercent) playbarHeadLayout.playbarHead.value = songPosPercent;
}

var songPos:Float = Conductor.instance.songPosition + Conductor.instance.instrumentalOffset;
var songPosMilliseconds:String = Std.string(Math.floor(Math.abs(songPos) % 1000)).lpad('0', 2).substr(0, 2);
var songPosSeconds:String = Std.string(Math.floor((Math.abs(songPos) / 1000) % 60)).lpad('0', 2);
Expand Down Expand Up @@ -6134,43 +6118,12 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
*/
function easeSongToScrollPosition(targetScrollPosition:Float):Void
{
if (currentScrollEase != null) cancelScrollEase(currentScrollEase);

currentScrollEase = FlxTween.tween(this, {scrollPositionInPixels: targetScrollPosition}, SCROLL_EASE_DURATION,
{
ease: FlxEase.quintInOut,
onUpdate: this.onScrollEaseUpdate,
onComplete: this.cancelScrollEase,
type: ONESHOT
});
}

/**
* Callback function executed every frame that the scroll position is being eased.
* @param _
*/
function onScrollEaseUpdate(_:FlxTween):Void
{
currentScrollEase = Math.max(0, targetScrollPosition);
currentScrollEase = Math.min(currentScrollEase, songLengthInPixels);
scrollPositionInPixels = MathUtil.smoothLerp(scrollPositionInPixels, currentScrollEase, FlxG.elapsed, SCROLL_EASE_DURATION, 1 / 1000);
moveSongToScrollPosition();
}

/**
* Callback function executed when cancelling an existing scroll position ease.
* Ensures that the ease is immediately cancelled and the scroll position is set to the target value.
*/
function cancelScrollEase(_:FlxTween):Void
{
if (currentScrollEase != null)
{
@:privateAccess
var targetScrollPosition:Float = currentScrollEase._properties.scrollPositionInPixels;

currentScrollEase.cancel();
currentScrollEase = null;
this.scrollPositionInPixels = targetScrollPosition;
}
}

/**
* Fix the current scroll position after exiting the PlayState used when testing.
*/
Expand Down Expand Up @@ -6351,6 +6304,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
{
if (audioInstTrack == null) return;

currentScrollEase = this.scrollPositionInPixels;

if (audioInstTrack.isPlaying)
{
// Pause
Expand Down
Loading

0 comments on commit cb131d8

Please sign in to comment.