@@ -8,25 +8,11 @@ import haxe.ds.StringMap;
88import tea .SScript ;
99import tea .SScript .TeaCall ;
1010
11- import funkin .visuals .cutscenes .DialogueCharacter ;
12-
13- import flixel .input .keyboard .FlxKey ;
14- import flixel .system .macros .FlxMacroUtil ;
15-
1611import core .enums .ScriptType ;
1712
18- import flixel . ui . FlxButton ;
13+ import scripting . haxe . HScriptImports ;
1914import flixel .FlxObject ;
2015
21- import ale .ui .ALEButton ;
22- import ale .ui .ALETaskBar ;
23- import ale .ui .ALEUIUtils ;
24- import ale .ui .ALEWindow ;
25-
26- import funkin .visuals .objects .VideoSprite ;
27-
28- import funkin .visuals .editors .chart .ChartNote ;
29-
3016@:access (core.backend. ScriptState )
3117@:access (core.backend. ScriptSubState )
3218class HScript extends SScript
@@ -147,8 +133,8 @@ class HScript extends SScript
147133 set (insVar , instanceVariables .get (insVar ));
148134
149135 var presetVariables : StringMap <Dynamic > = [
150- ' FlxColor' => FlxColorClass ,
151- ' FlxKey' => FlxKeyClass ,
136+ ' FlxColor' => HScriptFlxColor ,
137+ ' FlxKey' => HScriptFlxKey ,
152138 ' Json' => utils. ALEJson ,
153139 ' debugTrace' => CoolUtil .debugTrace
154140 ];
@@ -188,174 +174,4 @@ class HScript extends SScript
188174 return null ;
189175 }
190176}
191-
192- class FlxColorClass
193- {
194- public static var TRANSPARENT (default , null ): Int = FlxColor .TRANSPARENT ;
195- public static var BLACK (default , null ): Int = FlxColor .BLACK ;
196- public static var WHITE (default , null ): Int = FlxColor .WHITE ;
197- public static var GRAY (default , null ): Int = FlxColor .GRAY ;
198-
199- public static var GREEN (default , null ): Int = FlxColor .GREEN ;
200- public static var LIME (default , null ): Int = FlxColor .LIME ;
201- public static var YELLOW (default , null ): Int = FlxColor .YELLOW ;
202- public static var ORANGE (default , null ): Int = FlxColor .ORANGE ;
203- public static var RED (default , null ): Int = FlxColor .RED ;
204- public static var PURPLE (default , null ): Int = FlxColor .PURPLE ;
205- public static var BLUE (default , null ): Int = FlxColor .BLUE ;
206- public static var BROWN (default , null ): Int = FlxColor .BROWN ;
207- public static var PINK (default , null ): Int = FlxColor .PINK ;
208- public static var MAGENTA (default , null ): Int = FlxColor .MAGENTA ;
209- public static var CYAN (default , null ): Int = FlxColor .CYAN ;
210-
211- public static function fromInt (Value : Int ): Int
212- {
213- return cast FlxColor .fromInt (Value );
214- }
215-
216- public static function fromRGB (Red : Int , Green : Int , Blue : Int , Alpha : Int = 255 ): Int
217- {
218- return cast FlxColor .fromRGB (Red , Green , Blue , Alpha );
219- }
220- public static function fromRGBFloat (Red : Float , Green : Float , Blue : Float , Alpha : Float = 1 ): Int
221- {
222- return cast FlxColor .fromRGBFloat (Red , Green , Blue , Alpha );
223- }
224-
225- public static inline function fromCMYK (Cyan : Float , Magenta : Float , Yellow : Float , Black : Float , Alpha : Float = 1 ): Int
226- {
227- return cast FlxColor .fromCMYK (Cyan , Magenta , Yellow , Black , Alpha );
228- }
229-
230- public static function fromHSB (Hue : Float , Sat : Float , Brt : Float , Alpha : Float = 1 ): Int
231- {
232- return cast FlxColor .fromHSB (Hue , Sat , Brt , Alpha );
233- }
234- public static function fromHSL (Hue : Float , Sat : Float , Light : Float , Alpha : Float = 1 ): Int
235- {
236- return cast FlxColor .fromHSL (Hue , Sat , Light , Alpha );
237- }
238- public static function fromString (str : String ): Int
239- {
240- return cast FlxColor .fromString (str );
241- }
242- }
243-
244- class FlxKeyClass
245- {
246- public static var fromStringMap (default , null ): Map <String , FlxKey > = FlxMacroUtil .buildMap (" flixel.input.keyboard.FlxKey" , false , []);
247- public static var toStringMap (default , null ): Map <FlxKey , String > = FlxMacroUtil .buildMap (" flixel.input.keyboard.FlxKey" , true , []);
248-
249- public static var ANY = - 2 ;
250- public static var NONE = - 1 ;
251- public static var A = 65 ;
252- public static var B = 66 ;
253- public static var C = 67 ;
254- public static var D = 68 ;
255- public static var E = 69 ;
256- public static var F = 70 ;
257- public static var G = 71 ;
258- public static var H = 72 ;
259- public static var I = 73 ;
260- public static var J = 74 ;
261- public static var K = 75 ;
262- public static var L = 76 ;
263- public static var M = 77 ;
264- public static var N = 78 ;
265- public static var O = 79 ;
266- public static var P = 80 ;
267- public static var Q = 81 ;
268- public static var R = 82 ;
269- public static var S = 83 ;
270- public static var T = 84 ;
271- public static var U = 85 ;
272- public static var V = 86 ;
273- public static var W = 87 ;
274- public static var X = 88 ;
275- public static var Y = 89 ;
276- public static var Z = 90 ;
277- public static var ZERO = 48 ;
278- public static var ONE = 49 ;
279- public static var TWO = 50 ;
280- public static var THREE = 51 ;
281- public static var FOUR = 52 ;
282- public static var FIVE = 53 ;
283- public static var SIX = 54 ;
284- public static var SEVEN = 55 ;
285- public static var EIGHT = 56 ;
286- public static var NINE = 57 ;
287- public static var PAGEUP = 33 ;
288- public static var PAGEDOWN = 34 ;
289- public static var HOME = 36 ;
290- public static var END = 35 ;
291- public static var INSERT = 45 ;
292- public static var ESCAPE = 27 ;
293- public static var MINUS = 189 ;
294- public static var PLUS = 187 ;
295- public static var DELETE = 46 ;
296- public static var BACKSPACE = 8 ;
297- public static var LBRACKET = 219 ;
298- public static var RBRACKET = 221 ;
299- public static var BACKSLASH = 220 ;
300- public static var CAPSLOCK = 20 ;
301- public static var SCROLL_LOCK = 145 ;
302- public static var NUMLOCK = 144 ;
303- public static var SEMICOLON = 186 ;
304- public static var QUOTE = 222 ;
305- public static var ENTER = 13 ;
306- public static var SHIFT = 16 ;
307- public static var COMMA = 188 ;
308- public static var PERIOD = 190 ;
309- public static var SLASH = 191 ;
310- public static var GRAVEACCENT = 192 ;
311- public static var CONTROL = 17 ;
312- public static var ALT = 18 ;
313- public static var SPACE = 32 ;
314- public static var UP = 38 ;
315- public static var DOWN = 40 ;
316- public static var LEFT = 37 ;
317- public static var RIGHT = 39 ;
318- public static var TAB = 9 ;
319- public static var WINDOWS = 15 ;
320- public static var MENU = 302 ;
321- public static var PRINTSCREEN = 301 ;
322- public static var BREAK = 19 ;
323- public static var F1 = 112 ;
324- public static var F2 = 113 ;
325- public static var F3 = 114 ;
326- public static var F4 = 115 ;
327- public static var F5 = 116 ;
328- public static var F6 = 117 ;
329- public static var F7 = 118 ;
330- public static var F8 = 119 ;
331- public static var F9 = 120 ;
332- public static var F10 = 121 ;
333- public static var F11 = 122 ;
334- public static var F12 = 123 ;
335- public static var NUMPADZERO = 96 ;
336- public static var NUMPADONE = 97 ;
337- public static var NUMPADTWO = 98 ;
338- public static var NUMPADTHREE = 99 ;
339- public static var NUMPADFOUR = 100 ;
340- public static var NUMPADFIVE = 101 ;
341- public static var NUMPADSIX = 102 ;
342- public static var NUMPADSEVEN = 103 ;
343- public static var NUMPADEIGHT = 104 ;
344- public static var NUMPADNINE = 105 ;
345- public static var NUMPADMINUS = 109 ;
346- public static var NUMPADPLUS = 107 ;
347- public static var NUMPADPERIOD = 110 ;
348- public static var NUMPADMULTIPLY = 106 ;
349- public static var NUMPADSLASH = 111 ;
350-
351- public static inline function fromString (s : String )
352- {
353- s = s .toUpperCase ();
354-
355- return fromStringMap .exists (s ) ? fromStringMap .get (s ) : NONE ;
356- }
357-
358- public inline function toString (value : FlxKey ): String
359- return toStringMap .get (value );
360- }
361177#end
0 commit comments