Skip to content

[3.x] Add C# code examples (salvage of VinnNo's PRs) #5250

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

Merged
merged 1 commit into from
Sep 16, 2021

Conversation

aaronfranke
Copy link
Member

@aaronfranke aaronfranke commented Sep 13, 2021

This PR is mostly salvages of @VinnNo's PRs that add C# code examples, with lots of changes. It also updates the GDScript docs in a few places, targeting Godot 3.x.

master version: #5249

@mhilbrunner
Copy link
Member

mhilbrunner commented Sep 15, 2021

Thanks so much for working on salvaging these, it'd be a shame for them to be left unused :)
I'd be grateful if @paulloz can review this

For reference to those PRs: https://github.com/godotengine/godot-docs/pulls?q=is%3Apr+is%3Aclosed+author%3AVinnNo+label%3Asalvageable


public string GetFruit()
{
var randomFruit = _fruits[GD.Randi() % _fruits.Length];
Copy link
Member

Choose a reason for hiding this comment

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

I'm probably alone on my hill but I'd use a do { ... } while (...); to avoid duplicating this line.

Copy link
Member Author

Choose a reason for hiding this comment

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

Consistency with GDScript is more important here.

Copy link
Contributor

@hpnrep6 hpnrep6 left a comment

Choose a reason for hiding this comment

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

Missing semicolon

@mhilbrunner mhilbrunner merged commit f703af3 into godotengine:3.4 Sep 16, 2021
@mhilbrunner
Copy link
Member

Thank you, and thanks to the reviewers! :)

@aaronfranke aaronfranke deleted the 3.x-salvage-vinnno branch September 17, 2021 02:02
@VinnNo
Copy link

VinnNo commented Sep 23, 2021

Hey! I didn't even know these were getting attention. So, I'm still VERY interested in proceeding with expanding the C# documentation, but honestly, I'm not sure how to structure these. I find that the nested code tabs conflict with the document bodies often, where variable names are mentioned (EG some_string vs SomeString) as GD and C# have two different style-guides. Also what should the approach for pages like this be? Anyway, thanks for salvaging these and improving them!

@VinnNo
Copy link

VinnNo commented Sep 23, 2021

I almost want to suggest a doc arrangement like this for the two languages, but I understand that is a big undertaking but it does read very well.

@Calinou
Copy link
Member

Calinou commented Oct 15, 2021

Cherry-picked to the 3.3 and stable branches.

I find that the nested code tabs conflict with the document bodies often, where variable names are mentioned (EG some_string vs SomeString) as GD and C# have two different style-guides. Also what should the approach for pages like this be? Anyway, thanks for salvaging these and improving them!

The best way to handle this would be #4406. However, it still needs work before it can be merged. I don't know exactly how we could make that PR production-ready, so I don't have an ETA for it.

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.

6 participants