mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Rename instance()->instantiate() when it's a verb
This commit is contained in:
@@ -128,7 +128,7 @@ void DisplayServerJavaScript::dom2godot_mod(T *emscripten_event_ptr, Ref<InputEv
|
||||
|
||||
Ref<InputEventKey> DisplayServerJavaScript::setup_key_event(const EmscriptenKeyboardEvent *emscripten_event) {
|
||||
Ref<InputEventKey> ev;
|
||||
ev.instance();
|
||||
ev.instantiate();
|
||||
ev->set_echo(emscripten_event->repeat);
|
||||
dom2godot_mod(emscripten_event, ev);
|
||||
ev->set_keycode(dom_code2godot_scancode(emscripten_event->code, emscripten_event->key, false));
|
||||
@@ -181,7 +181,7 @@ EM_BOOL DisplayServerJavaScript::mouse_button_callback(int p_event_type, const E
|
||||
DisplayServerJavaScript *display = get_singleton();
|
||||
|
||||
Ref<InputEventMouseButton> ev;
|
||||
ev.instance();
|
||||
ev.instantiate();
|
||||
ev->set_pressed(p_event_type == EMSCRIPTEN_EVENT_MOUSEDOWN);
|
||||
ev->set_position(compute_position_in_canvas(p_event->clientX, p_event->clientY));
|
||||
ev->set_global_position(ev->get_position());
|
||||
@@ -261,7 +261,7 @@ EM_BOOL DisplayServerJavaScript::mousemove_callback(int p_event_type, const Emsc
|
||||
return false;
|
||||
|
||||
Ref<InputEventMouseMotion> ev;
|
||||
ev.instance();
|
||||
ev.instantiate();
|
||||
dom2godot_mod(p_event, ev);
|
||||
ev->set_button_mask(input_mask);
|
||||
|
||||
@@ -452,7 +452,7 @@ EM_BOOL DisplayServerJavaScript::wheel_callback(int p_event_type, const Emscript
|
||||
|
||||
Input *input = Input::get_singleton();
|
||||
Ref<InputEventMouseButton> ev;
|
||||
ev.instance();
|
||||
ev.instantiate();
|
||||
ev->set_position(input->get_mouse_position());
|
||||
ev->set_global_position(ev->get_position());
|
||||
|
||||
@@ -492,7 +492,7 @@ EM_BOOL DisplayServerJavaScript::wheel_callback(int p_event_type, const Emscript
|
||||
EM_BOOL DisplayServerJavaScript::touch_press_callback(int p_event_type, const EmscriptenTouchEvent *p_event, void *p_user_data) {
|
||||
DisplayServerJavaScript *display = get_singleton();
|
||||
Ref<InputEventScreenTouch> ev;
|
||||
ev.instance();
|
||||
ev.instantiate();
|
||||
int lowest_id_index = -1;
|
||||
for (int i = 0; i < p_event->numTouches; ++i) {
|
||||
const EmscriptenTouchPoint &touch = p_event->touches[i];
|
||||
@@ -514,7 +514,7 @@ EM_BOOL DisplayServerJavaScript::touch_press_callback(int p_event_type, const Em
|
||||
EM_BOOL DisplayServerJavaScript::touchmove_callback(int p_event_type, const EmscriptenTouchEvent *p_event, void *p_user_data) {
|
||||
DisplayServerJavaScript *display = get_singleton();
|
||||
Ref<InputEventScreenDrag> ev;
|
||||
ev.instance();
|
||||
ev.instantiate();
|
||||
int lowest_id_index = -1;
|
||||
for (int i = 0; i < p_event->numTouches; ++i) {
|
||||
const EmscriptenTouchPoint &touch = p_event->touches[i];
|
||||
@@ -553,12 +553,12 @@ void DisplayServerJavaScript::vk_input_text_callback(const char *p_text, int p_c
|
||||
Input *input = Input::get_singleton();
|
||||
Ref<InputEventKey> k;
|
||||
for (int i = 0; i < p_cursor; i++) {
|
||||
k.instance();
|
||||
k.instantiate();
|
||||
k->set_pressed(true);
|
||||
k->set_echo(false);
|
||||
k->set_keycode(KEY_RIGHT);
|
||||
input->parse_input_event(k);
|
||||
k.instance();
|
||||
k.instantiate();
|
||||
k->set_pressed(false);
|
||||
k->set_echo(false);
|
||||
k->set_keycode(KEY_RIGHT);
|
||||
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
mimes["png"] = "image/png";
|
||||
mimes["svg"] = "image/svg";
|
||||
mimes["wasm"] = "application/wasm";
|
||||
server.instance();
|
||||
server.instantiate();
|
||||
stop();
|
||||
}
|
||||
|
||||
@@ -289,7 +289,7 @@ class EditorExportPlatformJavaScript : public EditorExportPlatform {
|
||||
|
||||
Ref<Image> _get_project_icon() const {
|
||||
Ref<Image> icon;
|
||||
icon.instance();
|
||||
icon.instantiate();
|
||||
const String icon_path = String(GLOBAL_GET("application/config/icon")).strip_edges();
|
||||
if (icon_path.is_empty() || ImageLoader::load_image(icon_path, icon) != OK) {
|
||||
return EditorNode::get_singleton()->get_editor_theme()->get_icon("DefaultProjectIcon", "EditorIcons")->get_image();
|
||||
@@ -299,7 +299,7 @@ class EditorExportPlatformJavaScript : public EditorExportPlatform {
|
||||
|
||||
Ref<Image> _get_project_splash() const {
|
||||
Ref<Image> splash;
|
||||
splash.instance();
|
||||
splash.instantiate();
|
||||
const String splash_path = String(GLOBAL_GET("application/boot_splash/image")).strip_edges();
|
||||
if (splash_path.is_empty() || ImageLoader::load_image(splash_path, splash) != OK) {
|
||||
return Ref<Image>(memnew(Image(boot_splash_png)));
|
||||
@@ -481,7 +481,7 @@ Error EditorExportPlatformJavaScript::_add_manifest_icon(const String &p_path, c
|
||||
|
||||
Ref<Image> icon;
|
||||
if (!p_icon.is_empty()) {
|
||||
icon.instance();
|
||||
icon.instantiate();
|
||||
const Error err = ImageLoader::load_image(p_icon, icon);
|
||||
if (err != OK) {
|
||||
EditorNode::get_singleton()->show_warning(TTR("Could not read file:") + "\n" + p_icon);
|
||||
@@ -964,22 +964,22 @@ void EditorExportPlatformJavaScript::_server_thread_poll(void *data) {
|
||||
}
|
||||
|
||||
EditorExportPlatformJavaScript::EditorExportPlatformJavaScript() {
|
||||
server.instance();
|
||||
server.instantiate();
|
||||
server_thread.start(_server_thread_poll, this);
|
||||
|
||||
Ref<Image> img = memnew(Image(_javascript_logo));
|
||||
logo.instance();
|
||||
logo.instantiate();
|
||||
logo->create_from_image(img);
|
||||
|
||||
img = Ref<Image>(memnew(Image(_javascript_run_icon)));
|
||||
run_icon.instance();
|
||||
run_icon.instantiate();
|
||||
run_icon->create_from_image(img);
|
||||
|
||||
Ref<Theme> theme = EditorNode::get_singleton()->get_editor_theme();
|
||||
if (theme.is_valid()) {
|
||||
stop_icon = theme->get_icon("Stop", "EditorIcons");
|
||||
} else {
|
||||
stop_icon.instance();
|
||||
stop_icon.instantiate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1000,6 +1000,6 @@ void register_javascript_exporter() {
|
||||
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/web/ssl_certificate", PROPERTY_HINT_GLOBAL_FILE, "*.crt,*.pem"));
|
||||
|
||||
Ref<EditorExportPlatformJavaScript> platform;
|
||||
platform.instance();
|
||||
platform.instantiate();
|
||||
EditorExport::get_singleton()->add_export_platform(platform);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user