Conversation
|
Please generate documentation by running the compiled editor with |
2915e46 to
2f0ea0b
Compare
Do functions that are not registered in the bind_method also need it? |
bruvzg
left a comment
There was a problem hiding this comment.
Also take a look at our code style guidelines, there are some issues with it.
| virtual Error set_cwd(const String &p_cwd); | ||
| virtual String get_cwd() const; |
There was a problem hiding this comment.
Note: neither set_cwd, not newly added get_cwd are bound, and therefore it will be accessible only from the engine C++ code (not from GDScript or GDExtension). If you want't it to be accessible, a wrapper should be added to the CoreBind (OS is a special case and its methods can't be bound directly).
Here's links to one of such wrappers, for example (OS.get_name):
Wrapper definition:
Line 175 in 9adb7c7
Wrapper implementation:
Lines 351 to 353 in 9adb7c7
Wrapper binding:
Line 601 in 9adb7c7
There was a problem hiding this comment.
I noticed that set_cwd is not bound, so I don't plan to get_cwd the corresponding one.
There was a problem hiding this comment.
I'm not sure what's the purpose of adding get_cwd() if it can't be used from script and not used by the engine.
There was a problem hiding this comment.
I hope it will provide an intuitive way to get the current working directory in future engine development, and it will correspond to set_cwd.
Maybe it could also be used to gradually replace the original code that used DirAccess to get the working path?
5abe2ec to
e8b2343
Compare
|
Can |
The name comes from another set_cwd method that already exists. I'm not sure if this should be changed |
Oh, then no. |
e8b2343 to
40e0326
Compare
It seems that we get current working directory by creating a DirAccess without path init and use get_current_dir(). It doesn't look intuitive.
In fact, the DirAccess finally calls the cwd getting function of specific platform. This PR move them to the OS::get_cwd virtual.