Skip to content

Commit

Permalink
Merge branch 'develop' into custom-freeplay-capsules
Browse files Browse the repository at this point in the history
  • Loading branch information
7oltan authored Sep 27, 2024
2 parents 56a6500 + ec749c7 commit 11211a5
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 41 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Please check out our [Contributor's guide](./CONTRIBUTORS.md) on how you can act

# Credits and Special Thanks

Full credits can be found in-game, or wherever the credits.json file is.
Full credits can be found in-game, or in the `credits.json` file which is located [here](https://github.com/FunkinCrew/funkin.assets/blob/main/exclude/data/credits.json).

## Programming
- [ninjamuffin99](https://twitter.com/ninja_muffin99) - Lead Programmer
Expand Down
7 changes: 2 additions & 5 deletions docs/COMPILING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ There are several useful build flags you can add to a build to affect how it wor
- `-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.

# Troubleshooting - GO THROUGH THESE STEPS BEFORE OPENING ISSUES ON GITHUB!
# Troubleshooting

- During the cloning process, you may experience an error along the lines of `error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)` due to poor connectivity. A common fix is to run ` git config --global http.postBuffer 4096M`.
- Make sure your game directory has an `assets` folder! If it's missing, copy the path to your `funkin` folder and run `cd the\path\you\copied`. Then follow the guide starting from **Step 4**.
- Check that your `assets` folder is not empty! If it is, go back to **Step 4** and follow the guide from there.
- The compilation process often fails due to having the wrong versions of the required libraries. Many errors can be resolved by deleting the `.haxelib` folder and following the guide starting from **Step 5**.
If you experience any issues during the compilation process, DO NOT open an issue on GitHub. Instead, check the [Troubleshooting Guide](TROUBLESHOOTING.md) for steps on how to resolve common problems.
10 changes: 9 additions & 1 deletion docs/troubleshooting.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Troubleshooting Common Issues
# Troubleshooting Common Compilation Issues

- Weird macro error with a very tall call stack: Restart Visual Studio Code
- NOTE: This is caused by Polymod somewhere, and seems to only occur when there is another compile error somewhere in the program. There is a bounty up for it.
Expand All @@ -13,3 +13,11 @@

- `LINK : fatal error LNK1201: error writing to program database ''; check for insufficient disk space, invalid path, or insufficient privilege`
- This error occurs if the PDB file located in your `export` folder is in use or exceeds 4 GB. Try deleting the `export` folder and building again from scratch.

- `error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)`
- This error can happen during cloning as a result of poor network connectivity. A common fix is to run ` git config --global http.postBuffer 4096M` in your terminal.

- Repository is missing an `assets` folder, or `assets` folder is empty.
- You did not clone the repository correctly! Copy the path to your `funkin` folder and run `cd the\path\you\copied`. Then follow the compilation guide starting from **Step 4**.

- Other compilation issues may be caused by installing bad library versions. Try deleting the `.haxelib` folder and following the guide starting from **Step 5**.
2 changes: 1 addition & 1 deletion example_mods/introMod/_polymod_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"name": "EliteMasterEric"
}
],
"api_version": "0.1.0",
"api_version": "0.5.0",
"mod_version": "1.0.0",
"license": "Apache-2.0"
}
2 changes: 1 addition & 1 deletion example_mods/testing123/_polymod_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"name": "EliteMasterEric"
}
],
"api_version": "0.1.0",
"api_version": "0.5.0",
"mod_version": "1.0.0",
"license": "Apache-2.0"
}
7 changes: 0 additions & 7 deletions hmm.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@
"ref": "951a0103a17bfa55eed86703ce50b4fb0d7590bc",
"url": "https://github.com/FunkinCrew/flixel-text-input"
},
{
"name": "flixel-ui",
"type": "git",
"dir": null,
"ref": "27f1ba626f80a6282fa8a187115e79a4a2133dc2",
"url": "https://github.com/HaxeFlixel/flixel-ui"
},
{
"name": "flxanimate",
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion source/funkin/audio/FunkinSound.hx
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ class FunkinSound extends FlxSound implements ICloneable<FunkinSound>
*/
public static function playOnce(key:String, volume:Float = 1.0, ?onComplete:Void->Void, ?onLoad:Void->Void):Null<FunkinSound>
{
var result = FunkinSound.load(key, volume, false, true, true, onComplete, onLoad);
var result:Null<FunkinSound> = FunkinSound.load(key, volume, false, true, true, onComplete, onLoad);
return result;
}

Expand Down
4 changes: 2 additions & 2 deletions source/funkin/modding/base/ScriptedFunkinSprite.hx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package funkin.modding.base;

/**
* A script that can be tied to an FlxSprite.
* Create a scripted class that extends FlxSprite to use this.
* A script that can be tied to a FunkinSprite.
* Create a scripted class that extends FunkinSprite to use this.
*/
@:hscriptClass
class ScriptedFunkinSprite extends funkin.graphics.FunkinSprite implements HScriptedClass {}
2 changes: 1 addition & 1 deletion source/funkin/modding/events/ScriptEvent.hx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class NoteScriptEvent extends ScriptEvent
public var comboCount(default, null):Int;

/**
* Whether to play the record scratch sound (if this eventn type is `NOTE_MISS`).
* Whether to play the record scratch sound (if this event type is `NOTE_MISS`).
*/
public var playSound(default, default):Bool;

Expand Down
1 change: 1 addition & 0 deletions source/funkin/play/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1993,6 +1993,7 @@ class PlayState extends MusicBeatSubState

// Skip this if the music is paused (GameOver, Pause menu, start-of-song offset, etc.)
if (!(FlxG.sound.music?.playing ?? false)) return;

var timeToPlayAt:Float = Conductor.instance.songPosition - Conductor.instance.instrumentalOffset;
FlxG.sound.music.pause();
vocals.pause();
Expand Down
29 changes: 9 additions & 20 deletions source/funkin/play/components/HealthIcon.hx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class HealthIcon extends FunkinSprite
* The character this icon is representing.
* Setting this variable will automatically update the graphic.
*/
public var characterId(default, set):Null<String>;
public var characterId(default, set):String = Constants.DEFAULT_HEALTH_ICON;

/**
* Whether this health icon should automatically update its state based on the character's health.
Expand Down Expand Up @@ -116,7 +116,7 @@ class HealthIcon extends FunkinSprite
*/
static final POSITION_OFFSET:Int = 26;

public function new(char:String = 'bf', playerId:Int = 0)
public function new(char:Null<String>, playerId:Int = 0)
{
super(0, 0);
this.playerId = playerId;
Expand All @@ -131,7 +131,7 @@ class HealthIcon extends FunkinSprite
snapToTargetSize();
}

function set_characterId(value:Null<String>):Null<String>
function set_characterId(value:Null<String>):String
{
if (value == characterId) return value;

Expand Down Expand Up @@ -412,20 +412,9 @@ class HealthIcon extends FunkinSprite
}
}

function correctCharacterId(charId:Null<String>):String
function iconExists(charId:String):Bool
{
if (charId == null)
{
return Constants.DEFAULT_HEALTH_ICON;
}

if (!Assets.exists(Paths.image('icons/icon-$charId')))
{
FlxG.log.warn('No icon for character: $charId : using default placeholder face instead!');
return Constants.DEFAULT_HEALTH_ICON;
}

return charId;
return Assets.exists(Paths.image('icons/icon-$charId'));
}

function isNewSpritesheet(charId:String):Bool
Expand All @@ -435,11 +424,11 @@ class HealthIcon extends FunkinSprite

function loadCharacter(charId:Null<String>):Void
{
if (charId == null || correctCharacterId(charId) != charId)
if (charId == null || !iconExists(charId))
{
// This will recursively trigger loadCharacter to be called again.
characterId = correctCharacterId(charId);
return;
FlxG.log.warn('No icon for character: $charId : using default placeholder face instead!');
characterId = Constants.DEFAULT_HEALTH_ICON;
charId = characterId;
}

isLegacyStyle = !isNewSpritesheet(charId);
Expand Down
5 changes: 5 additions & 0 deletions source/funkin/ui/debug/anim/DebugBoundingState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@ class DebugBoundingState extends FlxState
{
movingCharacter = false;
}

if (FlxG.mouse.justReleased)
{
movingCharacter = false;
}
}
}

Expand Down
1 change: 0 additions & 1 deletion source/funkin/ui/transition/LoadingState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ class LoadingState extends MusicBeatSubState
FunkinSprite.cacheTexture(Paths.image('ui/popup/pixel/num7'));
FunkinSprite.cacheTexture(Paths.image('ui/popup/pixel/num8'));
FunkinSprite.cacheTexture(Paths.image('ui/popup/pixel/num9'));

FunkinSprite.cacheTexture(Paths.image('notes', 'shared'));
FunkinSprite.cacheTexture(Paths.image('noteSplashes', 'shared'));
FunkinSprite.cacheTexture(Paths.image('noteStrumline', 'shared'));
Expand Down

0 comments on commit 11211a5

Please sign in to comment.