diff options
author | MJacred <loesch.benny92@gmx.de> | 2022-09-16 11:14:14 +0200 |
---|---|---|
committer | MJacred <loesch.benny92@gmx.de> | 2022-09-16 11:17:36 +0200 |
commit | ac9786c52534cc98c107edf568656f33a81fa2a0 (patch) | |
tree | b4aea71462783d2165283f37f4476db950058854 /core | |
parent | d1b2a191ab752ebd8236e3547e07b6eb3bb1f260 (diff) |
Add get_distribution_name() and get_version() to OS
supports: LinuxBSD, Windows, macOS, iOS, Android, UWP
Co-authored-by: bruvzg
Diffstat (limited to 'core')
-rw-r--r-- | core/core_bind.cpp | 10 | ||||
-rw-r--r-- | core/core_bind.h | 2 | ||||
-rw-r--r-- | core/os/os.h | 2 |
3 files changed, 14 insertions, 0 deletions
diff --git a/core/core_bind.cpp b/core/core_bind.cpp index 9daf58cb71..ba48adff6a 100644 --- a/core/core_bind.cpp +++ b/core/core_bind.cpp @@ -322,6 +322,14 @@ String OS::get_name() const { return ::OS::get_singleton()->get_name(); } +String OS::get_distribution_name() const { + return ::OS::get_singleton()->get_distribution_name(); +} + +String OS::get_version() const { + return ::OS::get_singleton()->get_version(); +} + Vector<String> OS::get_cmdline_args() { List<String> cmdline = ::OS::get_singleton()->get_cmdline_args(); Vector<String> cmdlinev; @@ -535,6 +543,8 @@ void OS::_bind_methods() { ClassDB::bind_method(D_METHOD("has_environment", "variable"), &OS::has_environment); ClassDB::bind_method(D_METHOD("get_name"), &OS::get_name); + ClassDB::bind_method(D_METHOD("get_distribution_name"), &OS::get_distribution_name); + ClassDB::bind_method(D_METHOD("get_version"), &OS::get_version); ClassDB::bind_method(D_METHOD("get_cmdline_args"), &OS::get_cmdline_args); ClassDB::bind_method(D_METHOD("get_cmdline_user_args"), &OS::get_cmdline_user_args); diff --git a/core/core_bind.h b/core/core_bind.h index cd382d2915..0f85e473a5 100644 --- a/core/core_bind.h +++ b/core/core_bind.h @@ -193,6 +193,8 @@ public: bool set_environment(const String &p_var, const String &p_value) const; String get_name() const; + String get_distribution_name() const; + String get_version() const; Vector<String> get_cmdline_args(); Vector<String> get_cmdline_user_args(); diff --git a/core/os/os.h b/core/os/os.h index 363697ea30..6944d29eeb 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -161,6 +161,8 @@ public: virtual bool set_environment(const String &p_var, const String &p_value) const = 0; virtual String get_name() const = 0; + virtual String get_distribution_name() const = 0; + virtual String get_version() const = 0; virtual List<String> get_cmdline_args() const { return _cmdline; } virtual List<String> get_cmdline_user_args() const { return _user_args; } virtual List<String> get_cmdline_platform_args() const { return List<String>(); } |