Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion flixel/FlxG.hx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class FlxG
* The HaxeFlixel version, in semantic versioning syntax. Use `Std.string()`
* on it to get a `String` formatted like this: `"HaxeFlixel MAJOR.MINOR.PATCH-COMMIT_SHA"`.
*/
public static var VERSION(default, null):FlxVersion = new FlxVersion(6, 1, 0);
public static var VERSION(default, null):FlxVersion = new FlxVersion(6, 1, 0, null, "HaxeFlixel");

/**
* Internal tracker for game object.
Expand Down
20 changes: 17 additions & 3 deletions flixel/system/FlxVersion.hx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,17 @@ class FlxVersion
public var minor(default, null):Int;
public var patch(default, null):Int;

public function new(Major:Int, Minor:Int, Patch:Int)
public var branch(default, null):String = "";
public var prefix(default, null):String = "";

public function new(Major:Int, Minor:Int, Patch:Int, ?Branch:String, ?Prefix:String)
{
major = Major;
minor = Minor;
patch = Patch;

branch = Branch;
prefix = Prefix;
}

/**
Expand All @@ -25,11 +31,19 @@ class FlxVersion
*/
public function toString():String
{
var sha = FlxVersion.sha;
if (prefix != "")
{
prefix = prefix + " ";
}
if (branch != "")
{
branch = "-" + branch;
}

if (sha != "")
{
sha = "@" + sha.substring(0, 7);
}
return 'HaxeFlixel $major.$minor.$patch$sha';
return '$prefix$major.$minor.$patch$branch$sha';
}
}
2 changes: 1 addition & 1 deletion flixel/system/macros/FlxGitSHA.hx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class FlxGitSHA
name: "sha",
doc: null,
meta: [],
access: [Access.APublic, Access.AStatic],
access: [Access.APublic],
kind: FieldType.FProp("default", "null", macro:Dynamic, macro $v{sha}),
pos: Context.currentPos()
});
Expand Down