-
-
Notifications
You must be signed in to change notification settings - Fork 381
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
User configs #6720
Open
Moderocky
wants to merge
97
commits into
SkriptLang:feature/script-reflection
Choose a base branch
from
Moderocky:user-configs
base: feature/script-reflection
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
User configs #6720
Moderocky
wants to merge
97
commits into
SkriptLang:feature/script-reflection
from
Moderocky:user-configs
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
APickledWalrus
requested changes
Nov 22, 2024
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.
Feel free to re-request me once conflicts are resolved/branch updated
9a8aee8
to
2f469bd
Compare
sovdeeth
requested changes
Dec 26, 2024
Moderocky
commented
Dec 27, 2024
sovdeeth
approved these changes
Dec 27, 2024
88f2061
to
1235d8d
Compare
d5d2b9c
to
4aa297f
Compare
b945e0c
to
2dd5cff
Compare
Mass-merge for script reflection pull requests.
* Registry Cleanup * registry.sk - add a few more tests
* Queueueue basics. * Add dequeueing expression. * Move closing quote. * Update src/main/java/org/skriptlang/skript/lang/util/SkriptQueue.java * Update src/main/java/ch/njol/skript/expressions/ExprQueue.java Co-authored-by: Patrick Miller <apickledwalrus@gmail.com> * Review bits. * Apply suggestions from code review Co-authored-by: Efnilite <35348263+Efnilite@users.noreply.github.com> Co-authored-by: Patrick Miller <apickledwalrus@gmail.com> * Add some bits. * Bits from review. * Fix return type. * Docs. * Do requested changes. * Fix things for walrus. * Merge dev/feature. --------- Co-authored-by: Patrick Miller <apickledwalrus@gmail.com> Co-authored-by: Efnilite <35348263+Efnilite@users.noreply.github.com>
…kriptLang#7346) * Suppress all removal warnings & remove getters. * Fix casing.
* minecraft tags part 1 * tags part 2 paper's material/entity tags, get all tags of something * forgot to remove _settag for entity tags too * all tags of type * major refactor * Add origin filtering * populate omitted namespaces * implement simplify for future use cases * all the documentation you could ever want! * gatekeep gaslight girlboss the paper tags * basic tests and fix comparisons Tests are kept deliberately small due to the volatile nature of tag contents. * custom tags! * add ways to turn tag into a string * a few more examples * requested changes * plural exprtags and parity between tag toString and toVariableString * Fix over-zealous refactor * Requested changes * Requested changes * Update src/main/java/ch/njol/util/Pair.java Co-authored-by: Efnilite <35348263+Efnilite@users.noreply.github.com> * Update src/main/java/org/skriptlang/skript/bukkit/tags/TagType.java Co-authored-by: Patrick Miller <apickledwalrus@gmail.com>
Make closeable an auto-closeable and allow try-with-resources. Deprecate unused case insensitive strings for removal.
* Mark VectorMath as internal * Replace usages
* Make Setter a Consumer. * Remove Setter from Option. * Remove setter from entry validator. * Remove setter from enum entry validator. * Remove setter from parsed entry validator. * Remove setter from parsed section validator.
Merge feature branch into master (before release).
* Create Script type. * Support script string/name conversion. * Script expression. * Add script lang entry. * Tests for script expression & names. * Support all scripts expression. * Script effects & tests. * Create dummy Script handle for disabled scripts. * Script reflection feature flag. * Restrict literal parsing to commands & parse. * Test feature flag for resolving name. * Split ExprScripts by feature to support disabled scripts. * Fix ExprName tests for new & old behaviour. * Add tests for disabled script handles. * Apply suggestions from code review Co-authored-by: Patrick Miller <apickledwalrus@gmail.com> * Improve script loading/unloading safety. * Add feature check for script hotswapping. * Use expression stream. * Conformity for file names and proper loading safety. * Document validity & add condition support. * Add script is loaded condition + tests. * Some changes from code review. * More changes. * Apply suggestions from code review Co-authored-by: Patrick Miller <apickledwalrus@gmail.com> * Clean up EffScriptFile and rename ExprScripts variations. * Finish code review changes. * Clean up script loader stuff. * Fix conflicts. * Suggested changes. * Apply suggestions from code review Co-authored-by: Patrick Miller <apickledwalrus@gmail.com> * Finished. --------- Co-authored-by: Patrick Miller <apickledwalrus@gmail.com> Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>
* Create Script type. * Support script string/name conversion. * Script expression. * Add script lang entry. * Tests for script expression & names. * Support all scripts expression. * Script effects & tests. * Create dummy Script handle for disabled scripts. * Script reflection feature flag. * Restrict literal parsing to commands & parse. * Test feature flag for resolving name. * Split ExprScripts by feature to support disabled scripts. * Fix ExprName tests for new & old behaviour. * Add tests for disabled script handles. * Apply suggestions from code review Co-authored-by: Patrick Miller <apickledwalrus@gmail.com> * Improve script loading/unloading safety. * Add feature check for script hotswapping. * Use expression stream. * Conformity for file names and proper loading safety. * Document validity & add condition support. * Add script is loaded condition + tests. * Dynamic function calling + tests. * Add language entry for types. * Single-encounter input bootstrapping. * Apply suggestions from code review Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com> * Fix inspection. * Update src/main/java/ch/njol/skript/expressions/ExprFunction.java Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com> * Update src/main/java/ch/njol/skript/expressions/ExprResult.java Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com> * Changes from review. * Fix merge problems. * Remove script command method usage. * Fix branch muck. * Fix more branch muck. * Fix up ExprName. * Add docs. * Add docs. * Add docs. * Fix bits. * Apply suggestions from code review Co-authored-by: Patrick Miller <apickledwalrus@gmail.com> * Fix some bits. * Function parsing by name. * Fix up some bits for Walrus. * Fix merge error. --------- Co-authored-by: Patrick Miller <apickledwalrus@gmail.com> Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>
* Create Script type. * Support script string/name conversion. * Script expression. * Add script lang entry. * Tests for script expression & names. * Support all scripts expression. * Script effects & tests. * Create dummy Script handle for disabled scripts. * Script reflection feature flag. * Restrict literal parsing to commands & parse. * Test feature flag for resolving name. * Split ExprScripts by feature to support disabled scripts. * Fix ExprName tests for new & old behaviour. * Add tests for disabled script handles. * Apply suggestions from code review Co-authored-by: Patrick Miller <apickledwalrus@gmail.com> * Improve script loading/unloading safety. * Add feature check for script hotswapping. * Use expression stream. * Conformity for file names and proper loading safety. * Document validity & add condition support. * Add script is loaded condition + tests. * Some changes from code review. * More changes. * Apply suggestions from code review Co-authored-by: Patrick Miller <apickledwalrus@gmail.com> * Clean up EffScriptFile and rename ExprScripts variations. * Finish code review changes. * Clean up script loader stuff. * Fix conflicts. * Suggested changes. * Apply suggestions from code review Co-authored-by: Patrick Miller <apickledwalrus@gmail.com> * Finished. --------- Co-authored-by: Patrick Miller <apickledwalrus@gmail.com> Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>
Co-authored-by: Patrick Miller <apickledwalrus@gmail.com>
Co-authored-by: Patrick Miller <apickledwalrus@gmail.com>
* Create Script type. * Support script string/name conversion. * Script expression. * Add script lang entry. * Tests for script expression & names. * Support all scripts expression. * Script effects & tests. * Create dummy Script handle for disabled scripts. * Script reflection feature flag. * Restrict literal parsing to commands & parse. * Test feature flag for resolving name. * Split ExprScripts by feature to support disabled scripts. * Fix ExprName tests for new & old behaviour. * Add tests for disabled script handles. * Apply suggestions from code review Co-authored-by: Patrick Miller <apickledwalrus@gmail.com> * Improve script loading/unloading safety. * Add feature check for script hotswapping. * Use expression stream. * Conformity for file names and proper loading safety. * Document validity & add condition support. * Add script is loaded condition + tests. * Some changes from code review. * More changes. * Apply suggestions from code review Co-authored-by: Patrick Miller <apickledwalrus@gmail.com> * Clean up EffScriptFile and rename ExprScripts variations. * Finish code review changes. * Clean up script loader stuff. * Fix conflicts. * Suggested changes. * Apply suggestions from code review Co-authored-by: Patrick Miller <apickledwalrus@gmail.com> * Finished. --------- Co-authored-by: Patrick Miller <apickledwalrus@gmail.com> Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>
4aa297f
to
c827332
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
User-provided config files.
I was inspired by a conversation with Walrus yesterday around the lack of config stuff in Skript when they're normally such a big part of setting up a server.
We talked a lot about safety (I suggested registration, he suggested storing them in a
/configs/
directory) and this was the basic layout I came up with.Additions
This adds:
- Config registration structure
- Config get expression
- Changers for nodes
- Config reloading & saving via
EffScriptFile
A script-maker can register their own config file within a script. They are then able to read (and write) this config, in order to take input from a user in a more sanitary way than in-script options.
This also means users don't have to download and learn an unsafe file addon in order to make a config file.
It's primarily aimed at people publishing their resources, but it's also potentially a better alternative to the suggestion in historic issue #2028, since it allows common values to be collated in one safe place and shared between scripts.
There is a heavy focus on resource safety.
Syntax
What does this actually do?
It allows users to register a config file used by their script.
This file is linked to the script: they are loaded, reloaded and discarded together.
A config can be registered by multiple scripts.
Config values can be edited via the node tree.
Other Notes
I considered opening this up to other
.sk
files, since it wouldn't be a huge stretch to allow users to read and write general data files in the same way.That said, I was concerned about not being able to manage the opening/closing of unknown files safely and decided that was better left to an addon or a future project.
For anybody wishing to implement that themselves, you'd just need to return a
Config
or even aNode
from some expression.This is part of a series of linked stages around config and script management.
Related Issues: requires #6718, requires #6702, requires #6719, fixes #2028