Godot version:
3.1.1
Issue description:
There should be a way to get platform specific OS version...
Proposed API:
OS.get_version()
There seem to be no workaround for iOS devices (without creating a native module) as to my knowledge its only possible to access this information programmatically via Swift/Objective C..
What would get_version() return? The native version string such as 4.4 for android, or something containing the platform as well (such as Android 4.4 or iOS 3.4.2)?
@bojidar-bg
I think the good idea is for it to return full version string only without platform as there is already OS.get_name method.
I think the good idea is for it to return full version string only without platform as there is already OS.get_name method.
That's not really sufficient as OS.get_name() returns Linux/X11 on linux distros, so you still need to know which distro that is, e.g.:
$ cat /etc/release
Mageia release 7 (Official) for x86_64
On Linux, I would expect get_version to give me the kernel version; distribution should be listed as well though.
Some linux distros dont even have a version, like Arch Linux in that case I'd consider Arch Linux (from os_release) as a linux version.. I think, given the diversity, get_version could return strictly formated composed string eg. distro_name + version_if_any...
uname -a gives me
Linux archlaptop 5.2.11-arch1-1-ARCH #1 SMP PREEMPT Thu Aug 29 08:09:36 UTC 2019 x86_64 GNU/Linux
which is not really helpful to get from higher level API in gdscript.. and the kernel version is too much low level identifier
On Windows, Mac, IOS and android it can just return the version number, for windows for example:
if it is Windows XP the return value should be 5.1
if it is Windows Vista, 6.0
Windows 7: 6.1Windows 8: 6.2Windows 8.1: 6.3Windows 10: 10.0You can then compare the value and do the appropriate actions depending on the OS version.
OSX:
El Capitan: 10.11.0IOS:
4.3, 6.1 etc.Android:
Android Marshmallow: 6.0 to 6.0.1Android Nougat: 7.0 to 7.1Android Oreo: 8.0 to 8.1Android Pie: 9.0The returned value should be the float value of the version so that you can easily compare it.
For linux it could return an array with ["distro_name":"some_distro", "os_version":"some_version"]
EDIT: The above version numbers are actual representations of the os, version of these platforms.
The returned value should be the float value
Nope. It would be better to have it similar Engine.get_version_info(), containing major, minor, and patch versions as integers.
The returned value should be the float value
Nope. It would be better to have it similar
Engine.get_version_info(), containing major, minor, and patch versions as integers.
But, what is the point of returning the full string of the version? What is the use case of it? If for example, you want to compare it and do some action depending on the version number, you'd have to remove the text and possible do more unnecessary actions. Maybe, return an array for all platforms with os_name, os_version for windows/osx and kernel, minor, major, build for linux.
Hi,
Is there any update on this effort?
Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine.
The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker.
If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance!