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

Docs: Fix FileAccess example conflicting with global scope load #91189

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

emanvidmaker
Copy link
Contributor

In the example code the declared load() function conflicts with global scope load(). so if you copy pasted the GDScript example it in godot 4.2.2 you would get a "Too few arguments for "load()" call. Expected at least 1 but received 0." error since it doesn't override global scope load().

So i only renamed the functions into to: save_to_file() and load_from_file() for GDScript; and for C# to SaveToFile() and LoadFromFile().
to avoid overriding global scope load().

Heres what the current example code looks like in engine:

image

Here my proposal

image

In the example code the declared load() function conflicts with global scope load(). so if you copy pasted it in godot 4.2.2 you would get a "Too few arguments for "load()" call. Expected at least 1 but received 0." error since it doesn't override global scope load().
@emanvidmaker emanvidmaker requested a review from a team as a code owner April 25, 2024 23:08
@emanvidmaker emanvidmaker changed the title [offline docs] FileAccess.xml had conflicting function names in its code example [offline docs] FileAccess.xml had conflicting function names in its example code Apr 25, 2024
@akien-mga akien-mga changed the title [offline docs] FileAccess.xml had conflicting function names in its example code Docs: Fix FileAccess example conflicting with global scope load Apr 26, 2024
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

Makes sense!

@akien-mga akien-mga added enhancement documentation cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release labels Apr 26, 2024
@akien-mga akien-mga added this to the 4.3 milestone Apr 26, 2024
@akien-mga akien-mga merged commit 9bb448f into godotengine:master Apr 26, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@emanvidmaker
Copy link
Contributor Author

No problem 👍

@emanvidmaker emanvidmaker deleted the patch-1 branch April 27, 2024 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release documentation enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants