Fix Version Being Null + Fixed Icon Transitions Offset

This commit is contained in:
Furo
2025-06-04 15:59:02 +02:00
parent f048942bcc
commit a990da0849
4 changed files with 31 additions and 6 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
title="Friday Night Funkin' - Codename Engine" main="funkin.backend.system.Main"
file="CodenameEngine" packageName="com.yoshman29.codenameengine"
package="com.yoshman29.codenameengine"
version="v0.1.0-legacy" company="Yoshman29" />
version="0.1.0-legacy" company="Yoshman29" />
<!--
CHANGE THE SAVE PATH & NAME FOR YOUR MOD HERE!
+7 -1
View File
@@ -31,7 +31,13 @@ class Main extends Sprite
// good luck /gen <3 @crowplexus
public static final releaseCycle:String = "Beta";
// add a version number in dis shid rn
public static final releaseVersion:String = lime.app.Application.current.meta.get('version');
public static var releaseVersion(get, default):String = null;
public static function get_releaseVersion():String {
if (releaseVersion != null)
return releaseVersion;
return lime.app.Application.current.meta.get('version');
}
public static var instance:Main;
+22 -3
View File
@@ -221,8 +221,21 @@ class HealthIcon extends FunkinSprite
}
var animName = 'from-${node.get("from")}-to-${node.get("to")}';
if (node.exists("offsetX") || node.exists("offsetY"))
addOffset(animName, Std.parseFloat(node.get("offsetX")).getDefault(0), Std.parseFloat(node.get("offsetY")).getDefault(0));
var offsetX:Float = 0;
var offsetY:Float = 0;
if (node.exists("offsetX"))
offsetX = Std.parseFloat(node.get("offsetX")).getDefault(0);
else if (node.exists("offsetx"))
offsetX = Std.parseFloat(node.get("offsetx")).getDefault(0);
if (node.exists("offsetY"))
offsetY = Std.parseFloat(node.get("offsetY")).getDefault(0);
else if (node.exists("offsety"))
offsetY = Std.parseFloat(node.get("offsety")).getDefault(0);
addOffset(animName, offsetX, offsetY);
addAnim(animName, node.get("anim"), Std.parseInt(node.get("fps")).getDefault(24), false); // don't allow looping for transitions
if (animateAtlas == null && animation.exists(animName))
animation.getByName(animName).flipX = isPlayer != iconIsPlayer;
@@ -256,7 +269,13 @@ class HealthIcon extends FunkinSprite
addOffset(animName, offsetX, offsetY);
addAnim(animName, node.get("anim"), Std.parseInt(node.get("fps")).getDefault(24), node.get("looped").getDefault("true").toLowerCase() == "true");
var looped:Bool = false;
if (node.exists("looped"))
looped = node.get("looped").toLowerCase() == "true";
else if (node.exists("loop"))
looped = node.get("loop").toLowerCase() == "true";
addAnim(animName, node.get("anim"), Std.parseInt(node.get("fps")).getDefault(24), looped);
if (animateAtlas == null && animation.exists(animName))
animation.getByName(animName).flipX = isPlayer != iconIsPlayer;
case "step":
+1 -1
View File
@@ -76,7 +76,7 @@ class MainMenuState extends MusicBeatState
FlxG.camera.follow(camFollow, null, 0.06);
versionText = new FunkinText(5, FlxG.height - 2, 0, 'Codename Engine ${Main.releaseVersion}\nCommit ${funkin.backend.system.macros.GitCommitMacro.commitNumber} (${funkin.backend.system.macros.GitCommitMacro.commitHash})\n[${controls.getKeyName(SWITCHMOD)}] Open Mods menu\n');
versionText = new FunkinText(5, FlxG.height - 2, 0, 'Codename Engine v${Main.releaseVersion}\nCommit ${funkin.backend.system.macros.GitCommitMacro.commitNumber} (${funkin.backend.system.macros.GitCommitMacro.commitHash})\n[${controls.getKeyName(SWITCHMOD)}] Open Mods menu\n');
versionText.y -= versionText.height;
versionText.scrollFactor.set();
add(versionText);