From e70ff456e260fad7c13c1e45959a5981663a91ea Mon Sep 17 00:00:00 2001 From: George FunBook Date: Thu, 15 Jun 2023 15:37:33 -0500 Subject: [PATCH] add logStyle.throwError --- flixel/system/debug/log/LogStyle.hx | 6 ++++++ flixel/system/frontEnds/LogFrontEnd.hx | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/flixel/system/debug/log/LogStyle.hx b/flixel/system/debug/log/LogStyle.hx index bc64dee55f..6fa5fae864 100644 --- a/flixel/system/debug/log/LogStyle.hx +++ b/flixel/system/debug/log/LogStyle.hx @@ -40,6 +40,12 @@ class LogStyle */ public var callbackFunction:()->Void; + /** + * Whether an error is thrown when this LogStyle is used + * @since 5.4.0 + */ + public var throwError:Bool = false; + /** * Create a new LogStyle to be used in conjunction with `FlxG.log.advanced()` * diff --git a/flixel/system/frontEnds/LogFrontEnd.hx b/flixel/system/frontEnds/LogFrontEnd.hx index b106725a5e..cee0a9df18 100644 --- a/flixel/system/frontEnds/LogFrontEnd.hx +++ b/flixel/system/frontEnds/LogFrontEnd.hx @@ -95,6 +95,11 @@ class LogFrontEnd { style.callbackFunction(); } + + if (style.throwError) + { + throw style.toLogString(data); + } } #end }