Skip to content

Commit 5a85b63

Browse files
committed
refactor: Refactor System imports and usage in PlayState.hx
Replaced direct references to openfl.system.System with System where possible, and adjusted import statements accordingly. Updated platformLabel usage to reference lime.system.System. This improves code clarity and ensures consistent usage of system-level functions.
1 parent 8ae494e commit 5a85b63

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

source/PlayState.hx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import Achievements;
44
import Character.Boyfriend;
55
import Conductor.Rating;
66
import DialogueBoxPsych;
7-
import Note.EventNote;
8-
import Note.PreloadedChartNote;
97
import Note;
108
import Section.SwagSection;
119
import Shaders;
@@ -16,12 +14,11 @@ import editors.ChartingState;
1614
import flixel.input.keyboard.FlxKey;
1715
import flixel.ui.FlxBar;
1816
import flixel.util.FlxSort;
19-
import lime.system.System;
2017
import objects.*;
2118
import openfl.events.KeyboardEvent;
19+
import openfl.system.System;
2220
import play.objects.*;
2321
#if SHADERS_ALLOWED
24-
import openfl.filters.BitmapFilter;
2522
import openfl.filters.ShaderFilter;
2623
import shaders.ErrorHandledShader;
2724
#end
@@ -446,7 +443,7 @@ class PlayState extends MusicBeatState
446443
inline Paths.clearStoredMemory();
447444

448445
#if sys
449-
openfl.system.System.gc();
446+
System.gc();
450447
#end
451448

452449
// for lua
@@ -2744,7 +2741,7 @@ class PlayState extends MusicBeatState
27442741

27452742
final endTime = haxe.Timer.stamp();
27462743

2747-
openfl.system.System.gc();
2744+
System.gc();
27482745

27492746
final elapsedTime = endTime - startTime;
27502747

@@ -3249,7 +3246,7 @@ class PlayState extends MusicBeatState
32493246
PlayState.SONG = Song.loadFromJson(SONG.event7Value + (CoolUtil.difficultyString() == 'NORMAL' ? '' : '-' + CoolUtil.difficulties[storyDifficulty]), SONG.event7Value);
32503247
LoadingState.loadAndSwitchState(PlayState.new);
32513248
case "Close Game":
3252-
openfl.system.System.exit(0);
3249+
System.exit(0);
32533250
case "Play Video":
32543251
updateTime = false;
32553252
FlxG.sound.music.volume = 0;
@@ -3504,7 +3501,7 @@ class PlayState extends MusicBeatState
35043501
catch (e) {}
35053502
}
35063503
}
3507-
if (ClientPrefs.renderGCRate > 0 && (frameCaptured / targetFPS) % ClientPrefs.renderGCRate == 0) openfl.system.System.gc();
3504+
if (ClientPrefs.renderGCRate > 0 && (frameCaptured / targetFPS) % ClientPrefs.renderGCRate == 0) System.gc();
35083505
frameCaptured++;
35093506
}
35103507
}
@@ -4192,7 +4189,7 @@ class PlayState extends MusicBeatState
41924189
"Windows 7" => 7,
41934190
];
41944191

4195-
var platformLabel = System.platformLabel;
4192+
var platformLabel = lime.system.System.platformLabel;
41964193
var words = platformLabel.split(" ");
41974194
var windowsIndex = words.indexOf("Windows");
41984195
var result = "";

0 commit comments

Comments
 (0)