11package ;
22
3- import starcore .menus .MainMenuState ;
4- import starcore .backend .util .FlixelUtil ;
5- import starcore .backend .util .LoggerUtil ;
6- import openfl .display .StageQuality ;
7- import flixel .tweens .FlxTween ;
3+ import flixel .FlxG ;
4+ import flixel .FlxState ;
85import flixel .math .FlxMath ;
9- import starcore .backend .util .CacheUtil ;
6+ import flixel .system .FlxAssets ;
7+ import flixel .tweens .FlxTween ;
8+ import lime .app .Application ;
9+ import openfl .Lib ;
10+ import openfl .display .StageQuality ;
11+ import openfl .display .StageScaleMode ;
1012import starcore .backend .data .ClientPrefs ;
13+ import starcore .backend .util .CacheUtil ;
14+ import starcore .backend .util .FlixelUtil ;
15+ import starcore .backend .util .LoggerUtil ;
1116import starcore .backend .util .PathUtil ;
12- import flixel .system .FlxAssets ;
13- import openfl .filters .ShaderFilter ;
14- import flixel .FlxG ;
15- import flixel .FlxState ;
17+ import starcore .menus .MainMenuState ;
1618#if DISCORD_ALLOWED
1719import starcore .backend .api .DiscordClient ;
1820#end
19- import lime .app .Application ;
20- import openfl .Lib ;
21- import openfl .display .StageScaleMode ;
22- #if FILTERS_ALLOWED
23- import starcore .filters .* ;
21+ #if SHADERS_ALLOWED
22+ import starcore .shaders .* ;
2423#end
2524#if web
2625import js .Browser ;
@@ -101,20 +100,20 @@ class InitState extends FlxState
101100 });
102101 #end
103102
104- // Assign the filters AFTER all assets have been loaded!
105- #if FILTERS_ALLOWED
106- CacheUtil .vcrBorderFilter = new VCRBorderFilter ();
107- CacheUtil .vcrMario85Filter = new VCRMario85Filter ();
103+ // Assign the shaders AFTER all assets have been loaded!
104+ #if SHADERS_ALLOWED
105+ CacheUtil .vcrBorderFilter = new VCRBorderShader ();
106+ CacheUtil .vcrMario85Filter = new VCRMario85Shader ();
108107 #end
109108 }
110109
111110 function addBackgroundProcesses (): Void
112111 {
113112 // Log info
114113 LoggerUtil .log (' Adding background processes' );
115- // Update the filters that need to
114+ // Update the shaders that need to
116115 // constantly be reset
117- #if FILTERS_ALLOWED
116+ #if SHADERS_ALLOWED
118117 FlxG .signals .postUpdate .add (() ->
119118 {
120119 CacheUtil .vcrMario85Filter .update (FlxG .elapsed );
@@ -140,7 +139,7 @@ class InitState extends FlxState
140139 FlxG .sound .volume = (! (Math .abs (FlxG .sound .volume ) < FlxMath .EPSILON )) ? 0.1 : 0 ;
141140 CacheUtil .isWindowFocused = true ;
142141 // Set the volume back to the last volume used
143- FlxTween .num (FlxG .sound .volume , CacheUtil .lastVolumeUsed , 0.3 , {type : FlxTweenType .ONESHOT }, (v ) ->
142+ FlxTween .num (FlxG .sound .volume , CacheUtil .lastVolumeUsed , 0.3 , {type : FlxTweenType .ONESHOT }, (v : Float ) ->
144143 {
145144 FlxG .sound .volume = v ;
146145 });
@@ -155,8 +154,8 @@ class InitState extends FlxState
155154 // Set the last volume used to the current volume
156155 CacheUtil .lastVolumeUsed = FlxG .sound .volume ;
157156 CacheUtil .isWindowFocused = false ;
158- // Tween the volume to 0.03
159- FlxTween .num (FlxG .sound .volume , (! (Math .abs (FlxG .sound .volume ) < FlxMath .EPSILON )) ? 0.05 : 0 , 0.3 , {type : FlxTweenType .ONESHOT }, (v ) ->
157+ // Tween the volume to 0.05
158+ FlxTween .num (FlxG .sound .volume , (! (Math .abs (FlxG .sound .volume ) < FlxMath .EPSILON )) ? 0.05 : 0 , 0.3 , {type : FlxTweenType .ONESHOT }, (v : Float ) ->
160159 {
161160 FlxG .sound .volume = v ;
162161 });
@@ -167,12 +166,6 @@ class InitState extends FlxState
167166 // Do shit like saving the user's data when the game closes
168167 Application .current .window .onClose .add (() ->
169168 {
170- // Despite it saying "closeGame", it's not actually closing
171- // the game since the parameter "sysShutdown" is false. What's
172- // actually happening is all of the data is still saving and other utilities
173- // (i.e. Discord RPC and logging) are still being shutdown. This is just for keeping the
174- // code D.R.Y and still doing everything that is needed when the game closes!
175- // - Kori ;3
176169 FlixelUtil .closeGame (false );
177170 });
178171 }
0 commit comments