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

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

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

kkoang
Copy link
Contributor

@kkoang kkoang commented Dec 6, 2022

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
Copy link
Contributor

Mickeon commented Dec 6, 2022

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
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
Copy link
Member

@mhilbrunner mhilbrunner left a comment

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
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
Copy link
Member

paulloz commented Apr 7, 2024

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
Copy link
Contributor Author

kkoang commented Apr 7, 2024

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

doc/classes/Object.xml Outdated Show resolved Hide resolved
@akien-mga
Copy link
Member

akien-mga commented Apr 7, 2024

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

Edit: Done myself.

@kkoang
Copy link
Contributor Author

kkoang commented Apr 9, 2024

@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
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
15 checks passed
@akien-mga
Copy link
Member

Thanks! And congrats for your first merged Godot contribution 🎉

And apologies for the delay getting this reviewed.

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