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

Object::emit_signal needs to check for @tool #82493

Closed
Gallilus opened this issue Sep 28, 2023 · 4 comments
Closed

Object::emit_signal needs to check for @tool #82493

Gallilus opened this issue Sep 28, 2023 · 4 comments

Comments

@Gallilus
Copy link
Contributor

Gallilus commented Sep 28, 2023

Godot version

v4.1.beta

System information

Windows 10

Issue description

here an error is generated like this example

This is solved by adding the @tool keyword is it possible to check if the Editor is running this line?

If so error text may suggest the tool keyword.

Steps to reproduce

tool
extends EditorPlugin

var dialogue_editor_window_path = "res://addons/DialogueEditor/DialogueEditorWindow.tscn"

func _enter_tree():
    InputMap.add_action("open_dialogue_editor")
    var new_input_event = InputEventKey.new()
    new_input_event.set_scancode(KEY_Q)
    InputMap.action_add_event("open_dialogue_editor", new_input_event)

func _exit_tree():
    InputMap.erase_action("open_dialogue_editor")

func _input(event):
    if event.is_action_pressed("open_dialogue_editor"):
        var dialogue_editor_window = load(dialogue_editor_window_path).instance()
        dialogue_editor_window.get_node("Button").connect("pressed",dialogue_editor_window,"_on_button_pressed")
        add_child(dialogue_editor_window)
extends Panel

func _on_button_pressed():
    queue_free()

Minimal reproduction project

not available

@dalexeev
Copy link
Member

We could make a list of classes that should be used with @tool and generate a warning if it is missing. I had this thought while working on #78178.

@KoBeWi
Copy link
Member

KoBeWi commented Nov 7, 2024

Was this resolved by #94511?

@dalexeev
Copy link
Member

dalexeev commented Nov 7, 2024

Looks like it. Then we should close this as a duplicate of #36592. I misunderstood this issue last time.

@KoBeWi
Copy link
Member

KoBeWi commented Nov 8, 2024

Closing per above comment.

@KoBeWi KoBeWi closed this as completed Nov 8, 2024
@KoBeWi KoBeWi added the archived label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants