-
-
Notifications
You must be signed in to change notification settings - Fork 414
PropertyBaseEffect #8256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev/feature
Are you sure you want to change the base?
PropertyBaseEffect #8256
Conversation
…to dev/feature
…to dev/feature
…to dev/feature
…to dev/feature
…to dev/feature
|
This will remain in draft until properties are officially fully released and ready to go. |
| "unload all worlds" | ||
| }) | ||
| @Description(""" | ||
| Load or unload a world. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mention the unload world property here since we don't have 'see also'
| "[the] [current] script [file]", | ||
| "[the] script[s] [file[s]] [named] %strings%", | ||
| "[the] skript file[s] %strings%", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
skript file is a lot more than a script
| "[the] [current] script [file]", | |
| "[the] script[s] [file[s]] [named] %strings%", | |
| "[the] skript file[s] %strings%", | |
| "[the] [current] script [file]", | |
| "[the] script[s] [file[s]] [named] %strings%", |
| public void execute(Script script, OpenCloseable closeable) { | ||
| File file = script.getConfig().getFile(); | ||
| if (file == null || !file.exists()) | ||
| return; | ||
| if (ScriptLoader.getLoadedScripts().contains(ScriptLoader.getScript(file))) | ||
| return; | ||
| if (ScriptLoader.getDisabledScriptsFilter().accept(file)) { | ||
| try { | ||
| file = FileUtils.move( | ||
| file, | ||
| new File(file.getParentFile(), file.getName().substring(ScriptLoader.DISABLED_SCRIPT_PREFIX_LENGTH)), | ||
| false | ||
| ); | ||
| } catch (IOException e) { | ||
| Skript.exception("Error while enabling script file: " + script.name()); | ||
| return; | ||
| } | ||
| } | ||
| ScriptLoader.loadScripts(file, closeable); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems like somethign that should be on Script rather than here
| public void execute(Script script, OpenCloseable closeable) { | ||
| File file = script.getConfig().getFile(); | ||
| if (file == null || !file.exists()) | ||
| return; | ||
| if (ScriptLoader.getDisabledScriptsFilter().accept(file)) | ||
| return; | ||
| unloadScripts(file); | ||
| ScriptLoader.loadScripts(file, closeable); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
likewise for rest of these
Problem
The current property system does not yet have support for common effect syntaxes and no common property handler used for effects.
Solution
Adds PropertyBaseEffect, class for using common effects with only 1 input in the syntax.
Adds EffectHandler, common handler used in PropertyBaseEffect
Adds effects and properties for: load, unload, reload, enable, and disable.
ScriptClassInfo includes all of these properties
Moves classinfo for World into it's own class, WorldClassInfo, with an unload property.
Refactors EffScriptFile to enable/load/reload a script with errors to be printed, removes some patterns that are now in ExprScript, and moved into org.
Refactors EffWorldLoad with the only unload option to be without saving
Testing Completed
quickTest
Supporting Information
N/A
Note
PR currently fails due to pattern conflicts because of property syntaxes and their original classes.
Completes: none
Related: none