diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2021-07-22 19:23:48 +0300 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2021-07-22 21:50:35 +0300 |
commit | 618eb27e8b1d3a00fd5a809a0a998d4e0f10e1b7 (patch) | |
tree | 97babcc5cddd671f5d0ecc44811e11210ce65974 /platform/javascript | |
parent | 5de991d57c44d68221c68cf4996831a3b6a3e9e1 (diff) |
Move `alert` function from `DisplayServer` to `OS`.
Diffstat (limited to 'platform/javascript')
-rw-r--r-- | platform/javascript/display_server_javascript.cpp | 4 | ||||
-rw-r--r-- | platform/javascript/display_server_javascript.h | 1 | ||||
-rw-r--r-- | platform/javascript/os_javascript.cpp | 4 | ||||
-rw-r--r-- | platform/javascript/os_javascript.h | 3 |
4 files changed, 7 insertions, 5 deletions
diff --git a/platform/javascript/display_server_javascript.cpp b/platform/javascript/display_server_javascript.cpp index 5e2b089c7f..8df81bb8cc 100644 --- a/platform/javascript/display_server_javascript.cpp +++ b/platform/javascript/display_server_javascript.cpp @@ -659,10 +659,6 @@ void DisplayServerJavaScript::send_window_event_callback(int p_notification) { } } -void DisplayServerJavaScript::alert(const String &p_alert, const String &p_title) { - godot_js_display_alert(p_alert.utf8().get_data()); -} - void DisplayServerJavaScript::set_icon(const Ref<Image> &p_icon) { ERR_FAIL_COND(p_icon.is_null()); Ref<Image> icon = p_icon; diff --git a/platform/javascript/display_server_javascript.h b/platform/javascript/display_server_javascript.h index f8acf30854..bf5e229c9a 100644 --- a/platform/javascript/display_server_javascript.h +++ b/platform/javascript/display_server_javascript.h @@ -109,7 +109,6 @@ public: bool check_size_force_redraw(); // from DisplayServer - virtual void alert(const String &p_alert, const String &p_title = "ALERT!") override; virtual bool has_feature(Feature p_feature) const override; virtual String get_name() const override; diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index 260bfad7a5..549c1d47ec 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -47,6 +47,10 @@ #include "godot_js.h" +void OS_JavaScript::alert(const String &p_alert, const String &p_title) { + godot_js_display_alert(p_alert.utf8().get_data()); +} + // Lifecycle void OS_JavaScript::initialize() { OS_Unix::initialize_core(); diff --git a/platform/javascript/os_javascript.h b/platform/javascript/os_javascript.h index 81bb9c5f3d..efac2dbca7 100644 --- a/platform/javascript/os_javascript.h +++ b/platform/javascript/os_javascript.h @@ -89,6 +89,9 @@ public: String get_user_data_dir() const override; bool is_userfs_persistent() const override; + + void alert(const String &p_alert, const String &p_title = "ALERT!") override; + Error open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path) override; void resume_audio(); |