Merge branch 'develop' into chart-editor-icon-fix

This commit is contained in:
Eric 2024-09-18 05:10:30 -04:00 committed by GitHub
commit 5f563f0555
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 38 additions and 33 deletions

View file

@ -1,4 +1,4 @@
# Troubleshooting Common Issues # Troubleshooting Common Compilation Issues
- Weird macro error with a very tall call stack: Restart Visual Studio Code - 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. - 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.
@ -13,3 +13,11 @@
- `LINK : fatal error LNK1201: error writing to program database ''; check for insufficient disk space, invalid path, or insufficient privilege` - `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. - 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**.

View file

@ -35,13 +35,6 @@
"ref": "951a0103a17bfa55eed86703ce50b4fb0d7590bc", "ref": "951a0103a17bfa55eed86703ce50b4fb0d7590bc",
"url": "https://github.com/FunkinCrew/flixel-text-input" "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", "name": "flxanimate",
"type": "git", "type": "git",

View file

@ -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> 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; return result;
} }

View file

@ -1,8 +1,8 @@
package funkin.modding.base; package funkin.modding.base;
/** /**
* A script that can be tied to an FlxSprite. * A script that can be tied to a FunkinSprite.
* Create a scripted class that extends FlxSprite to use this. * Create a scripted class that extends FunkinSprite to use this.
*/ */
@:hscriptClass @:hscriptClass
class ScriptedFunkinSprite extends funkin.graphics.FunkinSprite implements HScriptedClass {} class ScriptedFunkinSprite extends funkin.graphics.FunkinSprite implements HScriptedClass {}

View file

@ -1993,6 +1993,7 @@ class PlayState extends MusicBeatSubState
// Skip this if the music is paused (GameOver, Pause menu, start-of-song offset, etc.) // Skip this if the music is paused (GameOver, Pause menu, start-of-song offset, etc.)
if (!(FlxG.sound.music?.playing ?? false)) return; if (!(FlxG.sound.music?.playing ?? false)) return;
var timeToPlayAt:Float = Conductor.instance.songPosition - Conductor.instance.instrumentalOffset; var timeToPlayAt:Float = Conductor.instance.songPosition - Conductor.instance.instrumentalOffset;
FlxG.sound.music.pause(); FlxG.sound.music.pause();
vocals.pause(); vocals.pause();
@ -3045,6 +3046,7 @@ class PlayState extends MusicBeatSubState
GameOverSubState.reset(); GameOverSubState.reset();
PauseSubState.reset(); PauseSubState.reset();
Countdown.reset(); Countdown.reset();
PopUpStuff.reset();
// Clear the static reference to this state. // Clear the static reference to this state.
instance = null; instance = null;

View file

@ -33,7 +33,7 @@ class HealthIcon extends FunkinSprite
* The character this icon is representing. * The character this icon is representing.
* Setting this variable will automatically update the graphic. * 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. * Whether this health icon should automatically update its state based on the character's health.
@ -116,7 +116,7 @@ class HealthIcon extends FunkinSprite
*/ */
static final POSITION_OFFSET:Int = 26; 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); super(0, 0);
this.playerId = playerId; this.playerId = playerId;
@ -131,7 +131,7 @@ class HealthIcon extends FunkinSprite
snapToTargetSize(); snapToTargetSize();
} }
function set_characterId(value:Null<String>):Null<String> function set_characterId(value:Null<String>):String
{ {
if (value == characterId) return value; if (value == characterId) return value;
@ -412,20 +412,9 @@ class HealthIcon extends FunkinSprite
} }
} }
function correctCharacterId(charId:Null<String>):String function iconExists(charId:String):Bool
{ {
if (charId == null) return Assets.exists(Paths.image('icons/icon-$charId'));
{
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;
} }
function isNewSpritesheet(charId:String):Bool function isNewSpritesheet(charId:String):Bool
@ -435,11 +424,11 @@ class HealthIcon extends FunkinSprite
function loadCharacter(charId:Null<String>):Void 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. FlxG.log.warn('No icon for character: $charId : using default placeholder face instead!');
characterId = correctCharacterId(charId); characterId = Constants.DEFAULT_HEALTH_ICON;
return; charId = characterId;
} }
isLegacyStyle = !isNewSpritesheet(charId); isLegacyStyle = !isNewSpritesheet(charId);

View file

@ -125,4 +125,13 @@ class PopUpStuff extends FlxTypedGroup<FunkinSprite>
daLoop++; daLoop++;
} }
} }
/**
* Reset the popup configuration to the default.
*/
public static function reset()
{
noteStyle = NoteStyleRegistry.instance.fetchDefault();
isPixel = false;
}
} }

View file

@ -77,7 +77,7 @@ class DebugBoundingState extends FlxState
{ {
// get the screen position, according to the HUD camera, temp default to FlxG.camera juuust in case? // get the screen position, according to the HUD camera, temp default to FlxG.camera juuust in case?
var hudMousePos:FlxPoint = FlxG.mouse.getScreenPosition(hudCam ?? FlxG.camera); var hudMousePos:FlxPoint = FlxG.mouse.getScreenPosition(hudCam ?? FlxG.camera);
return Screen.instance.hasSolidComponentUnderPoint(hudMousePos.x, hudMousePos.y); return Screen.instance.hasSolidComponentUnderPoint(hudMousePos.x, hudMousePos.y) || FlxG.mouse.overlaps(animDropDownMenu, hudCam);
} }
override function create() override function create()
@ -239,6 +239,11 @@ class DebugBoundingState extends FlxState
{ {
movingCharacter = false; movingCharacter = false;
} }
if (FlxG.mouse.justReleased)
{
movingCharacter = false;
}
} }
} }

View file

@ -314,7 +314,6 @@ class LoadingState extends MusicBeatSubState
FunkinSprite.cacheTexture(Paths.image('ui/popup/pixel/num7')); FunkinSprite.cacheTexture(Paths.image('ui/popup/pixel/num7'));
FunkinSprite.cacheTexture(Paths.image('ui/popup/pixel/num8')); FunkinSprite.cacheTexture(Paths.image('ui/popup/pixel/num8'));
FunkinSprite.cacheTexture(Paths.image('ui/popup/pixel/num9')); FunkinSprite.cacheTexture(Paths.image('ui/popup/pixel/num9'));
FunkinSprite.cacheTexture(Paths.image('notes', 'shared')); FunkinSprite.cacheTexture(Paths.image('notes', 'shared'));
FunkinSprite.cacheTexture(Paths.image('noteSplashes', 'shared')); FunkinSprite.cacheTexture(Paths.image('noteSplashes', 'shared'));
FunkinSprite.cacheTexture(Paths.image('noteStrumline', 'shared')); FunkinSprite.cacheTexture(Paths.image('noteStrumline', 'shared'));