Move alert function from DisplayServer to OS.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user