Skip to content

Commit a990da0

Browse files
committed
Fix Version Being Null + Fixed Icon Transitions Offset
1 parent f048942 commit a990da0

File tree

4 files changed

+31
-6
lines changed

4 files changed

+31
-6
lines changed

project.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
title="Friday Night Funkin' - Codename Engine" main="funkin.backend.system.Main"
66
file="CodenameEngine" packageName="com.yoshman29.codenameengine"
77
package="com.yoshman29.codenameengine"
8-
version="v0.1.0-legacy" company="Yoshman29" />
8+
version="0.1.0-legacy" company="Yoshman29" />
99

1010
<!--
1111
CHANGE THE SAVE PATH & NAME FOR YOUR MOD HERE!

source/funkin/backend/system/Main.hx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,13 @@ class Main extends Sprite
3131
// good luck /gen <3 @crowplexus
3232
public static final releaseCycle:String = "Beta";
3333
// add a version number in dis shid rn
34-
public static final releaseVersion:String = lime.app.Application.current.meta.get('version');
34+
public static var releaseVersion(get, default):String = null;
35+
public static function get_releaseVersion():String {
36+
if (releaseVersion != null)
37+
return releaseVersion;
38+
39+
return lime.app.Application.current.meta.get('version');
40+
}
3541

3642
public static var instance:Main;
3743

source/funkin/game/HealthIcon.hx

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,21 @@ class HealthIcon extends FunkinSprite
221221
}
222222

223223
var animName = 'from-${node.get("from")}-to-${node.get("to")}';
224-
if (node.exists("offsetX") || node.exists("offsetY"))
225-
addOffset(animName, Std.parseFloat(node.get("offsetX")).getDefault(0), Std.parseFloat(node.get("offsetY")).getDefault(0));
224+
225+
var offsetX:Float = 0;
226+
var offsetY:Float = 0;
227+
if (node.exists("offsetX"))
228+
offsetX = Std.parseFloat(node.get("offsetX")).getDefault(0);
229+
else if (node.exists("offsetx"))
230+
offsetX = Std.parseFloat(node.get("offsetx")).getDefault(0);
231+
232+
if (node.exists("offsetY"))
233+
offsetY = Std.parseFloat(node.get("offsetY")).getDefault(0);
234+
else if (node.exists("offsety"))
235+
offsetY = Std.parseFloat(node.get("offsety")).getDefault(0);
236+
237+
addOffset(animName, offsetX, offsetY);
238+
226239
addAnim(animName, node.get("anim"), Std.parseInt(node.get("fps")).getDefault(24), false); // don't allow looping for transitions
227240
if (animateAtlas == null && animation.exists(animName))
228241
animation.getByName(animName).flipX = isPlayer != iconIsPlayer;
@@ -256,7 +269,13 @@ class HealthIcon extends FunkinSprite
256269

257270
addOffset(animName, offsetX, offsetY);
258271

259-
addAnim(animName, node.get("anim"), Std.parseInt(node.get("fps")).getDefault(24), node.get("looped").getDefault("true").toLowerCase() == "true");
272+
var looped:Bool = false;
273+
if (node.exists("looped"))
274+
looped = node.get("looped").toLowerCase() == "true";
275+
else if (node.exists("loop"))
276+
looped = node.get("loop").toLowerCase() == "true";
277+
278+
addAnim(animName, node.get("anim"), Std.parseInt(node.get("fps")).getDefault(24), looped);
260279
if (animateAtlas == null && animation.exists(animName))
261280
animation.getByName(animName).flipX = isPlayer != iconIsPlayer;
262281
case "step":

source/funkin/menus/MainMenuState.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class MainMenuState extends MusicBeatState
7676

7777
FlxG.camera.follow(camFollow, null, 0.06);
7878

79-
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');
79+
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');
8080
versionText.y -= versionText.height;
8181
versionText.scrollFactor.set();
8282
add(versionText);

0 commit comments

Comments
 (0)