diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-09-16 13:18:32 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-09-16 13:18:32 +0200 |
commit | 55bed82b0541c5dbefcf402cc0974fe5d05e7576 (patch) | |
tree | 4fbb6b2de0149fa74f6038408fb930b57def2d34 /core | |
parent | bda63e1b5aa420617259f151a0570ca0780c0c7d (diff) | |
parent | ac9786c52534cc98c107edf568656f33a81fa2a0 (diff) |
Merge pull request #65525 from MJacred/os/distribution
Add get_distribution_name() and get_version() to OS
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>(); } |