Skip to content

Commit

Permalink
Merge branch 'note-kind-scripts' of https://github.com/lemz1/Funkin i…
Browse files Browse the repository at this point in the history
…nto note-kind-scripts
  • Loading branch information
lemz1 committed Oct 8, 2024
2 parents cf52feb + 28fcac5 commit f89e6ae
Show file tree
Hide file tree
Showing 29 changed files with 691 additions and 443 deletions.
2 changes: 1 addition & 1 deletion .github/changed-lines-count-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ medium:
min: 10
max: 99

# Add 'large' to any changes for more than 100 lines
# Add 'large' to any changes of at least 100 lines
large:
min: 100
4 changes: 2 additions & 2 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Add Documentation tag to PR's changing markdown files, or anyhting in the docs folder
# Add Documentation tag to PR's changing markdown files, or anything in the docs folder
Documentation:
- changed-files:
- any-glob-to-any-file:
- docs/*
- '**/*.md'

# Adds Haxe tag to PR's changing haxe code files
# Add Haxe tag to PR's changing haxe code files
Haxe:
- changed-files:
- any-glob-to-any-file: '**/*.hx'
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "assets"]
path = assets
url = https://github.com/FunkinCrew/Funkin-assets-secret
url = https://github.com/FunkinCrew/Funkin.assets
[submodule "art"]
path = art
url = https://github.com/FunkinCrew/Funkin-art-secret
url = https://github.com/FunkinCrew/Funkin.art
86 changes: 86 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,92 @@ All notable changes will be documented in this file.
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).

## [0.5.2] - 2024-10-??
### Fixed
- Fixed an issue where exiting the Chart Editor would sometimes crash the game.
- Fixed an issue where holding down a direction key then selecting a character would select the locked character and crash the game (community fix by ACrazyTown)
- Fixed an issue where the player and girlfriend would disappear or overlap themselves in Character Select (community fix by gamerbross)
- Fixed an issue where the game would show the wrong girlfriend in Character Select (community fix by gamerbross)
- Fixed an issue where the cursor wouldn't update properly in Character Select (community fix by gamerbross)
- Fixed an issue where the player would display double after entering character select or when spamming buttons (community fix by gamerbross)

