@@ -58,6 +58,8 @@ class Macros {
5858
5959 final macroPath = ' funkin.backend.system.macros.Macros' ;
6060 Compiler .addMetadata (' @:build( $macroPath .buildLimeAssetLibrary())' , ' lime.utils.AssetLibrary' );
61+ Compiler .addMetadata (' @:build( $macroPath .buildLimeApplication())' , ' lime.app.Application' );
62+ Compiler .addMetadata (' @:build( $macroPath .buildLimeWindow())' , ' lime.ui.Window' );
6163
6264 // Adds Compat for #if hscript blocks when you have hscript improved
6365 if (Context .defined (" hscript_improved" ) && ! Context .defined (" hscript" )) {
@@ -72,5 +74,37 @@ class Macros {
7274
7375 return fields ;
7476 }
77+
78+ public static function buildLimeApplication (): Array <Field > {
79+ final fields : Array <Field > = Context .getBuildFields (), pos : Position = Context .currentPos ();
80+ for (f in fields ) switch (f .kind ) {
81+ case FFun (func ): switch (f .name ) {
82+ case " exec" : switch (func .expr .expr ) {
83+ case EBlock (exprs ): exprs .push (macro funkin.backend.system. Main .preInit ());
84+ default :
85+ }
86+ }
87+ default :
88+ }
89+
90+ return fields ;
91+ }
92+
93+ public static function buildLimeWindow (): Array <Field > {
94+ final fields : Array <Field > = Context .getBuildFields (), pos : Position = Context .currentPos ();
95+ if (! Context .defined (" DARK_MODE_WINDOW" )) return fields ;
96+
97+ for (f in fields ) switch (f .kind ) {
98+ case FFun (func ): switch (f .name ) {
99+ case " new" : switch (func .expr .expr ) {
100+ case EBlock (exprs ): exprs .push (macro funkin.backend.utils. NativeAPI .setDarkMode (title , true ));
101+ default :
102+ }
103+ }
104+ default :
105+ }
106+
107+ return fields ;
108+ }
75109}
76110#end
0 commit comments