diff --git a/source/funkin/backend/system/Flags.hx b/source/funkin/backend/system/Flags.hx index e7bdad75..dd3815e4 100644 --- a/source/funkin/backend/system/Flags.hx +++ b/source/funkin/backend/system/Flags.hx @@ -26,9 +26,9 @@ class Flags { public static var MOD_DOWNLOAD_LINK:String = ""; public static var MOD_DEPENDENCIES:Array = []; - public static var MOD_ICON64:String = ""; - public static var MOD_ICON32:String = ""; - public static var MOD_ICON16:String = ""; + @:noCompletion public static var MOD_ICON64:String = ""; + @:noCompletion public static var MOD_ICON32:String = ""; + @:noCompletion public static var MOD_ICON16:String = ""; public static var MOD_ICON:String = ""; public static var MOD_DISCORD_CLIENT_ID:String = ""; diff --git a/source/funkin/backend/utils/WindowUtils.hx b/source/funkin/backend/utils/WindowUtils.hx index 065a1573..706c36e4 100644 --- a/source/funkin/backend/utils/WindowUtils.hx +++ b/source/funkin/backend/utils/WindowUtils.hx @@ -57,6 +57,17 @@ final class WindowUtils { updateTitle(); } + /** + * Sets the window title and icon. + * @param title The title to set. + * @param image The image to set as the icon. + **/ + public static inline function setWindow(?name:String, ?image:String) + { + Lib.application.window.setIcon(lime.graphics.Image.fromBytes(Assets.getBytes(Flags.MOD_ICON != null ? Flags.MOD_ICON : image))); + title = Flags.MOD_NAME != null ? Flags.MOD_NAME : title; + } + /** * Updates the window title to have the current title and prefix/suffix. **/