Skip to content

doc: Use Signal.emit instead of emit_signal in Object examples - #69662

Merged
akien-mga merged 1 commit into
godotengine:masterfrom
kkoang:patch-1
Apr 9, 2024
Merged

doc: Use Signal.emit instead of emit_signal in Object examples#69662
akien-mga merged 1 commit into
godotengine:masterfrom
kkoang:patch-1

Conversation

@kkoang

@kkoang kkoang commented Dec 6, 2022

Copy link
Copy Markdown
Contributor

Change the code and use the new method of godot4

URL:https://docs.godotengine.org/en/latest/classes/class_object.html

@kkoang
kkoang requested a review from a team as a code owner December 6, 2022 13:43
@Chaosus Chaosus added this to the 4.0 milestone Dec 6, 2022
@Mickeon

Mickeon commented Dec 6, 2022

Copy link
Copy Markdown
Member

This PR tries changes the function shown in the examples of Object.emit_signal() itself to use Signal.emit() which is not what is being described. Last time I took a look at this description, I thought that this entire set of paragraphs should be stripped away instead, and moved somewhere else, at best. The entire thing is needlessly long and verbose.

@YuriSizov

Copy link
Copy Markdown
Contributor

This PR tries changes the function shown in the examples of Object.emit_signal() itself to use Signal.emit() which is not what is being described.

Well, we're using Signal's API for connecting and disconnecting, for example. So I think this change is valid.

this entire set of paragraphs should be stripped away instead, and moved somewhere else, at best. The entire thing is needlessly long and verbose.

You are probably right there.

@YuriSizov YuriSizov modified the milestones: 4.0, 4.1 Feb 10, 2023
@YuriSizov YuriSizov modified the milestones: 4.1, 4.2 Jun 14, 2023
@YuriSizov YuriSizov modified the milestones: 4.2, 4.3 Nov 13, 2023

@mhilbrunner mhilbrunner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this change is good by itself, regardless of possible further improvements of the whole section. Moving away from strings in favor of signal names wherever we can in examples is good, IMO.

Unfortunately, this needs a rebase.

@akien-mga akien-mga changed the title Update Object.xml doc: Use Signal.emit instead of emit_signal in Object examples Apr 7, 2024
@akien-mga

Copy link
Copy Markdown
Member

Rebased, and gave the PR and commit a meaningful title.

Would be good that @godotengine/dotnet checks that the C# example is correct.

@paulloz

paulloz commented Apr 7, 2024

Copy link
Copy Markdown
Member

Hi. Nope, this does not work in C#. Currently, the only way to emit signals is through EmitSignal (see https://docs.godotengine.org/en/latest/tutorials/scripting/c_sharp/c_sharp_signals.html#signal-emission). There are WIPs to have access to a strongly typed API (#68233), but it is not merged at the moment.

@kkoang

kkoang commented Apr 7, 2024

Copy link
Copy Markdown
Contributor Author

@paulloz I restored the C# code to its original state. Sorry, I’m not familiar with C#.

Comment thread doc/classes/Object.xml Outdated
@akien-mga

akien-mga commented Apr 7, 2024

Copy link
Copy Markdown
Member

Looks good! Could you squash the commits? See PR workflow for instructions.

Edit: Done myself.

@kkoang

kkoang commented Apr 9, 2024

Copy link
Copy Markdown
Contributor Author

@akien-mga I am not a professional programmer. I have been reading PR workflow and learning git, and it may take a few days. If you have already helped me complete the "rebase", I am very grateful.😊

@akien-mga

Copy link
Copy Markdown
Member

Yes it's all good now :) I'll merge this soon.

@akien-mga
akien-mga merged commit 964684b into godotengine:master Apr 9, 2024
@akien-mga

Copy link
Copy Markdown
Member

Thanks! And congrats for your first merged Godot contribution 🎉

And apologies for the delay getting this reviewed.

BendyLand pushed a commit to BendyLand/voltaire that referenced this pull request Aug 2, 2026
doc: Use `Signal.emit` instead of `emit_signal` in Object examples
BendyLand pushed a commit to BendyLand/voltaire that referenced this pull request Aug 2, 2026
doc: Use `Signal.emit` instead of `emit_signal` in Object examples
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants