Export Hint for Resource #2
Replies: 1 comment
-
In the end, I've somewhat picked option 2, except rather than using metadata, I've used |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Due to its complexity, I'm making a new thread here to formulate my though process.
For exporting for resources, I want a unique feature to make it such that the dropdown lists only those in a particular category. Here are the ideas I've came up with:
1. Editing Script Editor
Maybe I can get gdscript to accept this export hint:
On the
EditorPlugin
, I canget_editor_interface().get_script_editor()
to get the script editor...but how do I catch the syntax error?EditorInterface seems to have
ScriptEditor::get_singleton()->edit(...)
, but where can Iget_singleton()
to see what it does?ScriptEditor might've been gotten from
#include "editor/plugins/script_editor_plugin.h"
ScriptEditor's
edit(...)
hasis_valid()
condition called from Ref<Script>. Maybe this is the area I need to check through?Doesn't look like
is_valid()
is bound, so I couldn't overwrite to make a syntax exception.2. Using Metadata
Alternatively, I can
get_meta("Shortcut Directory")
so that the script would know which property would use which category folder to list just the property from. However, that would require the user toset_meta(...)
on their category script first.To alleviate this, I could give categories their own child of TabContainer where user can set new properties there, including Resource types and their custom category path.
But meta data will have to be stored onto individual resources, unless I can somehow set them right into the category Script file, but how would it then be stored?
3. Drop-down Search
I could just implement the Resource export hint, but include a search function so that the drop-down menu would instantly lists the desired resource files.
I could also add a .cfg file on each category folders to reference which property lists under which categories.
In the end, I've picked option 3, though I'm reserving the search function for later in favor of making as many export types compatible as possible such as
(String, MULTILINE)
. I also have to implement each of the options button items.Beta Was this translation helpful? Give feedback.
All reactions