Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
57 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
2.6.0 (TBD) | ||
2.6.0 (March 10, 2024) | ||
------------------------------ | ||
|
||
#### New features: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package flixel.addons.ui.system.macros; | ||
|
||
#if macro | ||
import haxe.macro.Compiler; | ||
import haxe.macro.Context; | ||
import haxe.macro.Expr.Position; | ||
|
||
// private enum UserAddonDefines {} | ||
// private enum HelperAddonDefines {} | ||
|
||
/** | ||
* The purpose of these "defines" classes is mainly to properly communicate version compatibility | ||
* among flixel libs, we shouldn't be overly concerned with backwards compatibility, but we do want | ||
* to know when a change breaks compatibility between Flixel-UI and Flixel. | ||
* | ||
* @since 2.6.0 | ||
*/ | ||
@:allow(flixel.system.macros.FlxDefines) | ||
@:access(flixel.system.macros.FlxDefines) | ||
class FlxUIDefines | ||
{ | ||
/** | ||
* Called from `flixel.system.macros.FlxDefines` on versions 5.6.0 or later | ||
*/ | ||
public static function run() | ||
{ | ||
#if !display | ||
checkCompatibility(); | ||
#end | ||
} | ||
|
||
static function checkCompatibility() | ||
{ | ||
#if (flixel < version("5.3.1")) | ||
FlxDefines.abortVersion("Flixel", "5.3.1 or newer", "flixel", (macro null).pos); | ||
#end | ||
} | ||
|
||
static function isValidUserDefine(define:Any) | ||
{ | ||
return false; | ||
} | ||
|
||
static function abortVersion(dependency:String, supported:String, found:String, pos:Position) | ||
{ | ||
abort('Flixel-UI: Unsupported $dependency version! Supported versions are $supported (found ${Context.definedValue(found)}).', pos); | ||
} | ||
|
||
static function abort(message:String, pos:Position) | ||
{ | ||
Context.fatalError(message, pos); | ||
} | ||
} | ||
#end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters