-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Translate GDScript Code Examples to C# (Classes beginning with C) #42016
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.
I hope the ongoing effort pays out in less mistakes, altough I am sure how much is catched.
Regardless of how good your tool is, you absolutely do still need to check manually. There are a ton of problems.
doc/classes/Control.xml
Outdated
public override object GetDragData(Vector2 position) | ||
{ | ||
object mydata = MakeData(); | ||
SetDragPreview(MakePreview(mydata)); |
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.
This is also a problem with the GDScript code, but MakeData
and MakePreview
aren't actually defined here, they are meant as placeholders for user code. As such, this needs to be commented.
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.
Added comment
[csharp] | ||
public override void _Ready() | ||
{ | ||
Modulate = GetThemeColor("font_color", "Button"); //get the color defined for button fonts |
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.
As said above, GetThemeColor
(and get_theme_color
in GDScript) do not exist.
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.
See above
32376a4
to
c6e752f
Compare
I did a second pass and adjusted my workflow for future batches, so I find more bugs in the first place. Turns out your eyes are a totally unreliable syntax checker. |
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.
This PR is looking pretty good.
doc/classes/Control.xml
Outdated
{ | ||
public override void _Ready() | ||
{ | ||
SetDragForwarding(_TargetControl); |
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.
If this is supposed to be public, this should be targetControl
(or maybe a property TargetControl
), if this is supposed to be private, this should be _targetControl
and the GDScript code should be renamed to _target_control
. Note that neither language example actually declares this variable, it would be nice if you did this.
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.
I added it as exported property, but I am not sure about the export.
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.
You still are referencing _TargetControl
instead of TargetControl
on this line.
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.
Sorry. Fixed now and rebased
9be7689
to
8011838
Compare
Translates Code Examples in classes beginning with `C`. Includes: * Callable * CanvasItem * CharFXTransform * Color * ColorRect * ConfigFile * ConfirmationDialog * Control * Crypto
8011838
to
ae873ab
Compare
Thanks! |
Translates Code Examples in classes beginning with
C
.Includes:
Work was done while using and improving my codetranslator. I hope the ongoing effort pays out in less mistakes, altough I am not sure how much is catched.
Base PR multi-language code examples: #40613
Following: #40978