Skip to content
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

GD-506: Revisit the ScriptEditorContextMenuHandler added to the root node #506

Closed
MikeSchulze opened this issue Jun 17, 2024 · 0 comments · Fixed by #507
Closed

GD-506: Revisit the ScriptEditorContextMenuHandler added to the root node #506

MikeSchulze opened this issue Jun 17, 2024 · 0 comments · Fixed by #507
Assignees
Labels
refactoring Mark to refactoring a implementation UI
Milestone

Comments

@MikeSchulze
Copy link
Owner

Describe What
The ScriptEditorContextMenuHandler is added to the root node and removed at plugin exit and results into problems.
Instead, we should add it as child to the GdUnit inspector to be managed by this component instead of duing manually delete at plugin exit via dispose.

Dev hints
res://addons/gdUnit4/src/ui/ScriptEditorControls.gd

# Register the given context menu to the current script editor
# Is called when the plugin is activated
# The active script is connected to the ScriptEditorContextMenuHandler
static func register_context_menu(menu: Array[GdUnitContextMenuItem]) -> void:
	Engine.get_main_loop().root.call_deferred("add_child", ScriptEditorContextMenuHandler.new(menu))


# Unregisteres all registerend context menus and gives the ScriptEditorContextMenuHandler> free
# Is called when the plugin is deactivated
static func unregister_context_menu() -> void:
	ScriptEditorContextMenuHandler.dispose()
@MikeSchulze MikeSchulze added refactoring Mark to refactoring a implementation UI labels Jun 17, 2024
@MikeSchulze MikeSchulze added this to the v4.3.2 milestone Jun 17, 2024
@MikeSchulze MikeSchulze self-assigned this Jun 17, 2024
@MikeSchulze MikeSchulze changed the title Revisit the ScriptEditorContextMenuHandler added to the root node GD-506: Revisit the ScriptEditorContextMenuHandler added to the root node Jun 17, 2024
MikeSchulze added a commit that referenced this issue Jun 17, 2024
…node

# Why
#506

# What
- simplify adding the `ScriptEditorContextMenuHandler`
- problematic "Dispose" functionality removed, the handler is now released via the standard godot three-node free mechanism
MikeSchulze added a commit that referenced this issue Jun 17, 2024
…node (#507)

# Why
#506

# What
- simplify adding the `ScriptEditorContextMenuHandler`
- problematic "Dispose" functionality removed, the handler is now
released via the standard Godot three-node free mechanism
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Mark to refactoring a implementation UI
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant