better events and funkinSave categorization
This commit is contained in:
@@ -19,38 +19,38 @@ class Script extends FlxBasic implements IFlxDestroyable {
|
||||
public static function getDefaultVariables(?script:Script):Map<String, Dynamic> {
|
||||
return [
|
||||
// Haxe related stuff
|
||||
"Std" => Std,
|
||||
"Math" => Math,
|
||||
"Reflect" => Reflect,
|
||||
"StringTools" => StringTools,
|
||||
"Json" => haxe.Json,
|
||||
"Std" => Std,
|
||||
"Math" => Math,
|
||||
"Reflect" => Reflect,
|
||||
"StringTools" => StringTools,
|
||||
"Json" => haxe.Json,
|
||||
|
||||
// OpenFL & Lime related stuff
|
||||
"Assets" => openfl.utils.Assets,
|
||||
"Application" => lime.app.Application,
|
||||
"Application" => lime.app.Application,
|
||||
"Main" => funkin.backend.system.Main,
|
||||
"window" => lime.app.Application.current.window,
|
||||
|
||||
// Flixel related stuff
|
||||
"FlxG" => flixel.FlxG,
|
||||
"FlxSprite" => flixel.FlxSprite,
|
||||
"FlxBasic" => flixel.FlxBasic,
|
||||
"FlxCamera" => flixel.FlxCamera,
|
||||
"state" => flixel.FlxG.state,
|
||||
"FlxEase" => flixel.tweens.FlxEase,
|
||||
"FlxTween" => flixel.tweens.FlxTween,
|
||||
"FlxSound" => flixel.sound.FlxSound,
|
||||
"FlxAssets" => flixel.system.FlxAssets,
|
||||
"FlxMath" => flixel.math.FlxMath,
|
||||
"FlxGroup" => flixel.group.FlxGroup,
|
||||
"FlxTypedGroup" => flixel.group.FlxGroup.FlxTypedGroup,
|
||||
"state" => flixel.FlxG.state,
|
||||
"FlxG" => flixel.FlxG,
|
||||
"FlxSprite" => flixel.FlxSprite,
|
||||
"FlxBasic" => flixel.FlxBasic,
|
||||
"FlxCamera" => flixel.FlxCamera,
|
||||
"FlxEase" => flixel.tweens.FlxEase,
|
||||
"FlxTween" => flixel.tweens.FlxTween,
|
||||
"FlxSound" => flixel.sound.FlxSound,
|
||||
"FlxAssets" => flixel.system.FlxAssets,
|
||||
"FlxMath" => flixel.math.FlxMath,
|
||||
"FlxGroup" => flixel.group.FlxGroup,
|
||||
"FlxTypedGroup" => flixel.group.FlxGroup.FlxTypedGroup,
|
||||
"FlxSpriteGroup" => flixel.group.FlxSpriteGroup,
|
||||
"FlxTypeText" => flixel.addons.text.FlxTypeText,
|
||||
"FlxText" => flixel.text.FlxText,
|
||||
"FlxTimer" => flixel.util.FlxTimer,
|
||||
"FlxPoint" => CoolUtil.getMacroAbstractClass("flixel.math.FlxPoint"),
|
||||
"FlxAxes" => CoolUtil.getMacroAbstractClass("flixel.util.FlxAxes"),
|
||||
"FlxColor" => CoolUtil.getMacroAbstractClass("flixel.util.FlxColor"),
|
||||
"FlxTypeText" => flixel.addons.text.FlxTypeText,
|
||||
"FlxText" => flixel.text.FlxText,
|
||||
"FlxTimer" => flixel.util.FlxTimer,
|
||||
"FlxPoint" => CoolUtil.getMacroAbstractClass("flixel.math.FlxPoint"),
|
||||
"FlxAxes" => CoolUtil.getMacroAbstractClass("flixel.util.FlxAxes"),
|
||||
"FlxColor" => CoolUtil.getMacroAbstractClass("flixel.util.FlxColor"),
|
||||
|
||||
// Engine related stuff
|
||||
"engine" => {
|
||||
@@ -59,38 +59,38 @@ class Script extends FlxBasic implements IFlxDestroyable {
|
||||
build: 2675, // 2675 being the last build num before it was removed
|
||||
name: "Codename Engine"
|
||||
},
|
||||
"ModState" => funkin.backend.scripting.ModState,
|
||||
"ModSubState" => funkin.backend.scripting.ModSubState,
|
||||
"PlayState" => funkin.game.PlayState,
|
||||
"GameOverSubstate" => funkin.game.GameOverSubstate,
|
||||
"ModState" => funkin.backend.scripting.ModState,
|
||||
"ModSubState" => funkin.backend.scripting.ModSubState,
|
||||
"PlayState" => funkin.game.PlayState,
|
||||
"GameOverSubstate" => funkin.game.GameOverSubstate,
|
||||
"HealthIcon" => funkin.game.HealthIcon,
|
||||
"HudCamera" => funkin.game.HudCamera,
|
||||
"Note" => funkin.game.Note,
|
||||
"Strum" => funkin.game.Strum,
|
||||
"StrumLine" => funkin.game.StrumLine,
|
||||
"Character" => funkin.game.Character,
|
||||
"Boyfriend" => funkin.game.Character, // for compatibility
|
||||
"PauseSubstate" => funkin.menus.PauseSubState,
|
||||
"FreeplayState" => funkin.menus.FreeplayState,
|
||||
"MainMenuState" => funkin.menus.MainMenuState,
|
||||
"PauseSubState" => funkin.menus.PauseSubState,
|
||||
"HudCamera" => funkin.game.HudCamera,
|
||||
"Note" => funkin.game.Note,
|
||||
"Strum" => funkin.game.Strum,
|
||||
"StrumLine" => funkin.game.StrumLine,
|
||||
"Character" => funkin.game.Character,
|
||||
"Boyfriend" => funkin.game.Character, // for compatibility
|
||||
"PauseSubstate" => funkin.menus.PauseSubState,
|
||||
"FreeplayState" => funkin.menus.FreeplayState,
|
||||
"MainMenuState" => funkin.menus.MainMenuState,
|
||||
"PauseSubState" => funkin.menus.PauseSubState,
|
||||
"StoryMenuState" => funkin.menus.StoryMenuState,
|
||||
"TitleState" => funkin.menus.TitleState,
|
||||
"Options" => funkin.options.Options,
|
||||
"Paths" => funkin.backend.assets.Paths,
|
||||
"Conductor" => funkin.backend.system.Conductor,
|
||||
"FunkinShader" => funkin.backend.shaders.FunkinShader,
|
||||
"CustomShader" => funkin.backend.shaders.CustomShader,
|
||||
"Options" => funkin.options.Options,
|
||||
"Paths" => funkin.backend.assets.Paths,
|
||||
"Conductor" => funkin.backend.system.Conductor,
|
||||
"FunkinShader" => funkin.backend.shaders.FunkinShader,
|
||||
"CustomShader" => funkin.backend.shaders.CustomShader,
|
||||
"FunkinText" => funkin.backend.FunkinText,
|
||||
"FlxAnimate" => funkin.backend.FlxAnimate,
|
||||
"FunkinSprite" => funkin.backend.FunkinSprite,
|
||||
"Alphabet" => funkin.menus.ui.Alphabet,
|
||||
"Alphabet" => funkin.menus.ui.Alphabet,
|
||||
|
||||
"CoolUtil" => funkin.backend.utils.CoolUtil,
|
||||
"IniUtil" => funkin.backend.utils.IniUtil,
|
||||
"XMLUtil" => funkin.backend.utils.XMLUtil,
|
||||
#if sys "ZipUtil" => funkin.backend.utils.ZipUtil, #end
|
||||
"MarkdownUtil" => funkin.backend.utils.MarkdownUtil,
|
||||
"CoolUtil" => funkin.backend.utils.CoolUtil,
|
||||
"IniUtil" => funkin.backend.utils.IniUtil,
|
||||
"XMLUtil" => funkin.backend.utils.XMLUtil,
|
||||
#if sys "ZipUtil" => funkin.backend.utils.ZipUtil, #end
|
||||
"MarkdownUtil" => funkin.backend.utils.MarkdownUtil,
|
||||
"EngineUtil" => funkin.backend.utils.EngineUtil,
|
||||
"MemoryUtil" => funkin.backend.utils.MemoryUtil,
|
||||
"BitmapUtil" => funkin.backend.utils.BitmapUtil,
|
||||
@@ -98,14 +98,47 @@ class Script extends FlxBasic implements IFlxDestroyable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Used internally to keep backwards compatability with old scripts.
|
||||
* Used internally to keep backwards compatibility with old scripts.
|
||||
* This gets set on `hscript.Interp.importRedirects`,
|
||||
* if you wanna modify it, please edit `hscript.Interp.importRedirects` directly.
|
||||
**/
|
||||
public static function getDefaultImportRedirects():Map<String, String> {
|
||||
return [
|
||||
"Meow" => "funkin.backend.utils.CoolUtil",
|
||||
var redirects:Map<String, String> = [
|
||||
"funkin.savedata.FunkinSave" => "funkin.backend.utils.FunkinSave"
|
||||
];
|
||||
|
||||
final events = "funkin.backend.scripting.events.";
|
||||
redirects[events + "CharacterNodeEvent"] = events + "character.CharacterNodeEvent";
|
||||
redirects[events + "CharacterXMLEvent"] = events + "character.CharacterXMLEvent";
|
||||
redirects[events + "DanceEvent"] = events + "character.DanceEvent";
|
||||
redirects[events + "DirectionAnimEvent"] = events + "character.DirectionAnimEvent";
|
||||
redirects[events + "DiscordPresenceUpdateEvent"] = events + "discord.DiscordPresenceUpdateEvent";
|
||||
redirects[events + "GameOverCreationEvent"] = events + "gameover.GameOverCreationEvent";
|
||||
redirects[events + "CamMoveEvent"] = events + "gameplay.CamMoveEvent";
|
||||
redirects[events + "CountdownEvent"] = events + "gameplay.CountdownEvent";
|
||||
redirects[events + "EventGameEvent"] = events + "gameplay.EventGameEvent";
|
||||
redirects[events + "GameOverEvent"] = events + "gameplay.GameOverEvent";
|
||||
redirects[events + "RatingUpdateEvent"] = events + "gameplay.RatingUpdateEvent";
|
||||
redirects[events + "HealthIconChangeEvent"] = events + "healthicon.HealthIconChangeEvent";
|
||||
redirects[events + "FreeplayAlphaUpdateEvent"] = events + "menu.freeplay.FreeplayAlphaUpdateEvent";
|
||||
redirects[events + "FreeplaySongSelectEvent"] = events + "menu.freeplay.FreeplaySongSelectEvent";
|
||||
redirects[events + "MenuChangeEvent"] = events + "menu.MenuChangeEvent";
|
||||
redirects[events + "PauseCreationEvent"] = events + "menu.pause.PauseCreationEvent";
|
||||
redirects[events + "WeekSelectEvent"] = events + "menu.storymenu.WeekSelectEvent";
|
||||
redirects[events + "InputSystemEvent"] = events + "note.InputSystemEvent";
|
||||
redirects[events + "NoteCreationEvent"] = events + "note.NoteCreationEvent";
|
||||
redirects[events + "NoteHitEvent"] = events + "note.NoteHitEvent";
|
||||
redirects[events + "NoteMissEvent"] = events + "note.NoteMissEvent";
|
||||
redirects[events + "NoteUpdateEvent"] = events + "note.NoteUpdateEvent";
|
||||
redirects[events + "SimpleNoteEvent"] = events + "note.SimpleNoteEvent";
|
||||
redirects[events + "StrumCreationEvent"] = events + "note.StrumCreationEvent";
|
||||
redirects[events + "SplashShowEvent"] = events + "splash.SplashShowEvent";
|
||||
redirects[events + "PlayAnimContext"] = events + "sprite.PlayAnimContext";
|
||||
redirects[events + "PlayAnimEvent"] = events + "sprite.PlayAnimEvent";
|
||||
redirects[events + "StageNodeEvent"] = events + "stage.StageNodeEvent";
|
||||
redirects[events + "StageXMLEvent"] = events + "stage.StageXMLEvent";
|
||||
|
||||
return redirects;
|
||||
}
|
||||
|
||||
public static function getDefaultPreprocessors():Map<String, Dynamic> {
|
||||
|
||||
Reference in New Issue
Block a user