diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-01-14 17:22:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-14 17:22:06 +0100 |
commit | ce99286362a7adbd867a2d73ec18b82aaa8f0b7d (patch) | |
tree | 50c9c0823ed2f8977b7274effaab4293640a9339 /core/bind | |
parent | 479790a841f3c55515eefcadce0c8e6de23d48f8 (diff) | |
parent | 0b2ae7313b0df1ec0bfe53e8e99c38f064530f1d (diff) |
Merge pull request #7524 from neikeq/pr-dir-getcurdrive
Directory: Bind get_current_drive() method
Diffstat (limited to 'core/bind')
-rw-r--r-- | core/bind/core_bind.cpp | 7 | ||||
-rw-r--r-- | core/bind/core_bind.h | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index c8feb8b7d3..d2264c6c6a 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -431,7 +431,7 @@ String _OS::get_latin_keyboard_variant() const { String _OS::get_model_name() const { - return OS::get_singleton()->get_model_name(); + return OS::get_singleton()->get_model_name(); } @@ -1864,6 +1864,10 @@ String _Directory::get_drive(int p_drive){ ERR_FAIL_COND_V(!d,""); return d->get_drive(p_drive); } +int _Directory::get_current_drive() { + ERR_FAIL_COND_V(!d,""); + return d->get_current_drive(); +} Error _Directory::change_dir(String p_dir){ @@ -1972,6 +1976,7 @@ void _Directory::_bind_methods() { ClassDB::bind_method(_MD("list_dir_end"),&_Directory::list_dir_end); ClassDB::bind_method(_MD("get_drive_count"),&_Directory::get_drive_count); ClassDB::bind_method(_MD("get_drive","idx"),&_Directory::get_drive); + ClassDB::bind_method(_MD("get_current_drive"),&_Directory::get_current_drive); ClassDB::bind_method(_MD("change_dir:Error","todir"),&_Directory::change_dir); ClassDB::bind_method(_MD("get_current_dir"),&_Directory::get_current_dir); ClassDB::bind_method(_MD("make_dir:Error","path"),&_Directory::make_dir); diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 5b32aaa9cd..f10714720f 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -464,6 +464,7 @@ public: int get_drive_count(); String get_drive(int p_drive); + int get_current_drive(); Error change_dir(String p_dir); ///< can be relative or absolute, return false on success String get_current_dir(); ///< return current dir location |