## [0.5.1] - 2024-09-30
### Added
- Readded the Merch button to the main menu.
- Click it to check out our Makeship campaign!
- Added Discord Rich Presence support. People can now see what song you are playing from Discord!
- We'll get mod support working for this eventually.
- Added an FPS limit option to the Preferences menu.
- You can now change how high the game tries to push your frame rate, from as little as 30 to as high as 300.
- Added support for the Tracy instrumenation-based profiling tool in development environments. Enable it with the `-DFEATURE_DEBUG_TRACY` compilation flag.
- For the people who aren't nerds, this is a tool for tracking down performance issues!
- Playable Character data now defines an asset location for an Animate Atlas to display Girlfriend.
- This includes the option to display a visualizer, if configured correctly.
- Separated the Perfect and Perfect (Gold) animations in the Playable Character data.
- Base game just uses the same animation for both, but modders can split the animations up on their custom characters now.
- Added a bunch of Flash project files from the Weekend 1 and Playable Pico updates to the `Funkin.art` repository.
- Added the `flipX` and `flipY` parameters to props in the Stage data. (community feature by abnormalpoof)
### Changed
- The game's mod API version check is now more dynamic.
- The update accepts mods with API version `0.5.0` as well as `0.5.1`.
- Pico is no longer unlocked for all players automatically.
- You need to beat Weekend 1 in Story Mode in order to unlock him in Character Select.
- Removed some of the more spammy `trace()` calls to improve debugging a bit.
- Improved some of the compilation and modding documentation.
- The game now complains if you create a song variation with symbols in the name.
- Switched the force crash keybind from Ctrl-Shift-L to Ctrl-Alt-Shift-L.
- Added some additional functions to `funkin.Assets` after `openfl.utils.Assets` had to get blacklisted from scripts.
### Fixed
- Fixed an issue where DadBattle (Pico Mix) was not properly credited to `TeraVex (ft. Saruky)`.
- Fixed an issue where DadBattle (Pico Mix) was missing charts on the Normal and Easy difficulty.
- Fixed an issue where Spookeez (Pico Mix) was not properly credited to `Six Impala (ft. Saster)`.
- Fixed an issue where the "Shit!" judgement would display with anti-aliasing in Week 6.
- Fixed an issue where Pico Erect could be played with different instrumentals.
- Fixed an issue where Pico would not play his shooting animations in Stress.
- Fixed an issue where Freeplay would display no custom songs when switching characters.
- Fixed an issue where Freeplay would sometimes display the wrong text on the capsules.
- Fixed an issue where duplicate difficulties from custom variations wouldn't display properly in Freeplay.
- Fixed an issue where custom note styles would sometimes just use default values rather than using the fallback note style.
- Fixed an issue where custom note styles would randomly fail to fetch information about their fallback note style.
- Fixed an issue where the Screenshots and Chart Editor binds displayed in the controls menu on Web builds (where they are disabled).
- Fixed an issue where the Stage Editor bind displayed in the controls menu even when the feature was disabled.
- Fixed an issue where the Freeplay Character Select keybind displayed weird in the keybinds menu.
- Fixed an issue where setting the input offset or visual offset too high would cause the song to skip.
- Fixed an issue where video cutscenes would not scale their volume properly.
- Fixed an issue where Cocoa Erect (Erect difficulty) had a tap note stacked on top of a hold note,
- Fixed an issue where the game would stutter when playing on the Week 5 Remix stage.
- Fixed an issue where the save data version number wouldn't get written to save data properly.
- Fixed an issue where the example mod could not be loaded.
- Fixed an issue where a script error would display when entering Blazin'.
- Fixed an issue where pressing F5 to force reload a song would sometimes cause the game to crash.
- Fixed an issue where animations on Animate Atlas characters would throw a bunch of warnings in the console.
- Fixed an issue where characters with high offsets would shift over after the player dies or restarts.
- Fixed an issue where Pico wouldn't play out his full burp animation in South (Pico Mix).
- Fixed an issue where Results screen audio could continue into Freeplay or even gameplay.
- Fixed an issue where some audio tracks would get destroyed even if they were flagged as persistent.
- Fixed an issue where the audio track would stay muted if you missed a note just before Pico burps.
- Fixed an issue where the curtains in Week 1 would display in front of larger characters.
- Fixed an issue where Boyfriend wouldn't play his death animation properly on Week 2's Remix stage.
- Fixed an issue in Freeplay where the clear % would not display after switching characters.
- Fixed an issue in Freeplay where character remixes would display the base song's highscore.
- Fixed an issue where Pico would become locked every time the game starts, and you would have to watch the unlock animation each game boot.
- The animation should now play only once per save file.
- Fixed an issue where Spirit's trail in Week 6 would not display correctly.
- Fixed an issue where the Input Offsets menu would crash when entering it before playing a song on web builds.
- Fixed an issue where the Results screen would spam the percentage tick noise instead of playing when the value changes.
- Fixed an issue where parts of the Chart Editor could not be interacted with. (community fix by KadeDeveloper)
- Fixed an issue where classic FocusCamera song events could cause the camera to snap in place. (community fix by NebulaZorua)
- Fixed an issue where achieving the same rank on a song (but a different clear %) would override your clear %, even if it was lower. (community fix by lemz1)
- Fixed an issue where the FPS counter would display even if Debug Display was turned off. (community fix by Lethrial)
- Fixed an issue where selecting the area to the left of the Chart Editor would select some of the player's notes (community fix by NotHyper474)
- Fixed an issue where pixel icons in the Chart Editor would not display correctly. (community fix by Techniktil)
- Fixed an issue where `Stage.addCharacter` would not properly assign the `characterType`. (community fix by KadeDeveloper)
- Fixed an issue where players should interact with Character Select during the unlock sequence, causing a crash. (community fix by actualmandm)
- Fixed an issue where hold notes in Week 6 were not scaled/positioned correctly. (community fix by dombomb64)
- Fixed an issue where audio offets would not interact with the Chart Editor properly. (community fix by KadeDev)
- Fixed an issue where fetching Modules during the `onDestroy` event would fail at random. (community fix by cyn0x8)
- Fixed an issue where `onSubStateOpenEnd` and `onSubStateCloseEnd` script events would not always get called. (community fix by lemz1)

## [0.5.0] - 2024-09-12
### Added
- Added a new Character Select screen to switch between playable characters in Freeplay
Expand Down
6 changes: 3 additions & 3 deletions CODESTYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ Code style is enforced using Visual Studio Code extensions.

## .hx
Formatting is handled by the `nadako.vshaxe` extension, which includes Haxe Formatter.
Haxe Formatter automatically resolves issues such as intentation style and line breaks, and can be configured in `hxformat.json`.
Haxe Formatter automatically resolves issues such as indentation style and line breaks, and can be configured in `hxformat.json`.

Code Quality is handled by the `vshaxe.haxe-checkstyle` extension, which includes Haxe Checkstyle.

### Haxe Checkstyle Notes
* Checks can be escalated to display as different serverities in the Problems window.
* Checks can be escalated to display as different severities in the Problems window.
* Checks can be disabled by setting the severity to `IGNORE`.
* `IndentationCharacter` checks what is used to indent, `Indentation` checks how deep the intentation is.
* `IndentationCharacter` checks what is used to indent, `Indentation` checks how deep the indentation is.
* `CommentedOutCode` check is in place because old code should be retrieved via Git history.
* TODO items: Enable these one-by-one and fix them to improve the overall code quality.
- Reconfigure `MethodLength`
Expand Down
3 changes: 2 additions & 1 deletion docs/COMPILING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ There are several useful build flags you can add to a build to affect how it wor
- `-DGITHUB_BUILD` will enable in-game debug functions (such as the ability to time travel in a song by pressing `PgUp`/`PgDn`), without enabling the other stuff
- `-DFEATURE_POLYMOD_MODS` or `-DNO_FEATURE_POLYMOD_MODS` to forcibly enable or disable modding support.
- `-DREDIRECT_ASSETS_FOLDER` or `-DNO_REDIRECT_ASSETS_FOLDER` to forcibly enable or disable asset redirection.
- This feature causes the game to load exported assets from the project's assets folder rather than the exported one. Great for fast iteration, but the game
- This feature causes the game to load exported assets from the project's assets folder rather than the exported one. Great for fast iteration, but the game will break if you try to zip it up and send it to someone, so it's disabled for release builds.
- `-DFEATURE_DISCORD_RPC` or `-DNO_FEATURE_DISCORD_RPC` to forcibly enable or disable support for Discord Rich Presence.
- `-DFEATURE_VIDEO_PLAYBACK` or `-DNO_FEATURE_VIDEO_PLAYBACK` to forcibly enable or disable video cutscene support.
- `-DFEATURE_CHART_EDITOR` or `-DNO_FEATURE_CHART_EDITOR` to forcibly enable or disable the chart editor in the Debug menu.
- `-DFEATURE_SCREENSHOTS` or `-DNO_FEATURE_SCREENSHOTS` to forcibly enable or disable the screenshots feature.
- `-DFEATURE_STAGE_EDITOR` to forcibly enable the experimental stage editor.
- `-DFEATURE_GHOST_TAPPING` to forcibly enable an experimental gameplay change to the anti-mash system.

Expand Down
6 changes: 3 additions & 3 deletions docs/Funkin' Debug Hotkeys.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Most of this functionality is only available on debug builds of the game!
- `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.
- `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.

## **Freeplay State**
- `F` (Freeplay Menu) - Move to Favorites
Expand All @@ -27,5 +27,5 @@ Most of this functionality is only available on debug builds of the game!
- `Y` - WOAH

## **Main Menu**
- `~`: ***DEBUG****: Opens a menu to access the Chart Editor and other work-in-progress editors. Rebindable in the options menu.
- `~`: ***DEBUG***: Opens a menu to access the Chart Editor and other work-in-progress editors. Rebindable in the options menu.
- `CTRL-ALT-SHIFT-W`: ***ALL ACCESS***: Unlocks all songs in Freeplay. Only available on debug builds.
File renamed without changes.
6 changes: 3 additions & 3 deletions hmm.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@
"name": "haxeui-core",
"type": "git",
"dir": null,
"ref": "c9d96b168ea2a19274ad7c766ab1a34b57baa793",
"ref": "51c23588614397089a5ce182cddea729f0be6fa0",
"url": "https://github.com/haxeui/haxeui-core"
},
{
"name": "haxeui-flixel",
"type": "git",
"dir": null,
"ref": "013b9d4e56bfe9a034e028a8d685f0b274cb73c4",
"ref": "da27e833947f32ef007ed11f523aa5524f5a5d54",
"url": "https://github.com/haxeui/haxeui-flixel"
},
{
Expand Down Expand Up @@ -205,4 +205,4 @@
"url": "https://github.com/fponticelli/thx.semver"
}
]
}
}
2 changes: 1 addition & 1 deletion source/funkin/Conductor.hx
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ class Conductor
}

// Take into account instrumental and file format song offsets.
songPos += applyOffsets ? (instrumentalOffset + formatOffset + audioVisualOffset) : 0;
songPos += applyOffsets ? (combinedOffset) : 0;

var oldMeasure:Float = this.currentMeasure;
var oldBeat:Float = this.currentBeat;
Expand Down
12 changes: 12 additions & 0 deletions source/funkin/graphics/FunkinSprite.hx
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,18 @@ class FunkinSprite extends FlxSprite
return true;
}

/**
* @param id The animation ID to check.
* @return Whether the animation is dynamic (has multiple frames). `false` for static, one-frame animations.
*/
public function isAnimationDynamic(id:String):Bool
{
if (this.animation == null) return false;
var animData = this.animation.getByName(id);
if (animData == null) return false;
return animData.numFrames > 1;
}

/**
* Acts similarly to `makeGraphic`, but with improved memory usage,
* at the expense of not being able to paint onto the resulting sprite.
Expand Down
8 changes: 8 additions & 0 deletions source/funkin/modding/PolymodHandler.hx
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,14 @@ class PolymodHandler
// System.load() can load malicious DLLs
Polymod.blacklistImport('lime.system.System');

// `lime.utils.Assets`
// Literally just has a private `resolveClass` function for some reason?
Polymod.blacklistImport('lime.utils.Assets');
Polymod.blacklistImport('openfl.utils.Assets');
Polymod.blacklistImport('openfl.Lib');
Polymod.blacklistImport('openfl.system.ApplicationDomain');
Polymod.blacklistImport('funkin.util.FunkinTypeResolver');

// `openfl.desktop.NativeProcess`
// Can load native processes on the host operating system.
Polymod.blacklistImport('openfl.desktop.NativeProcess');
Expand Down
44 changes: 38 additions & 6 deletions source/funkin/play/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1457,11 +1457,34 @@ class PlayState extends MusicBeatSubState
if (FlxG.sound.music != null)
{
var correctSync:Float = Math.min(FlxG.sound.music.length, Math.max(0, Conductor.instance.songPosition - Conductor.instance.combinedOffset));
var playerVoicesError:Float = 0;
var opponentVoicesError:Float = 0;

if (!startingSong && (Math.abs(FlxG.sound.music.time - correctSync) > 5 || Math.abs(vocals.checkSyncError(correctSync)) > 5))
if (vocals != null)
{
@:privateAccess // todo: maybe make the groups public :thinking:
{
vocals.playerVoices.forEachAlive(function(voice:FunkinSound) {
var currentRawVoiceTime:Float = voice.time + vocals.playerVoicesOffset;
if (Math.abs(currentRawVoiceTime - correctSync) > Math.abs(playerVoicesError)) playerVoicesError = currentRawVoiceTime - correctSync;
});

vocals.opponentVoices.forEachAlive(function(voice:FunkinSound) {
var currentRawVoiceTime:Float = voice.time + vocals.opponentVoicesOffset;
if (Math.abs(currentRawVoiceTime - correctSync) > Math.abs(opponentVoicesError)) opponentVoicesError = currentRawVoiceTime - correctSync;
});
}
}

if (!startingSong
&& (Math.abs(FlxG.sound.music.time - correctSync) > 5 || Math.abs(playerVoicesError) > 5 || Math.abs(opponentVoicesError) > 5))
{
trace("VOCALS NEED RESYNC");
if (vocals != null) trace(vocals.checkSyncError(correctSync));
if (vocals != null)
{
trace(playerVoicesError);
trace(opponentVoicesError);
}
trace(FlxG.sound.music.time);
trace(correctSync);
resyncVocals();
Expand Down Expand Up @@ -1837,6 +1860,17 @@ class PlayState extends MusicBeatSubState
smallImageKey: discordRPCIcon
});
#end

#if FEATURE_DISCORD_RPC
// Updating Discord Rich Presence.
DiscordClient.instance.setPresence(
{
state: buildDiscordRPCState(),
details: buildDiscordRPCDetails(),
largeImageKey: discordRPCAlbum,
smallImageKey: discordRPCIcon
});
#end
}

function buildDiscordRPCDetails():String
Expand Down Expand Up @@ -2528,8 +2562,8 @@ class PlayState extends MusicBeatSubState
healthChange = Constants.HEALTH_BAD_BONUS;
isComboBreak = Constants.JUDGEMENT_BAD_COMBO_BREAK;
case 'shit':
isComboBreak = Constants.JUDGEMENT_SHIT_COMBO_BREAK;
healthChange = Constants.HEALTH_SHIT_BONUS;
isComboBreak = Constants.JUDGEMENT_SHIT_COMBO_BREAK;
}

// Send the note hit event.
Expand Down Expand Up @@ -2599,8 +2633,6 @@ class PlayState extends MusicBeatSubState
}
vocals.playerVolume = 0;

if (Highscore.tallies.combo != 0) if (Highscore.tallies.combo >= 10) comboPopUps.displayCombo(0);

applyScore(-10, 'miss', healthChange, true);

if (playSound)
Expand Down Expand Up @@ -2819,7 +2851,7 @@ class PlayState extends MusicBeatSubState
}
}
comboPopUps.displayRating(daRating);
if (combo >= 10 || combo == 0) comboPopUps.displayCombo(combo);
if (combo >= 10) comboPopUps.displayCombo(combo);

vocals.playerVolume = 1;
}
Expand Down
Loading

0 comments on commit f89e6ae

Please sign in to comment.