-
-
Notifications
You must be signed in to change notification settings - Fork 21.7k
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
[3.x] Support adding custom items to editor right-click context menus #94525
base: 3.x
Are you sure you want to change the base?
Conversation
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.
Same here
This should be implemented for 4.x first and then considered for inclusion in 3.x, we do not normally accept features for 3.x exclusively unless they are not relevant for 4.x |
Currently I only work in 3.x, I will check this weekend if porting to 4.x is easy |
It might be some difficult changes involved, but it might not be too complicated either, but this might not get approved if it's just for 3.x depending |
859a34a
to
a649608
Compare
This addresses #6128 (not sure if someone opened a new proposal). In Godot 4 there is a Create New menu in FileSystem: |
a649608
to
3cbc4c9
Compare
extends EditorContextMenuPlugin
const PLUG = preload("res://addons/context-menu-plugin/plug.svg")
func _can_handle(paths: PackedStringArray) -> bool:
return true
func _init() -> void:
add_context_menu_item(PLUG, "Svg...", _handle_create_svg, SUBMENU_SLOT_FILESYSTEM_CREATE)
func _handle_create_svg(args):
print(args)
|
3cbc4c9
to
60d8f77
Compare
Add right-click menu plugin functionality to implement this proposal
In popMenu event handling, the parameter types for 3 different areas are different.
CONTEXT_SLOT_SCENE_TREE -> Array<Node>
CONTEXT_SLOT_FILESYSTEM -> Array<String>
CONTEXT_SLOT_SCRIPT_EDITOR -> Resource<GDScript>
Finally, I will explain the motivation behind this pull request. It mainly stems from my desire to create a plugin.
The general functionality is as follows: we use GoogleDocs as a place for game configuration (collaboration among multiple remote users).
In order to use this configuration in the game, I have developed a plugin that converts GoogleDocs to CSV (I also used another plugin of mine for configuration).
Each update from GoogleDocs involves updating the entire file. When the number of configuration files and data increases, our workflow slows down.
Therefore, I wondered if it would be possible to implement the operation of updating a single configuration file in the file browser area's right-click menu.
After searching around, I came across this proposal which had the same requirement, so I decided to attempt to implement it.
This is my first time contributing a pull request to the Godot Engine source code, and I'm not particularly skilled in C++. There may be areas in the code of this pull request that are not perfect. Thank you for pointing them out. 🤚~