From c1c0ee3faf1d095b24060bbfe9582b2cafee53e1 Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Thu, 7 Sep 2023 12:21:34 -0500 Subject: [PATCH] Expose EditorExportPlatform::get_os_name() --- doc/classes/EditorExportPlatform.xml | 8 ++++++++ editor/export/editor_export_platform.cpp | 4 ++++ editor/export/editor_export_platform.h | 3 +++ 3 files changed, 15 insertions(+) diff --git a/doc/classes/EditorExportPlatform.xml b/doc/classes/EditorExportPlatform.xml index ac921a0c808..6801ac672c5 100644 --- a/doc/classes/EditorExportPlatform.xml +++ b/doc/classes/EditorExportPlatform.xml @@ -10,4 +10,12 @@ Console support in Godot + + + + + Returns the name of the export operating system handled by this [EditorExportPlatform] class, as a friendly string. Possible return values are [code]Windows[/code], [code]Linux[/code], [code]macOS[/code], [code]Android[/code], [code]iOS[/code], and [code]Web[/code]. + + + diff --git a/editor/export/editor_export_platform.cpp b/editor/export/editor_export_platform.cpp index 891bba6ce99..d65f10c4410 100644 --- a/editor/export/editor_export_platform.cpp +++ b/editor/export/editor_export_platform.cpp @@ -1972,5 +1972,9 @@ Error EditorExportPlatform::ssh_push_to_remote(const String &p_host, const Strin return OK; } +void EditorExportPlatform::_bind_methods() { + ClassDB::bind_method(D_METHOD("get_os_name"), &EditorExportPlatform::get_os_name); +} + EditorExportPlatform::EditorExportPlatform() { } diff --git a/editor/export/editor_export_platform.h b/editor/export/editor_export_platform.h index 5f5702026ce..0b922cc6c8f 100644 --- a/editor/export/editor_export_platform.h +++ b/editor/export/editor_export_platform.h @@ -49,6 +49,9 @@ const String ENV_SCRIPT_ENCRYPTION_KEY = "GODOT_SCRIPT_ENCRYPTION_KEY"; class EditorExportPlatform : public RefCounted { GDCLASS(EditorExportPlatform, RefCounted); +protected: + static void _bind_methods(); + public: typedef Error (*EditorExportSaveFunction)(void *p_userdata, const String &p_path, const Vector &p_data, int p_file, int p_total, const Vector &p_enc_in_filters, const Vector &p_enc_ex_filters, const Vector &p_key); typedef Error (*EditorExportSaveSharedObject)(void *p_userdata, const SharedObject &p_so);