Rename `instance()`->`instantiate()` when it's a verb
This commit is contained in:
parent
60dcc4f39c
commit
e28fd07b2b
|
@ -1850,12 +1850,12 @@ bool _ClassDB::is_parent_class(const StringName &p_class, const StringName &p_in
|
||||||
return ClassDB::is_parent_class(p_class, p_inherits);
|
return ClassDB::is_parent_class(p_class, p_inherits);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool _ClassDB::can_instance(const StringName &p_class) const {
|
bool _ClassDB::can_instantiate(const StringName &p_class) const {
|
||||||
return ClassDB::can_instance(p_class);
|
return ClassDB::can_instantiate(p_class);
|
||||||
}
|
}
|
||||||
|
|
||||||
Variant _ClassDB::instance(const StringName &p_class) const {
|
Variant _ClassDB::instantiate(const StringName &p_class) const {
|
||||||
Object *obj = ClassDB::instance(p_class);
|
Object *obj = ClassDB::instantiate(p_class);
|
||||||
if (!obj) {
|
if (!obj) {
|
||||||
return Variant();
|
return Variant();
|
||||||
}
|
}
|
||||||
|
@ -1984,8 +1984,8 @@ void _ClassDB::_bind_methods() {
|
||||||
ClassDB::bind_method(D_METHOD("get_parent_class", "class"), &_ClassDB::get_parent_class);
|
ClassDB::bind_method(D_METHOD("get_parent_class", "class"), &_ClassDB::get_parent_class);
|
||||||
ClassDB::bind_method(D_METHOD("class_exists", "class"), &_ClassDB::class_exists);
|
ClassDB::bind_method(D_METHOD("class_exists", "class"), &_ClassDB::class_exists);
|
||||||
ClassDB::bind_method(D_METHOD("is_parent_class", "class", "inherits"), &_ClassDB::is_parent_class);
|
ClassDB::bind_method(D_METHOD("is_parent_class", "class", "inherits"), &_ClassDB::is_parent_class);
|
||||||
ClassDB::bind_method(D_METHOD("can_instance", "class"), &_ClassDB::can_instance);
|
ClassDB::bind_method(D_METHOD("can_instantiate", "class"), &_ClassDB::can_instantiate);
|
||||||
ClassDB::bind_method(D_METHOD("instance", "class"), &_ClassDB::instance);
|
ClassDB::bind_method(D_METHOD("instantiate", "class"), &_ClassDB::instantiate);
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("class_has_signal", "class", "signal"), &_ClassDB::has_signal);
|
ClassDB::bind_method(D_METHOD("class_has_signal", "class", "signal"), &_ClassDB::has_signal);
|
||||||
ClassDB::bind_method(D_METHOD("class_get_signal", "class", "signal"), &_ClassDB::get_signal);
|
ClassDB::bind_method(D_METHOD("class_get_signal", "class", "signal"), &_ClassDB::get_signal);
|
||||||
|
|
|
@ -585,8 +585,8 @@ public:
|
||||||
StringName get_parent_class(const StringName &p_class) const;
|
StringName get_parent_class(const StringName &p_class) const;
|
||||||
bool class_exists(const StringName &p_class) const;
|
bool class_exists(const StringName &p_class) const;
|
||||||
bool is_parent_class(const StringName &p_class, const StringName &p_inherits) const;
|
bool is_parent_class(const StringName &p_class, const StringName &p_inherits) const;
|
||||||
bool can_instance(const StringName &p_class) const;
|
bool can_instantiate(const StringName &p_class) const;
|
||||||
Variant instance(const StringName &p_class) const;
|
Variant instantiate(const StringName &p_class) const;
|
||||||
|
|
||||||
bool has_signal(StringName p_class, StringName p_signal) const;
|
bool has_signal(StringName p_class, StringName p_signal) const;
|
||||||
Dictionary get_signal(StringName p_class, StringName p_signal) const;
|
Dictionary get_signal(StringName p_class, StringName p_signal) const;
|
||||||
|
|
|
@ -84,7 +84,7 @@ RemoteDebuggerPeerTCP::RemoteDebuggerPeerTCP(Ref<StreamPeerTCP> p_tcp) {
|
||||||
thread.start(_thread_func, this);
|
thread.start(_thread_func, this);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
tcp_client.instance();
|
tcp_client.instantiate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -500,7 +500,7 @@ void Input::_parse_input_event_impl(const Ref<InputEvent> &p_event, bool p_is_em
|
||||||
|
|
||||||
if (event_dispatch_function && emulate_touch_from_mouse && !p_is_emulated && mb->get_button_index() == 1) {
|
if (event_dispatch_function && emulate_touch_from_mouse && !p_is_emulated && mb->get_button_index() == 1) {
|
||||||
Ref<InputEventScreenTouch> touch_event;
|
Ref<InputEventScreenTouch> touch_event;
|
||||||
touch_event.instance();
|
touch_event.instantiate();
|
||||||
touch_event->set_pressed(mb->is_pressed());
|
touch_event->set_pressed(mb->is_pressed());
|
||||||
touch_event->set_position(mb->get_position());
|
touch_event->set_position(mb->get_position());
|
||||||
event_dispatch_function(touch_event);
|
event_dispatch_function(touch_event);
|
||||||
|
@ -517,7 +517,7 @@ void Input::_parse_input_event_impl(const Ref<InputEvent> &p_event, bool p_is_em
|
||||||
|
|
||||||
if (event_dispatch_function && emulate_touch_from_mouse && !p_is_emulated && mm->get_button_mask() & 1) {
|
if (event_dispatch_function && emulate_touch_from_mouse && !p_is_emulated && mm->get_button_mask() & 1) {
|
||||||
Ref<InputEventScreenDrag> drag_event;
|
Ref<InputEventScreenDrag> drag_event;
|
||||||
drag_event.instance();
|
drag_event.instantiate();
|
||||||
|
|
||||||
drag_event->set_position(mm->get_position());
|
drag_event->set_position(mm->get_position());
|
||||||
drag_event->set_relative(mm->get_relative());
|
drag_event->set_relative(mm->get_relative());
|
||||||
|
@ -555,7 +555,7 @@ void Input::_parse_input_event_impl(const Ref<InputEvent> &p_event, bool p_is_em
|
||||||
|
|
||||||
if (translate) {
|
if (translate) {
|
||||||
Ref<InputEventMouseButton> button_event;
|
Ref<InputEventMouseButton> button_event;
|
||||||
button_event.instance();
|
button_event.instantiate();
|
||||||
|
|
||||||
button_event->set_device(InputEvent::DEVICE_ID_TOUCH_MOUSE);
|
button_event->set_device(InputEvent::DEVICE_ID_TOUCH_MOUSE);
|
||||||
button_event->set_position(st->get_position());
|
button_event->set_position(st->get_position());
|
||||||
|
@ -582,7 +582,7 @@ void Input::_parse_input_event_impl(const Ref<InputEvent> &p_event, bool p_is_em
|
||||||
|
|
||||||
if (emulate_mouse_from_touch && sd->get_index() == mouse_from_touch_index) {
|
if (emulate_mouse_from_touch && sd->get_index() == mouse_from_touch_index) {
|
||||||
Ref<InputEventMouseMotion> motion_event;
|
Ref<InputEventMouseMotion> motion_event;
|
||||||
motion_event.instance();
|
motion_event.instantiate();
|
||||||
|
|
||||||
motion_event->set_device(InputEvent::DEVICE_ID_TOUCH_MOUSE);
|
motion_event->set_device(InputEvent::DEVICE_ID_TOUCH_MOUSE);
|
||||||
motion_event->set_position(sd->get_position());
|
motion_event->set_position(sd->get_position());
|
||||||
|
@ -787,7 +787,7 @@ void Input::ensure_touch_mouse_raised() {
|
||||||
mouse_from_touch_index = -1;
|
mouse_from_touch_index = -1;
|
||||||
|
|
||||||
Ref<InputEventMouseButton> button_event;
|
Ref<InputEventMouseButton> button_event;
|
||||||
button_event.instance();
|
button_event.instantiate();
|
||||||
|
|
||||||
button_event->set_device(InputEvent::DEVICE_ID_TOUCH_MOUSE);
|
button_event->set_device(InputEvent::DEVICE_ID_TOUCH_MOUSE);
|
||||||
button_event->set_position(mouse_pos);
|
button_event->set_position(mouse_pos);
|
||||||
|
@ -821,7 +821,7 @@ void Input::set_default_cursor_shape(CursorShape p_shape) {
|
||||||
// The default shape is set in Viewport::_gui_input_event. To instantly
|
// The default shape is set in Viewport::_gui_input_event. To instantly
|
||||||
// see the shape in the viewport we need to trigger a mouse motion event.
|
// see the shape in the viewport we need to trigger a mouse motion event.
|
||||||
Ref<InputEventMouseMotion> mm;
|
Ref<InputEventMouseMotion> mm;
|
||||||
mm.instance();
|
mm.instantiate();
|
||||||
mm->set_position(mouse_pos);
|
mm->set_position(mouse_pos);
|
||||||
mm->set_global_position(mouse_pos);
|
mm->set_global_position(mouse_pos);
|
||||||
parse_input_event(mm);
|
parse_input_event(mm);
|
||||||
|
@ -1031,7 +1031,7 @@ void Input::joy_hat(int p_device, int p_val) {
|
||||||
|
|
||||||
void Input::_button_event(int p_device, int p_index, bool p_pressed) {
|
void Input::_button_event(int p_device, int p_index, bool p_pressed) {
|
||||||
Ref<InputEventJoypadButton> ievent;
|
Ref<InputEventJoypadButton> ievent;
|
||||||
ievent.instance();
|
ievent.instantiate();
|
||||||
ievent->set_device(p_device);
|
ievent->set_device(p_device);
|
||||||
ievent->set_button_index(p_index);
|
ievent->set_button_index(p_index);
|
||||||
ievent->set_pressed(p_pressed);
|
ievent->set_pressed(p_pressed);
|
||||||
|
@ -1041,7 +1041,7 @@ void Input::_button_event(int p_device, int p_index, bool p_pressed) {
|
||||||
|
|
||||||
void Input::_axis_event(int p_device, int p_axis, float p_value) {
|
void Input::_axis_event(int p_device, int p_axis, float p_value) {
|
||||||
Ref<InputEventJoypadMotion> ievent;
|
Ref<InputEventJoypadMotion> ievent;
|
||||||
ievent.instance();
|
ievent.instantiate();
|
||||||
ievent->set_device(p_device);
|
ievent->set_device(p_device);
|
||||||
ievent->set_axis(p_axis);
|
ievent->set_axis(p_axis);
|
||||||
ievent->set_axis_value(p_value);
|
ievent->set_axis_value(p_value);
|
||||||
|
|
|
@ -375,7 +375,7 @@ String InputEventKey::to_string() {
|
||||||
|
|
||||||
Ref<InputEventKey> InputEventKey::create_reference(uint32_t p_keycode) {
|
Ref<InputEventKey> InputEventKey::create_reference(uint32_t p_keycode) {
|
||||||
Ref<InputEventKey> ie;
|
Ref<InputEventKey> ie;
|
||||||
ie.instance();
|
ie.instantiate();
|
||||||
ie->set_keycode(p_keycode & KEY_CODE_MASK);
|
ie->set_keycode(p_keycode & KEY_CODE_MASK);
|
||||||
ie->set_unicode(p_keycode & KEY_CODE_MASK);
|
ie->set_unicode(p_keycode & KEY_CODE_MASK);
|
||||||
|
|
||||||
|
@ -545,7 +545,7 @@ Ref<InputEvent> InputEventMouseButton::xformed_by(const Transform2D &p_xform, co
|
||||||
Vector2 l = p_xform.xform(get_position() + p_local_ofs);
|
Vector2 l = p_xform.xform(get_position() + p_local_ofs);
|
||||||
|
|
||||||
Ref<InputEventMouseButton> mb;
|
Ref<InputEventMouseButton> mb;
|
||||||
mb.instance();
|
mb.instantiate();
|
||||||
|
|
||||||
mb->set_device(get_device());
|
mb->set_device(get_device());
|
||||||
mb->set_window_id(get_window_id());
|
mb->set_window_id(get_window_id());
|
||||||
|
@ -731,7 +731,7 @@ Ref<InputEvent> InputEventMouseMotion::xformed_by(const Transform2D &p_xform, co
|
||||||
Vector2 s = p_xform.basis_xform(get_speed());
|
Vector2 s = p_xform.basis_xform(get_speed());
|
||||||
|
|
||||||
Ref<InputEventMouseMotion> mm;
|
Ref<InputEventMouseMotion> mm;
|
||||||
mm.instance();
|
mm.instantiate();
|
||||||
|
|
||||||
mm->set_device(get_device());
|
mm->set_device(get_device());
|
||||||
mm->set_window_id(get_window_id());
|
mm->set_window_id(get_window_id());
|
||||||
|
@ -1048,7 +1048,7 @@ String InputEventJoypadButton::to_string() {
|
||||||
|
|
||||||
Ref<InputEventJoypadButton> InputEventJoypadButton::create_reference(int p_btn_index) {
|
Ref<InputEventJoypadButton> InputEventJoypadButton::create_reference(int p_btn_index) {
|
||||||
Ref<InputEventJoypadButton> ie;
|
Ref<InputEventJoypadButton> ie;
|
||||||
ie.instance();
|
ie.instantiate();
|
||||||
ie->set_button_index(p_btn_index);
|
ie->set_button_index(p_btn_index);
|
||||||
|
|
||||||
return ie;
|
return ie;
|
||||||
|
@ -1097,7 +1097,7 @@ bool InputEventScreenTouch::is_pressed() const {
|
||||||
|
|
||||||
Ref<InputEvent> InputEventScreenTouch::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const {
|
Ref<InputEvent> InputEventScreenTouch::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const {
|
||||||
Ref<InputEventScreenTouch> st;
|
Ref<InputEventScreenTouch> st;
|
||||||
st.instance();
|
st.instantiate();
|
||||||
st->set_device(get_device());
|
st->set_device(get_device());
|
||||||
st->set_window_id(get_window_id());
|
st->set_window_id(get_window_id());
|
||||||
st->set_index(index);
|
st->set_index(index);
|
||||||
|
@ -1170,7 +1170,7 @@ Vector2 InputEventScreenDrag::get_speed() const {
|
||||||
Ref<InputEvent> InputEventScreenDrag::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const {
|
Ref<InputEvent> InputEventScreenDrag::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const {
|
||||||
Ref<InputEventScreenDrag> sd;
|
Ref<InputEventScreenDrag> sd;
|
||||||
|
|
||||||
sd.instance();
|
sd.instantiate();
|
||||||
|
|
||||||
sd->set_device(get_device());
|
sd->set_device(get_device());
|
||||||
sd->set_window_id(get_window_id());
|
sd->set_window_id(get_window_id());
|
||||||
|
@ -1325,7 +1325,7 @@ real_t InputEventMagnifyGesture::get_factor() const {
|
||||||
|
|
||||||
Ref<InputEvent> InputEventMagnifyGesture::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const {
|
Ref<InputEvent> InputEventMagnifyGesture::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const {
|
||||||
Ref<InputEventMagnifyGesture> ev;
|
Ref<InputEventMagnifyGesture> ev;
|
||||||
ev.instance();
|
ev.instantiate();
|
||||||
|
|
||||||
ev->set_device(get_device());
|
ev->set_device(get_device());
|
||||||
ev->set_window_id(get_window_id());
|
ev->set_window_id(get_window_id());
|
||||||
|
@ -1365,7 +1365,7 @@ Vector2 InputEventPanGesture::get_delta() const {
|
||||||
|
|
||||||
Ref<InputEvent> InputEventPanGesture::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const {
|
Ref<InputEvent> InputEventPanGesture::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const {
|
||||||
Ref<InputEventPanGesture> ev;
|
Ref<InputEventPanGesture> ev;
|
||||||
ev.instance();
|
ev.instantiate();
|
||||||
|
|
||||||
ev->set_device(get_device());
|
ev->set_device(get_device());
|
||||||
ev->set_window_id(get_window_id());
|
ev->set_window_id(get_window_id());
|
||||||
|
|
|
@ -210,7 +210,7 @@ FileAccessNetworkClient *FileAccessNetworkClient::singleton = nullptr;
|
||||||
|
|
||||||
FileAccessNetworkClient::FileAccessNetworkClient() {
|
FileAccessNetworkClient::FileAccessNetworkClient() {
|
||||||
singleton = this;
|
singleton = this;
|
||||||
client.instance();
|
client.instantiate();
|
||||||
}
|
}
|
||||||
|
|
||||||
FileAccessNetworkClient::~FileAccessNetworkClient() {
|
FileAccessNetworkClient::~FileAccessNetworkClient() {
|
||||||
|
|
|
@ -730,7 +730,7 @@ int HTTPClient::get_read_chunk_size() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
HTTPClient::HTTPClient() {
|
HTTPClient::HTTPClient() {
|
||||||
tcp_connection.instance();
|
tcp_connection.instantiate();
|
||||||
}
|
}
|
||||||
|
|
||||||
HTTPClient::~HTTPClient() {}
|
HTTPClient::~HTTPClient() {}
|
||||||
|
|
|
@ -1945,7 +1945,7 @@ Error Image::generate_mipmap_roughness(RoughnessChannel p_roughness_channel, con
|
||||||
memcpy(wr.ptr(), ptr, size);
|
memcpy(wr.ptr(), ptr, size);
|
||||||
wr = uint8_t*();
|
wr = uint8_t*();
|
||||||
Ref<Image> im;
|
Ref<Image> im;
|
||||||
im.instance();
|
im.instantiate();
|
||||||
im->create(w, h, false, format, imgdata);
|
im->create(w, h, false, format, imgdata);
|
||||||
im->save_png("res://mipmap_" + itos(i) + ".png");
|
im->save_png("res://mipmap_" + itos(i) + ".png");
|
||||||
}
|
}
|
||||||
|
@ -3280,7 +3280,7 @@ Ref<Image> Image::rgbe_to_srgb() {
|
||||||
ERR_FAIL_COND_V(format != FORMAT_RGBE9995, Ref<Image>());
|
ERR_FAIL_COND_V(format != FORMAT_RGBE9995, Ref<Image>());
|
||||||
|
|
||||||
Ref<Image> new_image;
|
Ref<Image> new_image;
|
||||||
new_image.instance();
|
new_image.instantiate();
|
||||||
new_image->create(width, height, false, Image::FORMAT_RGB8);
|
new_image->create(width, height, false, Image::FORMAT_RGB8);
|
||||||
|
|
||||||
for (int row = 0; row < height; row++) {
|
for (int row = 0; row < height; row++) {
|
||||||
|
@ -3310,7 +3310,7 @@ Ref<Image> Image::get_image_from_mipmap(int p_mipamp) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<Image> image;
|
Ref<Image> image;
|
||||||
image.instance();
|
image.instantiate();
|
||||||
image->width = w;
|
image->width = w;
|
||||||
image->height = h;
|
image->height = h;
|
||||||
image->format = format;
|
image->format = format;
|
||||||
|
@ -3627,7 +3627,7 @@ Image::Image(const uint8_t *p_mem_png_jpg, int p_len) {
|
||||||
|
|
||||||
Ref<Resource> Image::duplicate(bool p_subresources) const {
|
Ref<Resource> Image::duplicate(bool p_subresources) const {
|
||||||
Ref<Image> copy;
|
Ref<Image> copy;
|
||||||
copy.instance();
|
copy.instantiate();
|
||||||
copy->_copy_internals_from(*this);
|
copy->_copy_internals_from(*this);
|
||||||
return copy;
|
return copy;
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,7 +163,7 @@ RES ResourceFormatLoaderImage::load(const String &p_path, const String &p_origin
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<Image> image;
|
Ref<Image> image;
|
||||||
image.instance();
|
image.instantiate();
|
||||||
|
|
||||||
Error err = ImageLoader::loader[idx]->load_image(image, f, false, 1.0);
|
Error err = ImageLoader::loader[idx]->load_image(image, f, false, 1.0);
|
||||||
|
|
||||||
|
|
|
@ -547,7 +547,7 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
|
||||||
r_variant = (Object *)nullptr;
|
r_variant = (Object *)nullptr;
|
||||||
} else {
|
} else {
|
||||||
Ref<EncodedObjectAsID> obj_as_id;
|
Ref<EncodedObjectAsID> obj_as_id;
|
||||||
obj_as_id.instance();
|
obj_as_id.instantiate();
|
||||||
obj_as_id->set_object_id(val);
|
obj_as_id->set_object_id(val);
|
||||||
|
|
||||||
r_variant = obj_as_id;
|
r_variant = obj_as_id;
|
||||||
|
@ -565,7 +565,7 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
|
||||||
if (str == String()) {
|
if (str == String()) {
|
||||||
r_variant = (Object *)nullptr;
|
r_variant = (Object *)nullptr;
|
||||||
} else {
|
} else {
|
||||||
Object *obj = ClassDB::instance(str);
|
Object *obj = ClassDB::instantiate(str);
|
||||||
|
|
||||||
ERR_FAIL_COND_V(!obj, ERR_UNAVAILABLE);
|
ERR_FAIL_COND_V(!obj, ERR_UNAVAILABLE);
|
||||||
ERR_FAIL_COND_V(len < 4, ERR_INVALID_DATA);
|
ERR_FAIL_COND_V(len < 4, ERR_INVALID_DATA);
|
||||||
|
|
|
@ -164,7 +164,7 @@ Ref<Resource> Resource::duplicate_for_local_scene(Node *p_for_scene, Map<Ref<Res
|
||||||
List<PropertyInfo> plist;
|
List<PropertyInfo> plist;
|
||||||
get_property_list(&plist);
|
get_property_list(&plist);
|
||||||
|
|
||||||
Ref<Resource> r = Object::cast_to<Resource>(ClassDB::instance(get_class()));
|
Ref<Resource> r = Object::cast_to<Resource>(ClassDB::instantiate(get_class()));
|
||||||
ERR_FAIL_COND_V(r.is_null(), Ref<Resource>());
|
ERR_FAIL_COND_V(r.is_null(), Ref<Resource>());
|
||||||
|
|
||||||
r->local_scene = p_for_scene;
|
r->local_scene = p_for_scene;
|
||||||
|
@ -224,7 +224,7 @@ Ref<Resource> Resource::duplicate(bool p_subresources) const {
|
||||||
List<PropertyInfo> plist;
|
List<PropertyInfo> plist;
|
||||||
get_property_list(&plist);
|
get_property_list(&plist);
|
||||||
|
|
||||||
Ref<Resource> r = (Resource *)ClassDB::instance(get_class());
|
Ref<Resource> r = (Resource *)ClassDB::instantiate(get_class());
|
||||||
ERR_FAIL_COND_V(r.is_null(), Ref<Resource>());
|
ERR_FAIL_COND_V(r.is_null(), Ref<Resource>());
|
||||||
|
|
||||||
for (List<PropertyInfo>::Element *E = plist.front(); E; E = E->next()) {
|
for (List<PropertyInfo>::Element *E = plist.front(); E; E = E->next()) {
|
||||||
|
|
|
@ -704,7 +704,7 @@ Error ResourceLoaderBinary::load() {
|
||||||
if (res.is_null()) {
|
if (res.is_null()) {
|
||||||
//did not replace
|
//did not replace
|
||||||
|
|
||||||
Object *obj = ClassDB::instance(t);
|
Object *obj = ClassDB::instantiate(t);
|
||||||
if (!obj) {
|
if (!obj) {
|
||||||
error = ERR_FILE_CORRUPT;
|
error = ERR_FILE_CORRUPT;
|
||||||
ERR_FAIL_V_MSG(ERR_FILE_CORRUPT, local_path + ":Resource of unrecognized type in file: " + t + ".");
|
ERR_FAIL_V_MSG(ERR_FILE_CORRUPT, local_path + ":Resource of unrecognized type in file: " + t + ".");
|
||||||
|
|
|
@ -1045,7 +1045,7 @@ bool ResourceLoader::add_custom_resource_format_loader(String script_path) {
|
||||||
bool valid_type = ClassDB::is_parent_class(ibt, "ResourceFormatLoader");
|
bool valid_type = ClassDB::is_parent_class(ibt, "ResourceFormatLoader");
|
||||||
ERR_FAIL_COND_V_MSG(!valid_type, false, "Script does not inherit a CustomResourceLoader: " + script_path + ".");
|
ERR_FAIL_COND_V_MSG(!valid_type, false, "Script does not inherit a CustomResourceLoader: " + script_path + ".");
|
||||||
|
|
||||||
Object *obj = ClassDB::instance(ibt);
|
Object *obj = ClassDB::instantiate(ibt);
|
||||||
|
|
||||||
ERR_FAIL_COND_V_MSG(obj == nullptr, false, "Cannot instance script as custom resource loader, expected 'ResourceFormatLoader' inheritance, got: " + String(ibt) + ".");
|
ERR_FAIL_COND_V_MSG(obj == nullptr, false, "Cannot instance script as custom resource loader, expected 'ResourceFormatLoader' inheritance, got: " + String(ibt) + ".");
|
||||||
|
|
||||||
|
|
|
@ -210,7 +210,7 @@ bool ResourceSaver::add_custom_resource_format_saver(String script_path) {
|
||||||
bool valid_type = ClassDB::is_parent_class(ibt, "ResourceFormatSaver");
|
bool valid_type = ClassDB::is_parent_class(ibt, "ResourceFormatSaver");
|
||||||
ERR_FAIL_COND_V_MSG(!valid_type, false, "Script does not inherit a CustomResourceSaver: " + script_path + ".");
|
ERR_FAIL_COND_V_MSG(!valid_type, false, "Script does not inherit a CustomResourceSaver: " + script_path + ".");
|
||||||
|
|
||||||
Object *obj = ClassDB::instance(ibt);
|
Object *obj = ClassDB::instantiate(ibt);
|
||||||
|
|
||||||
ERR_FAIL_COND_V_MSG(obj == nullptr, false, "Cannot instance script as custom resource saver, expected 'ResourceFormatSaver' inheritance, got: " + String(ibt) + ".");
|
ERR_FAIL_COND_V_MSG(obj == nullptr, false, "Cannot instance script as custom resource saver, expected 'ResourceFormatSaver' inheritance, got: " + String(ibt) + ".");
|
||||||
|
|
||||||
|
|
|
@ -512,7 +512,7 @@ void StreamPeerBuffer::clear() {
|
||||||
|
|
||||||
Ref<StreamPeerBuffer> StreamPeerBuffer::duplicate() const {
|
Ref<StreamPeerBuffer> StreamPeerBuffer::duplicate() const {
|
||||||
Ref<StreamPeerBuffer> spb;
|
Ref<StreamPeerBuffer> spb;
|
||||||
spb.instance();
|
spb.instantiate();
|
||||||
spb->data = data;
|
spb->data = data;
|
||||||
return spb;
|
return spb;
|
||||||
}
|
}
|
||||||
|
|
|
@ -516,7 +516,7 @@ void ClassDB::instance_get_native_extension_data(ObjectNativeExtension **r_exten
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Object *ClassDB::instance(const StringName &p_class) {
|
Object *ClassDB::instantiate(const StringName &p_class) {
|
||||||
ClassInfo *ti;
|
ClassInfo *ti;
|
||||||
{
|
{
|
||||||
OBJTYPE_RLOCK;
|
OBJTYPE_RLOCK;
|
||||||
|
@ -544,7 +544,7 @@ Object *ClassDB::instance(const StringName &p_class) {
|
||||||
return ti->creation_func();
|
return ti->creation_func();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ClassDB::can_instance(const StringName &p_class) {
|
bool ClassDB::can_instantiate(const StringName &p_class) {
|
||||||
OBJTYPE_RLOCK;
|
OBJTYPE_RLOCK;
|
||||||
|
|
||||||
ClassInfo *ti = classes.getptr(p_class);
|
ClassInfo *ti = classes.getptr(p_class);
|
||||||
|
@ -1522,8 +1522,8 @@ Variant ClassDB::class_get_default_property_value(const StringName &p_class, con
|
||||||
if (Engine::get_singleton()->has_singleton(p_class)) {
|
if (Engine::get_singleton()->has_singleton(p_class)) {
|
||||||
c = Engine::get_singleton()->get_singleton_object(p_class);
|
c = Engine::get_singleton()->get_singleton_object(p_class);
|
||||||
cleanup_c = false;
|
cleanup_c = false;
|
||||||
} else if (ClassDB::can_instance(p_class)) {
|
} else if (ClassDB::can_instantiate(p_class)) {
|
||||||
c = ClassDB::instance(p_class);
|
c = ClassDB::instantiate(p_class);
|
||||||
cleanup_c = true;
|
cleanup_c = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -230,8 +230,8 @@ public:
|
||||||
static StringName get_compatibility_remapped_class(const StringName &p_class);
|
static StringName get_compatibility_remapped_class(const StringName &p_class);
|
||||||
static bool class_exists(const StringName &p_class);
|
static bool class_exists(const StringName &p_class);
|
||||||
static bool is_parent_class(const StringName &p_class, const StringName &p_inherits);
|
static bool is_parent_class(const StringName &p_class, const StringName &p_inherits);
|
||||||
static bool can_instance(const StringName &p_class);
|
static bool can_instantiate(const StringName &p_class);
|
||||||
static Object *instance(const StringName &p_class);
|
static Object *instantiate(const StringName &p_class);
|
||||||
static void instance_get_native_extension_data(ObjectNativeExtension **r_extension, void **r_extension_instance);
|
static void instance_get_native_extension_data(ObjectNativeExtension **r_extension, void **r_extension_instance);
|
||||||
static APIType get_api_type(const StringName &p_class);
|
static APIType get_api_type(const StringName &p_class);
|
||||||
|
|
||||||
|
|
|
@ -871,7 +871,7 @@ void Object::set_script(const Variant &p_script) {
|
||||||
Ref<Script> s = script;
|
Ref<Script> s = script;
|
||||||
|
|
||||||
if (!s.is_null()) {
|
if (!s.is_null()) {
|
||||||
if (s->can_instance()) {
|
if (s->can_instantiate()) {
|
||||||
OBJ_DEBUG_LOCK
|
OBJ_DEBUG_LOCK
|
||||||
script_instance = s->instance_create(this);
|
script_instance = s->instance_create(this);
|
||||||
} else if (Engine::get_singleton()->is_editor_hint()) {
|
} else if (Engine::get_singleton()->is_editor_hint()) {
|
||||||
|
|
|
@ -213,7 +213,7 @@ public:
|
||||||
inline bool is_null() const { return reference == nullptr; }
|
inline bool is_null() const { return reference == nullptr; }
|
||||||
|
|
||||||
void unref() {
|
void unref() {
|
||||||
//TODO this should be moved to mutexes, since this engine does not really
|
// TODO: this should be moved to mutexes, since this engine does not really
|
||||||
// do a lot of referencing on references and stuff
|
// do a lot of referencing on references and stuff
|
||||||
// mutexes will avoid more crashes?
|
// mutexes will avoid more crashes?
|
||||||
|
|
||||||
|
@ -223,7 +223,7 @@ public:
|
||||||
reference = nullptr;
|
reference = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void instance() {
|
void instantiate() {
|
||||||
ref(memnew(T));
|
ref(memnew(T));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ Dictionary Script::_get_script_constant_map() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Script::_bind_methods() {
|
void Script::_bind_methods() {
|
||||||
ClassDB::bind_method(D_METHOD("can_instance"), &Script::can_instance);
|
ClassDB::bind_method(D_METHOD("can_instantiate"), &Script::can_instantiate);
|
||||||
//ClassDB::bind_method(D_METHOD("instance_create","base_object"),&Script::instance_create);
|
//ClassDB::bind_method(D_METHOD("instance_create","base_object"),&Script::instance_create);
|
||||||
ClassDB::bind_method(D_METHOD("instance_has", "base_object"), &Script::instance_has);
|
ClassDB::bind_method(D_METHOD("instance_has", "base_object"), &Script::instance_has);
|
||||||
ClassDB::bind_method(D_METHOD("has_source_code"), &Script::has_source_code);
|
ClassDB::bind_method(D_METHOD("has_source_code"), &Script::has_source_code);
|
||||||
|
|
|
@ -115,7 +115,7 @@ protected:
|
||||||
Dictionary _get_script_constant_map();
|
Dictionary _get_script_constant_map();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual bool can_instance() const = 0;
|
virtual bool can_instantiate() const = 0;
|
||||||
|
|
||||||
virtual Ref<Script> get_base_script() const = 0; //for script inheritance
|
virtual Ref<Script> get_base_script() const = 0; //for script inheritance
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ void MIDIDriver::set_singleton() {
|
||||||
|
|
||||||
void MIDIDriver::receive_input_packet(uint64_t timestamp, uint8_t *data, uint32_t length) {
|
void MIDIDriver::receive_input_packet(uint64_t timestamp, uint8_t *data, uint32_t length) {
|
||||||
Ref<InputEventMIDI> event;
|
Ref<InputEventMIDI> event;
|
||||||
event.instance();
|
event.instantiate();
|
||||||
uint32_t param_position = 1;
|
uint32_t param_position = 1;
|
||||||
|
|
||||||
if (length >= 1) {
|
if (length >= 1) {
|
||||||
|
|
|
@ -113,18 +113,18 @@ void register_core_types() {
|
||||||
|
|
||||||
CoreStringNames::create();
|
CoreStringNames::create();
|
||||||
|
|
||||||
resource_format_po.instance();
|
resource_format_po.instantiate();
|
||||||
ResourceLoader::add_resource_format_loader(resource_format_po);
|
ResourceLoader::add_resource_format_loader(resource_format_po);
|
||||||
|
|
||||||
resource_saver_binary.instance();
|
resource_saver_binary.instantiate();
|
||||||
ResourceSaver::add_resource_format_saver(resource_saver_binary);
|
ResourceSaver::add_resource_format_saver(resource_saver_binary);
|
||||||
resource_loader_binary.instance();
|
resource_loader_binary.instantiate();
|
||||||
ResourceLoader::add_resource_format_loader(resource_loader_binary);
|
ResourceLoader::add_resource_format_loader(resource_loader_binary);
|
||||||
|
|
||||||
resource_format_importer.instance();
|
resource_format_importer.instantiate();
|
||||||
ResourceLoader::add_resource_format_loader(resource_format_importer);
|
ResourceLoader::add_resource_format_loader(resource_format_importer);
|
||||||
|
|
||||||
resource_format_image.instance();
|
resource_format_image.instantiate();
|
||||||
ResourceLoader::add_resource_format_loader(resource_format_image);
|
ResourceLoader::add_resource_format_loader(resource_format_image);
|
||||||
|
|
||||||
ClassDB::register_class<Object>();
|
ClassDB::register_class<Object>();
|
||||||
|
@ -171,9 +171,9 @@ void register_core_types() {
|
||||||
ClassDB::register_custom_instance_class<Crypto>();
|
ClassDB::register_custom_instance_class<Crypto>();
|
||||||
ClassDB::register_custom_instance_class<StreamPeerSSL>();
|
ClassDB::register_custom_instance_class<StreamPeerSSL>();
|
||||||
|
|
||||||
resource_format_saver_crypto.instance();
|
resource_format_saver_crypto.instantiate();
|
||||||
ResourceSaver::add_resource_format_saver(resource_format_saver_crypto);
|
ResourceSaver::add_resource_format_saver(resource_format_saver_crypto);
|
||||||
resource_format_loader_crypto.instance();
|
resource_format_loader_crypto.instantiate();
|
||||||
ResourceLoader::add_resource_format_loader(resource_format_loader_crypto);
|
ResourceLoader::add_resource_format_loader(resource_format_loader_crypto);
|
||||||
|
|
||||||
ClassDB::register_virtual_class<IP>();
|
ClassDB::register_virtual_class<IP>();
|
||||||
|
|
|
@ -188,7 +188,7 @@ void TranslationPO::set_plural_rule(const String &p_plural_rule) {
|
||||||
plural_rule = plural_rule.replacen("(", "");
|
plural_rule = plural_rule.replacen("(", "");
|
||||||
plural_rule = plural_rule.replacen(")", "");
|
plural_rule = plural_rule.replacen(")", "");
|
||||||
_cache_plural_tests(plural_rule);
|
_cache_plural_tests(plural_rule);
|
||||||
expr.instance();
|
expr.instantiate();
|
||||||
input_name.push_back("n");
|
input_name.push_back("n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -738,10 +738,10 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
|
||||||
|
|
||||||
String type = token.value;
|
String type = token.value;
|
||||||
|
|
||||||
Object *obj = ClassDB::instance(type);
|
Object *obj = ClassDB::instantiate(type);
|
||||||
|
|
||||||
if (!obj) {
|
if (!obj) {
|
||||||
r_err_str = "Can't instance Object() of type: " + type;
|
r_err_str = "Can't instantiate Object() of type: " + type;
|
||||||
return ERR_PARSE_ERROR;
|
return ERR_PARSE_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<tutorials>
|
<tutorials>
|
||||||
</tutorials>
|
</tutorials>
|
||||||
<methods>
|
<methods>
|
||||||
<method name="can_instance" qualifiers="const">
|
<method name="can_instantiate" qualifiers="const">
|
||||||
<return type="bool">
|
<return type="bool">
|
||||||
</return>
|
</return>
|
||||||
<argument index="0" name="class" type="StringName">
|
<argument index="0" name="class" type="StringName">
|
||||||
|
@ -187,7 +187,7 @@
|
||||||
Returns the parent class of [code]class[/code].
|
Returns the parent class of [code]class[/code].
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="instance" qualifiers="const">
|
<method name="instantiate" qualifiers="const">
|
||||||
<return type="Variant">
|
<return type="Variant">
|
||||||
</return>
|
</return>
|
||||||
<argument index="0" name="class" type="StringName">
|
<argument index="0" name="class" type="StringName">
|
||||||
|
|
|
@ -201,14 +201,14 @@
|
||||||
[codeblocks]
|
[codeblocks]
|
||||||
[gdscript]
|
[gdscript]
|
||||||
func _make_custom_tooltip(for_text):
|
func _make_custom_tooltip(for_text):
|
||||||
var tooltip = preload("res://SomeTooltipScene.tscn").instance()
|
var tooltip = preload("res://SomeTooltipScene.tscn").instantiate()
|
||||||
tooltip.get_node("Label").text = for_text
|
tooltip.get_node("Label").text = for_text
|
||||||
return tooltip
|
return tooltip
|
||||||
[/gdscript]
|
[/gdscript]
|
||||||
[csharp]
|
[csharp]
|
||||||
public override Godot.Control _MakeCustomTooltip(String forText)
|
public override Godot.Control _MakeCustomTooltip(String forText)
|
||||||
{
|
{
|
||||||
Node tooltip = ResourceLoader.Load<PackedScene>("res://SomeTooltipScene.tscn").Instance();
|
Node tooltip = ResourceLoader.Load<PackedScene>("res://SomeTooltipScene.tscn").Instantiate();
|
||||||
tooltip.GetNode<Label>("Label").Text = forText;
|
tooltip.GetNode<Label>("Label").Text = forText;
|
||||||
return tooltip;
|
return tooltip;
|
||||||
}
|
}
|
||||||
|
@ -1158,7 +1158,7 @@
|
||||||
<member name="rect_scale" type="Vector2" setter="set_scale" getter="get_scale" default="Vector2(1, 1)">
|
<member name="rect_scale" type="Vector2" setter="set_scale" getter="get_scale" default="Vector2(1, 1)">
|
||||||
The node's scale, relative to its [member rect_size]. Change this property to scale the node around its [member rect_pivot_offset]. The Control's [member hint_tooltip] will also scale according to this value.
|
The node's scale, relative to its [member rect_size]. Change this property to scale the node around its [member rect_pivot_offset]. The Control's [member hint_tooltip] will also scale according to this value.
|
||||||
[b]Note:[/b] This property is mainly intended to be used for animation purposes. Text inside the Control will look pixelated or blurry when the Control is scaled. To support multiple resolutions in your project, use an appropriate viewport stretch mode as described in the [url=https://docs.godotengine.org/en/latest/tutorials/viewports/multiple_resolutions.html]documentation[/url] instead of scaling Controls individually.
|
[b]Note:[/b] This property is mainly intended to be used for animation purposes. Text inside the Control will look pixelated or blurry when the Control is scaled. To support multiple resolutions in your project, use an appropriate viewport stretch mode as described in the [url=https://docs.godotengine.org/en/latest/tutorials/viewports/multiple_resolutions.html]documentation[/url] instead of scaling Controls individually.
|
||||||
[b]Note:[/b] If the Control node is a child of a [Container] node, the scale will be reset to [code]Vector2(1, 1)[/code] when the scene is instanced. To set the Control's scale when it's instanced, wait for one frame using [code]yield(get_tree(), "idle_frame")[/code] then set its [member rect_scale] property.
|
[b]Note:[/b] If the Control node is a child of a [Container] node, the scale will be reset to [code]Vector2(1, 1)[/code] when the scene is instantiated. To set the Control's scale when it's instantiated, wait for one frame using [code]yield(get_tree(), "idle_frame")[/code] then set its [member rect_scale] property.
|
||||||
</member>
|
</member>
|
||||||
<member name="rect_size" type="Vector2" setter="_set_size" getter="get_size" default="Vector2(0, 0)">
|
<member name="rect_size" type="Vector2" setter="_set_size" getter="get_size" default="Vector2(0, 0)">
|
||||||
The size of the node's bounding rectangle, in pixels. [Container] nodes update this property automatically.
|
The size of the node's bounding rectangle, in pixels. [Container] nodes update this property automatically.
|
||||||
|
|
|
@ -404,7 +404,7 @@
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
Adds a custom type, which will appear in the list of nodes or resources. An icon can be optionally passed.
|
Adds a custom type, which will appear in the list of nodes or resources. An icon can be optionally passed.
|
||||||
When given node or resource is selected, the base type will be instanced (e.g. "Node3D", "Control", "Resource"), then the script will be loaded and set to this object.
|
When given node or resource is selected, the base type will be instantiated (e.g. "Node3D", "Control", "Resource"), then the script will be loaded and set to this object.
|
||||||
You can use the virtual method [method _handles] to check if your custom object is being edited by checking the script or using the [code]is[/code] keyword.
|
You can use the virtual method [method _handles] to check if your custom object is being edited by checking the script or using the [code]is[/code] keyword.
|
||||||
During run-time, this will be a simple object with a script so this function does not need to be called then.
|
During run-time, this will be a simple object with a script so this function does not need to be called then.
|
||||||
</description>
|
</description>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
Placeholder for the root [Node] of a [PackedScene].
|
Placeholder for the root [Node] of a [PackedScene].
|
||||||
</brief_description>
|
</brief_description>
|
||||||
<description>
|
<description>
|
||||||
Turning on the option [b]Load As Placeholder[/b] for an instanced scene in the editor causes it to be replaced by an [InstancePlaceholder] when running the game. This makes it possible to delay actually loading the scene until calling [method create_instance]. This is useful to avoid loading large scenes all at once by loading parts of it selectively.
|
Turning on the option [b]Load As Placeholder[/b] for an instantiated scene in the editor causes it to be replaced by an [InstancePlaceholder] when running the game. This makes it possible to delay actually loading the scene until calling [method create_instance]. This is useful to avoid loading large scenes all at once by loading parts of it selectively.
|
||||||
The [InstancePlaceholder] does not have a transform. This causes any child nodes to be positioned relatively to the [Viewport] from point (0,0), rather than their parent as displayed in the editor. Replacing the placeholder with a scene with a transform will transform children relatively to their parent again.
|
The [InstancePlaceholder] does not have a transform. This causes any child nodes to be positioned relatively to the [Viewport] from point (0,0), rather than their parent as displayed in the editor. Replacing the placeholder with a scene with a transform will transform children relatively to their parent again.
|
||||||
</description>
|
</description>
|
||||||
<tutorials>
|
<tutorials>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
Provides a base class for different kinds of light nodes.
|
Provides a base class for different kinds of light nodes.
|
||||||
</brief_description>
|
</brief_description>
|
||||||
<description>
|
<description>
|
||||||
Light3D is the [i]abstract[/i] base class for light nodes. As it can't be instanced, it shouldn't be used directly. Other types of light nodes inherit from it. Light3D contains the common variables and parameters used for lighting.
|
Light3D is the [i]abstract[/i] base class for light nodes. As it can't be instantiated, it shouldn't be used directly. Other types of light nodes inherit from it. Light3D contains the common variables and parameters used for lighting.
|
||||||
</description>
|
</description>
|
||||||
<tutorials>
|
<tutorials>
|
||||||
<link title="3D lights and shadows">https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link>
|
<link title="3D lights and shadows">https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
Node that instances meshes into a scenario.
|
Node that instances meshes into a scenario.
|
||||||
</brief_description>
|
</brief_description>
|
||||||
<description>
|
<description>
|
||||||
MeshInstance3D is a node that takes a [Mesh] resource and adds it to the current scenario by creating an instance of it. This is the class most often used render 3D geometry and can be used to instance a single [Mesh] in many places. This allows reuse of geometry which can save on resources. When a [Mesh] has to be instanced more than thousands of times at close proximity, consider using a [MultiMesh] in a [MultiMeshInstance3D] instead.
|
MeshInstance3D is a node that takes a [Mesh] resource and adds it to the current scenario by creating an instance of it. This is the class most often used render 3D geometry and can be used to instance a single [Mesh] in many places. This allows reuse of geometry which can save on resources. When a [Mesh] has to be instantiated more than thousands of times at close proximity, consider using a [MultiMesh] in a [MultiMeshInstance3D] instead.
|
||||||
</description>
|
</description>
|
||||||
<tutorials>
|
<tutorials>
|
||||||
<link title="3D Material Testers Demo">https://godotengine.org/asset-library/asset/123</link>
|
<link title="3D Material Testers Demo">https://godotengine.org/asset-library/asset/123</link>
|
||||||
|
|
|
@ -5,13 +5,13 @@
|
||||||
</brief_description>
|
</brief_description>
|
||||||
<description>
|
<description>
|
||||||
Nodes are Godot's building blocks. They can be assigned as the child of another node, resulting in a tree arrangement. A given node can contain any number of nodes as children with the requirement that all siblings (direct children of a node) should have unique names.
|
Nodes are Godot's building blocks. They can be assigned as the child of another node, resulting in a tree arrangement. A given node can contain any number of nodes as children with the requirement that all siblings (direct children of a node) should have unique names.
|
||||||
A tree of nodes is called a [i]scene[/i]. Scenes can be saved to the disk and then instanced into other scenes. This allows for very high flexibility in the architecture and data model of Godot projects.
|
A tree of nodes is called a [i]scene[/i]. Scenes can be saved to the disk and then instantiated into other scenes. This allows for very high flexibility in the architecture and data model of Godot projects.
|
||||||
[b]Scene tree:[/b] The [SceneTree] contains the active tree of nodes. When a node is added to the scene tree, it receives the [constant NOTIFICATION_ENTER_TREE] notification and its [method _enter_tree] callback is triggered. Child nodes are always added [i]after[/i] their parent node, i.e. the [method _enter_tree] callback of a parent node will be triggered before its child's.
|
[b]Scene tree:[/b] The [SceneTree] contains the active tree of nodes. When a node is added to the scene tree, it receives the [constant NOTIFICATION_ENTER_TREE] notification and its [method _enter_tree] callback is triggered. Child nodes are always added [i]after[/i] their parent node, i.e. the [method _enter_tree] callback of a parent node will be triggered before its child's.
|
||||||
Once all nodes have been added in the scene tree, they receive the [constant NOTIFICATION_READY] notification and their respective [method _ready] callbacks are triggered. For groups of nodes, the [method _ready] callback is called in reverse order, starting with the children and moving up to the parent nodes.
|
Once all nodes have been added in the scene tree, they receive the [constant NOTIFICATION_READY] notification and their respective [method _ready] callbacks are triggered. For groups of nodes, the [method _ready] callback is called in reverse order, starting with the children and moving up to the parent nodes.
|
||||||
This means that when adding a node to the scene tree, the following order will be used for the callbacks: [method _enter_tree] of the parent, [method _enter_tree] of the children, [method _ready] of the children and finally [method _ready] of the parent (recursively for the entire scene tree).
|
This means that when adding a node to the scene tree, the following order will be used for the callbacks: [method _enter_tree] of the parent, [method _enter_tree] of the children, [method _ready] of the children and finally [method _ready] of the parent (recursively for the entire scene tree).
|
||||||
[b]Processing:[/b] Nodes can override the "process" state, so that they receive a callback on each frame requesting them to process (do something). Normal processing (callback [method _process], toggled with [method set_process]) happens as fast as possible and is dependent on the frame rate, so the processing time [i]delta[/i] (in seconds) is passed as an argument. Physics processing (callback [method _physics_process], toggled with [method set_physics_process]) happens a fixed number of times per second (60 by default) and is useful for code related to the physics engine.
|
[b]Processing:[/b] Nodes can override the "process" state, so that they receive a callback on each frame requesting them to process (do something). Normal processing (callback [method _process], toggled with [method set_process]) happens as fast as possible and is dependent on the frame rate, so the processing time [i]delta[/i] (in seconds) is passed as an argument. Physics processing (callback [method _physics_process], toggled with [method set_physics_process]) happens a fixed number of times per second (60 by default) and is useful for code related to the physics engine.
|
||||||
Nodes can also process input events. When present, the [method _input] function will be called for each input that the program receives. In many cases, this can be overkill (unless used for simple projects), and the [method _unhandled_input] function might be preferred; it is called when the input event was not handled by anyone else (typically, GUI [Control] nodes), ensuring that the node only receives the events that were meant for it.
|
Nodes can also process input events. When present, the [method _input] function will be called for each input that the program receives. In many cases, this can be overkill (unless used for simple projects), and the [method _unhandled_input] function might be preferred; it is called when the input event was not handled by anyone else (typically, GUI [Control] nodes), ensuring that the node only receives the events that were meant for it.
|
||||||
To keep track of the scene hierarchy (especially when instancing scenes into other scenes), an "owner" can be set for the node with the [member owner] property. This keeps track of who instanced what. This is mostly useful when writing editors and tools, though.
|
To keep track of the scene hierarchy (especially when instancing scenes into other scenes), an "owner" can be set for the node with the [member owner] property. This keeps track of who instantiated what. This is mostly useful when writing editors and tools, though.
|
||||||
Finally, when a node is freed with [method Object.free] or [method queue_free], it will also free all its children.
|
Finally, when a node is freed with [method Object.free] or [method queue_free], it will also free all its children.
|
||||||
[b]Groups:[/b] Nodes can be added to as many groups as you want to be easy to manage, you could create groups like "enemies" or "collectables" for example, depending on your game. See [method add_to_group], [method is_in_group] and [method remove_from_group]. You can then retrieve all nodes in these groups, iterate them and even call methods on groups via the methods on [SceneTree].
|
[b]Groups:[/b] Nodes can be added to as many groups as you want to be easy to manage, you could create groups like "enemies" or "collectables" for example, depending on your game. See [method add_to_group], [method is_in_group] and [method remove_from_group]. You can then retrieve all nodes in these groups, iterate them and even call methods on groups via the methods on [SceneTree].
|
||||||
[b]Networking with nodes:[/b] After connecting to a server (or making one, see [NetworkedMultiplayerENet]), it is possible to use the built-in RPC (remote procedure call) system to communicate over the network. By calling [method rpc] with a method name, it will be called locally and in all connected peers (peers = clients and the server that accepts connections). To identify which node receives the RPC call, Godot will use its [NodePath] (make sure node names are the same on all peers). Also, take a look at the high-level networking tutorial and corresponding demos.
|
[b]Networking with nodes:[/b] After connecting to a server (or making one, see [NetworkedMultiplayerENet]), it is possible to use the built-in RPC (remote procedure call) system to communicate over the network. By calling [method rpc] with a method name, it will be called locally and in all connected peers (peers = clients and the server that accepts connections). To identify which node receives the RPC call, Godot will use its [NodePath] (make sure node names are the same on all peers). Also, take a look at the high-level networking tutorial and corresponding demos.
|
||||||
|
@ -128,7 +128,7 @@
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
Adds a child node. Nodes can have any number of children, but every child must have a unique name. Child nodes are automatically deleted when the parent node is deleted, so an entire scene can be removed by deleting its topmost node.
|
Adds a child node. Nodes can have any number of children, but every child must have a unique name. Child nodes are automatically deleted when the parent node is deleted, so an entire scene can be removed by deleting its topmost node.
|
||||||
If [code]legible_unique_name[/code] is [code]true[/code], the child node will have a human-readable name based on the name of the node being instanced instead of its type.
|
If [code]legible_unique_name[/code] is [code]true[/code], the child node will have a human-readable name based on the name of the node being instantiated instead of its type.
|
||||||
[b]Note:[/b] If the child node already has a parent, the function will fail. Use [method remove_child] first to remove the node from its current parent. For example:
|
[b]Note:[/b] If the child node already has a parent, the function will fail. Use [method remove_child] first to remove the node from its current parent. For example:
|
||||||
[codeblocks]
|
[codeblocks]
|
||||||
[gdscript]
|
[gdscript]
|
||||||
|
@ -159,7 +159,7 @@
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
Adds a [code]sibling[/code] node to current's node parent, at the same level as that node, right below it.
|
Adds a [code]sibling[/code] node to current's node parent, at the same level as that node, right below it.
|
||||||
If [code]legible_unique_name[/code] is [code]true[/code], the child node will have a human-readable name based on the name of the node being instanced instead of its type.
|
If [code]legible_unique_name[/code] is [code]true[/code], the child node will have a human-readable name based on the name of the node being instantiated instead of its type.
|
||||||
Use [method add_child] instead of this method if you don't need the child node to be added below a specific node in the list of children.
|
Use [method add_child] instead of this method if you don't need the child node to be added below a specific node in the list of children.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
|
@ -805,7 +805,7 @@
|
||||||
The override to the default [MultiplayerAPI]. Set to [code]null[/code] to use the default [SceneTree] one.
|
The override to the default [MultiplayerAPI]. Set to [code]null[/code] to use the default [SceneTree] one.
|
||||||
</member>
|
</member>
|
||||||
<member name="filename" type="String" setter="set_filename" getter="get_filename">
|
<member name="filename" type="String" setter="set_filename" getter="get_filename">
|
||||||
When a scene is instanced from a file, its topmost node contains the filename from which it was loaded.
|
When a scene is instantiated from a file, its topmost node contains the filename from which it was loaded.
|
||||||
</member>
|
</member>
|
||||||
<member name="multiplayer" type="MultiplayerAPI" setter="" getter="get_multiplayer">
|
<member name="multiplayer" type="MultiplayerAPI" setter="" getter="get_multiplayer">
|
||||||
The [MultiplayerAPI] instance associated with this node. Either the [member custom_multiplayer], or the default SceneTree one (if inside tree).
|
The [MultiplayerAPI] instance associated with this node. Either the [member custom_multiplayer], or the default SceneTree one (if inside tree).
|
||||||
|
@ -884,7 +884,7 @@
|
||||||
Notification received when a node is unparented (parent removed it from the list of children).
|
Notification received when a node is unparented (parent removed it from the list of children).
|
||||||
</constant>
|
</constant>
|
||||||
<constant name="NOTIFICATION_INSTANCED" value="20">
|
<constant name="NOTIFICATION_INSTANCED" value="20">
|
||||||
Notification received when the node is instanced.
|
Notification received when the node is instantiated.
|
||||||
</constant>
|
</constant>
|
||||||
<constant name="NOTIFICATION_DRAG_BEGIN" value="21">
|
<constant name="NOTIFICATION_DRAG_BEGIN" value="21">
|
||||||
Notification received when a drag begins.
|
Notification received when a drag begins.
|
||||||
|
|
|
@ -11,13 +11,13 @@
|
||||||
[codeblocks]
|
[codeblocks]
|
||||||
[gdscript]
|
[gdscript]
|
||||||
# Use load() instead of preload() if the path isn't known at compile-time.
|
# Use load() instead of preload() if the path isn't known at compile-time.
|
||||||
var scene = preload("res://scene.tscn").instance()
|
var scene = preload("res://scene.tscn").instantiate()
|
||||||
# Add the node as a child of the node the script is attached to.
|
# Add the node as a child of the node the script is attached to.
|
||||||
add_child(scene)
|
add_child(scene)
|
||||||
[/gdscript]
|
[/gdscript]
|
||||||
[csharp]
|
[csharp]
|
||||||
// C# has no preload, so you have to always use ResourceLoader.Load<PackedScene>().
|
// C# has no preload, so you have to always use ResourceLoader.Load<PackedScene>().
|
||||||
var scene = ResourceLoader.Load<PackedScene>("res://scene.tscn").Instance();
|
var scene = ResourceLoader.Load<PackedScene>("res://scene.tscn").Instantiate();
|
||||||
// Add the node as a child of the node the script is attached to.
|
// Add the node as a child of the node the script is attached to.
|
||||||
AddChild(scene);
|
AddChild(scene);
|
||||||
[/csharp]
|
[/csharp]
|
||||||
|
@ -76,7 +76,7 @@
|
||||||
<link title="2D Role Playing Game Demo">https://godotengine.org/asset-library/asset/520</link>
|
<link title="2D Role Playing Game Demo">https://godotengine.org/asset-library/asset/520</link>
|
||||||
</tutorials>
|
</tutorials>
|
||||||
<methods>
|
<methods>
|
||||||
<method name="can_instance" qualifiers="const">
|
<method name="can_instantiate" qualifiers="const">
|
||||||
<return type="bool">
|
<return type="bool">
|
||||||
</return>
|
</return>
|
||||||
<description>
|
<description>
|
||||||
|
@ -90,7 +90,7 @@
|
||||||
Returns the [code]SceneState[/code] representing the scene file contents.
|
Returns the [code]SceneState[/code] representing the scene file contents.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="instance" qualifiers="const">
|
<method name="instantiate" qualifiers="const">
|
||||||
<return type="Node">
|
<return type="Node">
|
||||||
</return>
|
</return>
|
||||||
<argument index="0" name="edit_state" type="int" enum="PackedScene.GenEditState" default="0">
|
<argument index="0" name="edit_state" type="int" enum="PackedScene.GenEditState" default="0">
|
||||||
|
@ -117,14 +117,14 @@
|
||||||
</members>
|
</members>
|
||||||
<constants>
|
<constants>
|
||||||
<constant name="GEN_EDIT_STATE_DISABLED" value="0" enum="GenEditState">
|
<constant name="GEN_EDIT_STATE_DISABLED" value="0" enum="GenEditState">
|
||||||
If passed to [method instance], blocks edits to the scene state.
|
If passed to [method instantiate], blocks edits to the scene state.
|
||||||
</constant>
|
</constant>
|
||||||
<constant name="GEN_EDIT_STATE_INSTANCE" value="1" enum="GenEditState">
|
<constant name="GEN_EDIT_STATE_INSTANCE" value="1" enum="GenEditState">
|
||||||
If passed to [method instance], provides local scene resources to the local scene.
|
If passed to [method instantiate], provides local scene resources to the local scene.
|
||||||
[b]Note:[/b] Only available in editor builds.
|
[b]Note:[/b] Only available in editor builds.
|
||||||
</constant>
|
</constant>
|
||||||
<constant name="GEN_EDIT_STATE_MAIN" value="2" enum="GenEditState">
|
<constant name="GEN_EDIT_STATE_MAIN" value="2" enum="GenEditState">
|
||||||
If passed to [method instance], provides local scene resources to the local scene. Only the main scene should receive the main edit state.
|
If passed to [method instantiate], provides local scene resources to the local scene. Only the main scene should receive the main edit state.
|
||||||
[b]Note:[/b] Only available in editor builds.
|
[b]Note:[/b] Only available in editor builds.
|
||||||
</constant>
|
</constant>
|
||||||
</constants>
|
</constants>
|
||||||
|
|
|
@ -157,13 +157,13 @@
|
||||||
Largest amount of memory the message queue buffer has used, in bytes. The message queue is used for deferred functions calls and notifications.
|
Largest amount of memory the message queue buffer has used, in bytes. The message queue is used for deferred functions calls and notifications.
|
||||||
</constant>
|
</constant>
|
||||||
<constant name="OBJECT_COUNT" value="6" enum="Monitor">
|
<constant name="OBJECT_COUNT" value="6" enum="Monitor">
|
||||||
Number of objects currently instanced (including nodes).
|
Number of objects currently instantiated (including nodes).
|
||||||
</constant>
|
</constant>
|
||||||
<constant name="OBJECT_RESOURCE_COUNT" value="7" enum="Monitor">
|
<constant name="OBJECT_RESOURCE_COUNT" value="7" enum="Monitor">
|
||||||
Number of resources currently used.
|
Number of resources currently used.
|
||||||
</constant>
|
</constant>
|
||||||
<constant name="OBJECT_NODE_COUNT" value="8" enum="Monitor">
|
<constant name="OBJECT_NODE_COUNT" value="8" enum="Monitor">
|
||||||
Number of nodes currently instanced in the scene tree. This also includes the root node.
|
Number of nodes currently instantiated in the scene tree. This also includes the root node.
|
||||||
</constant>
|
</constant>
|
||||||
<constant name="OBJECT_ORPHAN_NODE_COUNT" value="9" enum="Monitor">
|
<constant name="OBJECT_ORPHAN_NODE_COUNT" value="9" enum="Monitor">
|
||||||
Number of orphan nodes, i.e. nodes which are not parented to a node of the scene tree.
|
Number of orphan nodes, i.e. nodes which are not parented to a node of the scene tree.
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
Base class for all resources.
|
Base class for all resources.
|
||||||
</brief_description>
|
</brief_description>
|
||||||
<description>
|
<description>
|
||||||
Resource is the base class for all Godot-specific resource types, serving primarily as data containers. Since they inherit from [RefCounted], resources are reference-counted and freed when no longer in use. They are also cached once loaded from disk, so that any further attempts to load a resource from a given path will return the same reference (all this in contrast to a [Node], which is not reference-counted and can be instanced from disk as many times as desired). Resources can be saved externally on disk or bundled into another object, such as a [Node] or another resource.
|
Resource is the base class for all Godot-specific resource types, serving primarily as data containers. Since they inherit from [RefCounted], resources are reference-counted and freed when no longer in use. They are also cached once loaded from disk, so that any further attempts to load a resource from a given path will return the same reference (all this in contrast to a [Node], which is not reference-counted and can be instantiated from disk as many times as desired). Resources can be saved externally on disk or bundled into another object, such as a [Node] or another resource.
|
||||||
[b]Note:[/b] In C#, resources will not be freed instantly after they are no longer in use. Instead, garbage collection will run periodically and will free resources that are no longer in use. This means that unused resources will linger on for a while before being removed.
|
[b]Note:[/b] In C#, resources will not be freed instantly after they are no longer in use. Instead, garbage collection will run periodically and will free resources that are no longer in use. This means that unused resources will linger on for a while before being removed.
|
||||||
</description>
|
</description>
|
||||||
<tutorials>
|
<tutorials>
|
||||||
|
|
|
@ -95,7 +95,7 @@
|
||||||
<argument index="0" name="idx" type="int">
|
<argument index="0" name="idx" type="int">
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
Returns the node's index, which is its position relative to its siblings. This is only relevant and saved in scenes for cases where new nodes are added to an instanced or inherited scene among siblings from the base scene. Despite the name, this index is not related to the [code]idx[/code] argument used here and in other methods.
|
Returns the node's index, which is its position relative to its siblings. This is only relevant and saved in scenes for cases where new nodes are added to an instantiated or inherited scene among siblings from the base scene. Despite the name, this index is not related to the [code]idx[/code] argument used here and in other methods.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="get_node_instance" qualifiers="const">
|
<method name="get_node_instance" qualifiers="const">
|
||||||
|
@ -199,14 +199,14 @@
|
||||||
</methods>
|
</methods>
|
||||||
<constants>
|
<constants>
|
||||||
<constant name="GEN_EDIT_STATE_DISABLED" value="0" enum="GenEditState">
|
<constant name="GEN_EDIT_STATE_DISABLED" value="0" enum="GenEditState">
|
||||||
If passed to [method PackedScene.instance], blocks edits to the scene state.
|
If passed to [method PackedScene.instantiate], blocks edits to the scene state.
|
||||||
</constant>
|
</constant>
|
||||||
<constant name="GEN_EDIT_STATE_INSTANCE" value="1" enum="GenEditState">
|
<constant name="GEN_EDIT_STATE_INSTANCE" value="1" enum="GenEditState">
|
||||||
If passed to [method PackedScene.instance], provides inherited scene resources to the local scene.
|
If passed to [method PackedScene.instantiate], provides inherited scene resources to the local scene.
|
||||||
[b]Note:[/b] Only available in editor builds.
|
[b]Note:[/b] Only available in editor builds.
|
||||||
</constant>
|
</constant>
|
||||||
<constant name="GEN_EDIT_STATE_MAIN" value="2" enum="GenEditState">
|
<constant name="GEN_EDIT_STATE_MAIN" value="2" enum="GenEditState">
|
||||||
If passed to [method PackedScene.instance], provides local scene resources to the local scene. Only the main scene should receive the main edit state.
|
If passed to [method PackedScene.instantiate], provides local scene resources to the local scene. Only the main scene should receive the main edit state.
|
||||||
[b]Note:[/b] Only available in editor builds.
|
[b]Note:[/b] Only available in editor builds.
|
||||||
</constant>
|
</constant>
|
||||||
</constants>
|
</constants>
|
||||||
|
|
|
@ -11,11 +11,11 @@
|
||||||
<link title="Scripting">https://docs.godotengine.org/en/latest/getting_started/step_by_step/scripting.html</link>
|
<link title="Scripting">https://docs.godotengine.org/en/latest/getting_started/step_by_step/scripting.html</link>
|
||||||
</tutorials>
|
</tutorials>
|
||||||
<methods>
|
<methods>
|
||||||
<method name="can_instance" qualifiers="const">
|
<method name="can_instantiate" qualifiers="const">
|
||||||
<return type="bool">
|
<return type="bool">
|
||||||
</return>
|
</return>
|
||||||
<description>
|
<description>
|
||||||
Returns [code]true[/code] if the script can be instanced.
|
Returns [code]true[/code] if the script can be instantiated.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="get_base_script" qualifiers="const">
|
<method name="get_base_script" qualifiers="const">
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
</brief_description>
|
</brief_description>
|
||||||
<description>
|
<description>
|
||||||
The [WorldEnvironment] node is used to configure the default [Environment] for the scene.
|
The [WorldEnvironment] node is used to configure the default [Environment] for the scene.
|
||||||
The parameters defined in the [WorldEnvironment] can be overridden by an [Environment] node set on the current [Camera3D]. Additionally, only one [WorldEnvironment] may be instanced in a given scene at a time.
|
The parameters defined in the [WorldEnvironment] can be overridden by an [Environment] node set on the current [Camera3D]. Additionally, only one [WorldEnvironment] may be instantiated in a given scene at a time.
|
||||||
The [WorldEnvironment] allows the user to specify default lighting parameters (e.g. ambient lighting), various post-processing effects (e.g. SSAO, DOF, Tonemapping), and how to draw the background (e.g. solid color, skybox). Usually, these are added in order to improve the realism/color balance of the scene.
|
The [WorldEnvironment] allows the user to specify default lighting parameters (e.g. ambient lighting), various post-processing effects (e.g. SSAO, DOF, Tonemapping), and how to draw the background (e.g. solid color, skybox). Usually, these are added in order to improve the realism/color balance of the scene.
|
||||||
</description>
|
</description>
|
||||||
<tutorials>
|
<tutorials>
|
||||||
|
|
|
@ -701,7 +701,7 @@ msgid ""
|
||||||
"the FileSystem dock into the script.\n"
|
"the FileSystem dock into the script.\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Instance a scene.\n"
|
"# Instance a scene.\n"
|
||||||
"var diamond = preload(\"res://diamond.tscn\").instance()\n"
|
"var diamond = preload(\"res://diamond.tscn\").instantiate()\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -13825,7 +13825,7 @@ msgid ""
|
||||||
"Example of usage with custom scene instance:\n"
|
"Example of usage with custom scene instance:\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"func _make_custom_tooltip(for_text):\n"
|
"func _make_custom_tooltip(for_text):\n"
|
||||||
" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n"
|
" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n"
|
||||||
" tooltip.get_node(\"Label\").text = for_text\n"
|
" tooltip.get_node(\"Label\").text = for_text\n"
|
||||||
" return tooltip\n"
|
" return tooltip\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
|
@ -34691,7 +34691,7 @@ msgid ""
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
||||||
"time.\n"
|
"time.\n"
|
||||||
"var scene = preload(\"res://scene.tscn\").instance()\n"
|
"var scene = preload(\"res://scene.tscn\").instantiate()\n"
|
||||||
"# Add the node as a child of the node the script is attached to.\n"
|
"# Add the node as a child of the node the script is attached to.\n"
|
||||||
"add_child(scene)\n"
|
"add_child(scene)\n"
|
||||||
"[/codeblock]\n"
|
"[/codeblock]\n"
|
||||||
|
|
|
@ -732,7 +732,7 @@ msgid ""
|
||||||
"the FileSystem dock into the script.\n"
|
"the FileSystem dock into the script.\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Instance a scene.\n"
|
"# Instance a scene.\n"
|
||||||
"var diamond = preload(\"res://diamond.tscn\").instance()\n"
|
"var diamond = preload(\"res://diamond.tscn\").instantiate()\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -13856,7 +13856,7 @@ msgid ""
|
||||||
"Example of usage with custom scene instance:\n"
|
"Example of usage with custom scene instance:\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"func _make_custom_tooltip(for_text):\n"
|
"func _make_custom_tooltip(for_text):\n"
|
||||||
" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n"
|
" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n"
|
||||||
" tooltip.get_node(\"Label\").text = for_text\n"
|
" tooltip.get_node(\"Label\").text = for_text\n"
|
||||||
" return tooltip\n"
|
" return tooltip\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
|
@ -34722,7 +34722,7 @@ msgid ""
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
||||||
"time.\n"
|
"time.\n"
|
||||||
"var scene = preload(\"res://scene.tscn\").instance()\n"
|
"var scene = preload(\"res://scene.tscn\").instantiate()\n"
|
||||||
"# Add the node as a child of the node the script is attached to.\n"
|
"# Add the node as a child of the node the script is attached to.\n"
|
||||||
"add_child(scene)\n"
|
"add_child(scene)\n"
|
||||||
"[/codeblock]\n"
|
"[/codeblock]\n"
|
||||||
|
|
|
@ -702,7 +702,7 @@ msgid ""
|
||||||
"the FileSystem dock into the script.\n"
|
"the FileSystem dock into the script.\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Instance a scene.\n"
|
"# Instance a scene.\n"
|
||||||
"var diamond = preload(\"res://diamond.tscn\").instance()\n"
|
"var diamond = preload(\"res://diamond.tscn\").instantiate()\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -13826,7 +13826,7 @@ msgid ""
|
||||||
"Example of usage with custom scene instance:\n"
|
"Example of usage with custom scene instance:\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"func _make_custom_tooltip(for_text):\n"
|
"func _make_custom_tooltip(for_text):\n"
|
||||||
" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n"
|
" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n"
|
||||||
" tooltip.get_node(\"Label\").text = for_text\n"
|
" tooltip.get_node(\"Label\").text = for_text\n"
|
||||||
" return tooltip\n"
|
" return tooltip\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
|
@ -34692,7 +34692,7 @@ msgid ""
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
||||||
"time.\n"
|
"time.\n"
|
||||||
"var scene = preload(\"res://scene.tscn\").instance()\n"
|
"var scene = preload(\"res://scene.tscn\").instantiate()\n"
|
||||||
"# Add the node as a child of the node the script is attached to.\n"
|
"# Add the node as a child of the node the script is attached to.\n"
|
||||||
"add_child(scene)\n"
|
"add_child(scene)\n"
|
||||||
"[/codeblock]\n"
|
"[/codeblock]\n"
|
||||||
|
|
|
@ -1058,7 +1058,7 @@ msgid ""
|
||||||
"the FileSystem dock into the script.\n"
|
"the FileSystem dock into the script.\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Instance a scene.\n"
|
"# Instance a scene.\n"
|
||||||
"var diamond = preload(\"res://diamond.tscn\").instance()\n"
|
"var diamond = preload(\"res://diamond.tscn\").instantiate()\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -14318,7 +14318,7 @@ msgid ""
|
||||||
"Example of usage with custom scene instance:\n"
|
"Example of usage with custom scene instance:\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"func _make_custom_tooltip(for_text):\n"
|
"func _make_custom_tooltip(for_text):\n"
|
||||||
" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n"
|
" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n"
|
||||||
" tooltip.get_node(\"Label\").text = for_text\n"
|
" tooltip.get_node(\"Label\").text = for_text\n"
|
||||||
" return tooltip\n"
|
" return tooltip\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
|
@ -35192,7 +35192,7 @@ msgid ""
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
||||||
"time.\n"
|
"time.\n"
|
||||||
"var scene = preload(\"res://scene.tscn\").instance()\n"
|
"var scene = preload(\"res://scene.tscn\").instantiate()\n"
|
||||||
"# Add the node as a child of the node the script is attached to.\n"
|
"# Add the node as a child of the node the script is attached to.\n"
|
||||||
"add_child(scene)\n"
|
"add_child(scene)\n"
|
||||||
"[/codeblock]\n"
|
"[/codeblock]\n"
|
||||||
|
|
|
@ -992,7 +992,7 @@ msgid ""
|
||||||
"the FileSystem dock into the script.\n"
|
"the FileSystem dock into the script.\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Instance a scene.\n"
|
"# Instance a scene.\n"
|
||||||
"var diamond = preload(\"res://diamond.tscn\").instance()\n"
|
"var diamond = preload(\"res://diamond.tscn\").instantiate()\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -14154,7 +14154,7 @@ msgid ""
|
||||||
"Example of usage with custom scene instance:\n"
|
"Example of usage with custom scene instance:\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"func _make_custom_tooltip(for_text):\n"
|
"func _make_custom_tooltip(for_text):\n"
|
||||||
" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n"
|
" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n"
|
||||||
" tooltip.get_node(\"Label\").text = for_text\n"
|
" tooltip.get_node(\"Label\").text = for_text\n"
|
||||||
" return tooltip\n"
|
" return tooltip\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
|
@ -35118,7 +35118,7 @@ msgid ""
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
||||||
"time.\n"
|
"time.\n"
|
||||||
"var scene = preload(\"res://scene.tscn\").instance()\n"
|
"var scene = preload(\"res://scene.tscn\").instantiate()\n"
|
||||||
"# Add the node as a child of the node the script is attached to.\n"
|
"# Add the node as a child of the node the script is attached to.\n"
|
||||||
"add_child(scene)\n"
|
"add_child(scene)\n"
|
||||||
"[/codeblock]\n"
|
"[/codeblock]\n"
|
||||||
|
|
|
@ -1119,7 +1119,7 @@ msgid ""
|
||||||
"the FileSystem dock into the script.\n"
|
"the FileSystem dock into the script.\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Instance a scene.\n"
|
"# Instance a scene.\n"
|
||||||
"var diamond = preload(\"res://diamond.tscn\").instance()\n"
|
"var diamond = preload(\"res://diamond.tscn\").instantiate()\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -18123,7 +18123,7 @@ msgid ""
|
||||||
"Example of usage with custom scene instance:\n"
|
"Example of usage with custom scene instance:\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"func _make_custom_tooltip(for_text):\n"
|
"func _make_custom_tooltip(for_text):\n"
|
||||||
" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n"
|
" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n"
|
||||||
" tooltip.get_node(\"Label\").text = for_text\n"
|
" tooltip.get_node(\"Label\").text = for_text\n"
|
||||||
" return tooltip\n"
|
" return tooltip\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
|
@ -18150,7 +18150,7 @@ msgstr ""
|
||||||
"Ejemplo de uso con una instancia de una escena personalizada<\n"
|
"Ejemplo de uso con una instancia de una escena personalizada<\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"func _make_custom_tooltip(for_text):\n"
|
"func _make_custom_tooltip(for_text):\n"
|
||||||
" var sugerencia = preload(\"algunaEscenaSugerencia.tscn\").instance()\n"
|
" var sugerencia = preload(\"algunaEscenaSugerencia.tscn\").instantiate()\n"
|
||||||
" tooltip.get_node(\"etiqueta\").text = para_texto\n"
|
" tooltip.get_node(\"etiqueta\").text = para_texto\n"
|
||||||
" return sugerencia\n"
|
" return sugerencia\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
|
@ -46659,7 +46659,7 @@ msgid ""
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
||||||
"time.\n"
|
"time.\n"
|
||||||
"var scene = preload(\"res://scene.tscn\").instance()\n"
|
"var scene = preload(\"res://scene.tscn\").instantiate()\n"
|
||||||
"# Add the node as a child of the node the script is attached to.\n"
|
"# Add the node as a child of the node the script is attached to.\n"
|
||||||
"add_child(scene)\n"
|
"add_child(scene)\n"
|
||||||
"[/codeblock]\n"
|
"[/codeblock]\n"
|
||||||
|
|
|
@ -707,7 +707,7 @@ msgid ""
|
||||||
"the FileSystem dock into the script.\n"
|
"the FileSystem dock into the script.\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Instance a scene.\n"
|
"# Instance a scene.\n"
|
||||||
"var diamond = preload(\"res://diamond.tscn\").instance()\n"
|
"var diamond = preload(\"res://diamond.tscn\").instantiate()\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -13831,7 +13831,7 @@ msgid ""
|
||||||
"Example of usage with custom scene instance:\n"
|
"Example of usage with custom scene instance:\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"func _make_custom_tooltip(for_text):\n"
|
"func _make_custom_tooltip(for_text):\n"
|
||||||
" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n"
|
" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n"
|
||||||
" tooltip.get_node(\"Label\").text = for_text\n"
|
" tooltip.get_node(\"Label\").text = for_text\n"
|
||||||
" return tooltip\n"
|
" return tooltip\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
|
@ -34697,7 +34697,7 @@ msgid ""
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
||||||
"time.\n"
|
"time.\n"
|
||||||
"var scene = preload(\"res://scene.tscn\").instance()\n"
|
"var scene = preload(\"res://scene.tscn\").instantiate()\n"
|
||||||
"# Add the node as a child of the node the script is attached to.\n"
|
"# Add the node as a child of the node the script is attached to.\n"
|
||||||
"add_child(scene)\n"
|
"add_child(scene)\n"
|
||||||
"[/codeblock]\n"
|
"[/codeblock]\n"
|
||||||
|
|
|
@ -720,7 +720,7 @@ msgid ""
|
||||||
"the FileSystem dock into the script.\n"
|
"the FileSystem dock into the script.\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Instance a scene.\n"
|
"# Instance a scene.\n"
|
||||||
"var diamond = preload(\"res://diamond.tscn\").instance()\n"
|
"var diamond = preload(\"res://diamond.tscn\").instantiate()\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -13844,7 +13844,7 @@ msgid ""
|
||||||
"Example of usage with custom scene instance:\n"
|
"Example of usage with custom scene instance:\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"func _make_custom_tooltip(for_text):\n"
|
"func _make_custom_tooltip(for_text):\n"
|
||||||
" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n"
|
" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n"
|
||||||
" tooltip.get_node(\"Label\").text = for_text\n"
|
" tooltip.get_node(\"Label\").text = for_text\n"
|
||||||
" return tooltip\n"
|
" return tooltip\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
|
@ -34710,7 +34710,7 @@ msgid ""
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
||||||
"time.\n"
|
"time.\n"
|
||||||
"var scene = preload(\"res://scene.tscn\").instance()\n"
|
"var scene = preload(\"res://scene.tscn\").instantiate()\n"
|
||||||
"# Add the node as a child of the node the script is attached to.\n"
|
"# Add the node as a child of the node the script is attached to.\n"
|
||||||
"add_child(scene)\n"
|
"add_child(scene)\n"
|
||||||
"[/codeblock]\n"
|
"[/codeblock]\n"
|
||||||
|
|
|
@ -1017,7 +1017,7 @@ msgid ""
|
||||||
"the FileSystem dock into the script.\n"
|
"the FileSystem dock into the script.\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Instance a scene.\n"
|
"# Instance a scene.\n"
|
||||||
"var diamond = preload(\"res://diamond.tscn\").instance()\n"
|
"var diamond = preload(\"res://diamond.tscn\").instantiate()\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -14162,7 +14162,7 @@ msgid ""
|
||||||
"Example of usage with custom scene instance:\n"
|
"Example of usage with custom scene instance:\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"func _make_custom_tooltip(for_text):\n"
|
"func _make_custom_tooltip(for_text):\n"
|
||||||
" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n"
|
" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n"
|
||||||
" tooltip.get_node(\"Label\").text = for_text\n"
|
" tooltip.get_node(\"Label\").text = for_text\n"
|
||||||
" return tooltip\n"
|
" return tooltip\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
|
@ -35061,7 +35061,7 @@ msgid ""
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
||||||
"time.\n"
|
"time.\n"
|
||||||
"var scene = preload(\"res://scene.tscn\").instance()\n"
|
"var scene = preload(\"res://scene.tscn\").instantiate()\n"
|
||||||
"# Add the node as a child of the node the script is attached to.\n"
|
"# Add the node as a child of the node the script is attached to.\n"
|
||||||
"add_child(scene)\n"
|
"add_child(scene)\n"
|
||||||
"[/codeblock]\n"
|
"[/codeblock]\n"
|
||||||
|
|
|
@ -733,7 +733,7 @@ msgid ""
|
||||||
"the FileSystem dock into the script.\n"
|
"the FileSystem dock into the script.\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Instance a scene.\n"
|
"# Instance a scene.\n"
|
||||||
"var diamond = preload(\"res://diamond.tscn\").instance()\n"
|
"var diamond = preload(\"res://diamond.tscn\").instantiate()\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -13857,7 +13857,7 @@ msgid ""
|
||||||
"Example of usage with custom scene instance:\n"
|
"Example of usage with custom scene instance:\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"func _make_custom_tooltip(for_text):\n"
|
"func _make_custom_tooltip(for_text):\n"
|
||||||
" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n"
|
" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n"
|
||||||
" tooltip.get_node(\"Label\").text = for_text\n"
|
" tooltip.get_node(\"Label\").text = for_text\n"
|
||||||
" return tooltip\n"
|
" return tooltip\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
|
@ -34723,7 +34723,7 @@ msgid ""
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
||||||
"time.\n"
|
"time.\n"
|
||||||
"var scene = preload(\"res://scene.tscn\").instance()\n"
|
"var scene = preload(\"res://scene.tscn\").instantiate()\n"
|
||||||
"# Add the node as a child of the node the script is attached to.\n"
|
"# Add the node as a child of the node the script is attached to.\n"
|
||||||
"add_child(scene)\n"
|
"add_child(scene)\n"
|
||||||
"[/codeblock]\n"
|
"[/codeblock]\n"
|
||||||
|
|
|
@ -985,7 +985,7 @@ msgid ""
|
||||||
"the FileSystem dock into the script.\n"
|
"the FileSystem dock into the script.\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Instance a scene.\n"
|
"# Instance a scene.\n"
|
||||||
"var diamond = preload(\"res://diamond.tscn\").instance()\n"
|
"var diamond = preload(\"res://diamond.tscn\").instantiate()\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -14115,7 +14115,7 @@ msgid ""
|
||||||
"Example of usage with custom scene instance:\n"
|
"Example of usage with custom scene instance:\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"func _make_custom_tooltip(for_text):\n"
|
"func _make_custom_tooltip(for_text):\n"
|
||||||
" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n"
|
" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n"
|
||||||
" tooltip.get_node(\"Label\").text = for_text\n"
|
" tooltip.get_node(\"Label\").text = for_text\n"
|
||||||
" return tooltip\n"
|
" return tooltip\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
|
@ -34990,7 +34990,7 @@ msgid ""
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
||||||
"time.\n"
|
"time.\n"
|
||||||
"var scene = preload(\"res://scene.tscn\").instance()\n"
|
"var scene = preload(\"res://scene.tscn\").instantiate()\n"
|
||||||
"# Add the node as a child of the node the script is attached to.\n"
|
"# Add the node as a child of the node the script is attached to.\n"
|
||||||
"add_child(scene)\n"
|
"add_child(scene)\n"
|
||||||
"[/codeblock]\n"
|
"[/codeblock]\n"
|
||||||
|
|
|
@ -1091,7 +1091,7 @@ msgid ""
|
||||||
"the FileSystem dock into the script.\n"
|
"the FileSystem dock into the script.\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Instance a scene.\n"
|
"# Instance a scene.\n"
|
||||||
"var diamond = preload(\"res://diamond.tscn\").instance()\n"
|
"var diamond = preload(\"res://diamond.tscn\").instantiate()\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -15045,7 +15045,7 @@ msgid ""
|
||||||
"Example of usage with custom scene instance:\n"
|
"Example of usage with custom scene instance:\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"func _make_custom_tooltip(for_text):\n"
|
"func _make_custom_tooltip(for_text):\n"
|
||||||
" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n"
|
" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n"
|
||||||
" tooltip.get_node(\"Label\").text = for_text\n"
|
" tooltip.get_node(\"Label\").text = for_text\n"
|
||||||
" return tooltip\n"
|
" return tooltip\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
|
@ -35964,7 +35964,7 @@ msgid ""
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
||||||
"time.\n"
|
"time.\n"
|
||||||
"var scene = preload(\"res://scene.tscn\").instance()\n"
|
"var scene = preload(\"res://scene.tscn\").instantiate()\n"
|
||||||
"# Add the node as a child of the node the script is attached to.\n"
|
"# Add the node as a child of the node the script is attached to.\n"
|
||||||
"add_child(scene)\n"
|
"add_child(scene)\n"
|
||||||
"[/codeblock]\n"
|
"[/codeblock]\n"
|
||||||
|
|
|
@ -709,7 +709,7 @@ msgid ""
|
||||||
"the FileSystem dock into the script.\n"
|
"the FileSystem dock into the script.\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Instance a scene.\n"
|
"# Instance a scene.\n"
|
||||||
"var diamond = preload(\"res://diamond.tscn\").instance()\n"
|
"var diamond = preload(\"res://diamond.tscn\").instantiate()\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -13833,7 +13833,7 @@ msgid ""
|
||||||
"Example of usage with custom scene instance:\n"
|
"Example of usage with custom scene instance:\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"func _make_custom_tooltip(for_text):\n"
|
"func _make_custom_tooltip(for_text):\n"
|
||||||
" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n"
|
" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n"
|
||||||
" tooltip.get_node(\"Label\").text = for_text\n"
|
" tooltip.get_node(\"Label\").text = for_text\n"
|
||||||
" return tooltip\n"
|
" return tooltip\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
|
@ -34699,7 +34699,7 @@ msgid ""
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
||||||
"time.\n"
|
"time.\n"
|
||||||
"var scene = preload(\"res://scene.tscn\").instance()\n"
|
"var scene = preload(\"res://scene.tscn\").instantiate()\n"
|
||||||
"# Add the node as a child of the node the script is attached to.\n"
|
"# Add the node as a child of the node the script is attached to.\n"
|
||||||
"add_child(scene)\n"
|
"add_child(scene)\n"
|
||||||
"[/codeblock]\n"
|
"[/codeblock]\n"
|
||||||
|
|
|
@ -735,7 +735,7 @@ msgid ""
|
||||||
"the FileSystem dock into the script.\n"
|
"the FileSystem dock into the script.\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Instance a scene.\n"
|
"# Instance a scene.\n"
|
||||||
"var diamond = preload(\"res://diamond.tscn\").instance()\n"
|
"var diamond = preload(\"res://diamond.tscn\").instantiate()\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -13859,7 +13859,7 @@ msgid ""
|
||||||
"Example of usage with custom scene instance:\n"
|
"Example of usage with custom scene instance:\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"func _make_custom_tooltip(for_text):\n"
|
"func _make_custom_tooltip(for_text):\n"
|
||||||
" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n"
|
" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n"
|
||||||
" tooltip.get_node(\"Label\").text = for_text\n"
|
" tooltip.get_node(\"Label\").text = for_text\n"
|
||||||
" return tooltip\n"
|
" return tooltip\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
|
@ -34725,7 +34725,7 @@ msgid ""
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
||||||
"time.\n"
|
"time.\n"
|
||||||
"var scene = preload(\"res://scene.tscn\").instance()\n"
|
"var scene = preload(\"res://scene.tscn\").instantiate()\n"
|
||||||
"# Add the node as a child of the node the script is attached to.\n"
|
"# Add the node as a child of the node the script is attached to.\n"
|
||||||
"add_child(scene)\n"
|
"add_child(scene)\n"
|
||||||
"[/codeblock]\n"
|
"[/codeblock]\n"
|
||||||
|
|
|
@ -737,7 +737,7 @@ msgid ""
|
||||||
"the FileSystem dock into the script.\n"
|
"the FileSystem dock into the script.\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Instance a scene.\n"
|
"# Instance a scene.\n"
|
||||||
"var diamond = preload(\"res://diamond.tscn\").instance()\n"
|
"var diamond = preload(\"res://diamond.tscn\").instantiate()\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -13877,7 +13877,7 @@ msgid ""
|
||||||
"Example of usage with custom scene instance:\n"
|
"Example of usage with custom scene instance:\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"func _make_custom_tooltip(for_text):\n"
|
"func _make_custom_tooltip(for_text):\n"
|
||||||
" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n"
|
" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n"
|
||||||
" tooltip.get_node(\"Label\").text = for_text\n"
|
" tooltip.get_node(\"Label\").text = for_text\n"
|
||||||
" return tooltip\n"
|
" return tooltip\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
|
@ -34744,7 +34744,7 @@ msgid ""
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
||||||
"time.\n"
|
"time.\n"
|
||||||
"var scene = preload(\"res://scene.tscn\").instance()\n"
|
"var scene = preload(\"res://scene.tscn\").instantiate()\n"
|
||||||
"# Add the node as a child of the node the script is attached to.\n"
|
"# Add the node as a child of the node the script is attached to.\n"
|
||||||
"add_child(scene)\n"
|
"add_child(scene)\n"
|
||||||
"[/codeblock]\n"
|
"[/codeblock]\n"
|
||||||
|
|
|
@ -748,7 +748,7 @@ msgid ""
|
||||||
"the FileSystem dock into the script.\n"
|
"the FileSystem dock into the script.\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Instance a scene.\n"
|
"# Instance a scene.\n"
|
||||||
"var diamond = preload(\"res://diamond.tscn\").instance()\n"
|
"var diamond = preload(\"res://diamond.tscn\").instantiate()\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -13872,7 +13872,7 @@ msgid ""
|
||||||
"Example of usage with custom scene instance:\n"
|
"Example of usage with custom scene instance:\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"func _make_custom_tooltip(for_text):\n"
|
"func _make_custom_tooltip(for_text):\n"
|
||||||
" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n"
|
" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n"
|
||||||
" tooltip.get_node(\"Label\").text = for_text\n"
|
" tooltip.get_node(\"Label\").text = for_text\n"
|
||||||
" return tooltip\n"
|
" return tooltip\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
|
@ -34738,7 +34738,7 @@ msgid ""
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
||||||
"time.\n"
|
"time.\n"
|
||||||
"var scene = preload(\"res://scene.tscn\").instance()\n"
|
"var scene = preload(\"res://scene.tscn\").instantiate()\n"
|
||||||
"# Add the node as a child of the node the script is attached to.\n"
|
"# Add the node as a child of the node the script is attached to.\n"
|
||||||
"add_child(scene)\n"
|
"add_child(scene)\n"
|
||||||
"[/codeblock]\n"
|
"[/codeblock]\n"
|
||||||
|
|
|
@ -709,7 +709,7 @@ msgid ""
|
||||||
"the FileSystem dock into the script.\n"
|
"the FileSystem dock into the script.\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Instance a scene.\n"
|
"# Instance a scene.\n"
|
||||||
"var diamond = preload(\"res://diamond.tscn\").instance()\n"
|
"var diamond = preload(\"res://diamond.tscn\").instantiate()\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -13833,7 +13833,7 @@ msgid ""
|
||||||
"Example of usage with custom scene instance:\n"
|
"Example of usage with custom scene instance:\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"func _make_custom_tooltip(for_text):\n"
|
"func _make_custom_tooltip(for_text):\n"
|
||||||
" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n"
|
" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n"
|
||||||
" tooltip.get_node(\"Label\").text = for_text\n"
|
" tooltip.get_node(\"Label\").text = for_text\n"
|
||||||
" return tooltip\n"
|
" return tooltip\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
|
@ -34699,7 +34699,7 @@ msgid ""
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
||||||
"time.\n"
|
"time.\n"
|
||||||
"var scene = preload(\"res://scene.tscn\").instance()\n"
|
"var scene = preload(\"res://scene.tscn\").instantiate()\n"
|
||||||
"# Add the node as a child of the node the script is attached to.\n"
|
"# Add the node as a child of the node the script is attached to.\n"
|
||||||
"add_child(scene)\n"
|
"add_child(scene)\n"
|
||||||
"[/codeblock]\n"
|
"[/codeblock]\n"
|
||||||
|
|
|
@ -1072,7 +1072,7 @@ msgid ""
|
||||||
"the FileSystem dock into the script.\n"
|
"the FileSystem dock into the script.\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Instance a scene.\n"
|
"# Instance a scene.\n"
|
||||||
"var diamond = preload(\"res://diamond.tscn\").instance()\n"
|
"var diamond = preload(\"res://diamond.tscn\").instantiate()\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -14338,7 +14338,7 @@ msgid ""
|
||||||
"Example of usage with custom scene instance:\n"
|
"Example of usage with custom scene instance:\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"func _make_custom_tooltip(for_text):\n"
|
"func _make_custom_tooltip(for_text):\n"
|
||||||
" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n"
|
" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n"
|
||||||
" tooltip.get_node(\"Label\").text = for_text\n"
|
" tooltip.get_node(\"Label\").text = for_text\n"
|
||||||
" return tooltip\n"
|
" return tooltip\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
|
@ -35238,7 +35238,7 @@ msgid ""
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
||||||
"time.\n"
|
"time.\n"
|
||||||
"var scene = preload(\"res://scene.tscn\").instance()\n"
|
"var scene = preload(\"res://scene.tscn\").instantiate()\n"
|
||||||
"# Add the node as a child of the node the script is attached to.\n"
|
"# Add the node as a child of the node the script is attached to.\n"
|
||||||
"add_child(scene)\n"
|
"add_child(scene)\n"
|
||||||
"[/codeblock]\n"
|
"[/codeblock]\n"
|
||||||
|
|
|
@ -719,7 +719,7 @@ msgid ""
|
||||||
"the FileSystem dock into the script.\n"
|
"the FileSystem dock into the script.\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Instance a scene.\n"
|
"# Instance a scene.\n"
|
||||||
"var diamond = preload(\"res://diamond.tscn\").instance()\n"
|
"var diamond = preload(\"res://diamond.tscn\").instantiate()\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -13843,7 +13843,7 @@ msgid ""
|
||||||
"Example of usage with custom scene instance:\n"
|
"Example of usage with custom scene instance:\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"func _make_custom_tooltip(for_text):\n"
|
"func _make_custom_tooltip(for_text):\n"
|
||||||
" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n"
|
" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n"
|
||||||
" tooltip.get_node(\"Label\").text = for_text\n"
|
" tooltip.get_node(\"Label\").text = for_text\n"
|
||||||
" return tooltip\n"
|
" return tooltip\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
|
@ -34709,7 +34709,7 @@ msgid ""
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
||||||
"time.\n"
|
"time.\n"
|
||||||
"var scene = preload(\"res://scene.tscn\").instance()\n"
|
"var scene = preload(\"res://scene.tscn\").instantiate()\n"
|
||||||
"# Add the node as a child of the node the script is attached to.\n"
|
"# Add the node as a child of the node the script is attached to.\n"
|
||||||
"add_child(scene)\n"
|
"add_child(scene)\n"
|
||||||
"[/codeblock]\n"
|
"[/codeblock]\n"
|
||||||
|
|
|
@ -725,7 +725,7 @@ msgid ""
|
||||||
"the FileSystem dock into the script.\n"
|
"the FileSystem dock into the script.\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Instance a scene.\n"
|
"# Instance a scene.\n"
|
||||||
"var diamond = preload(\"res://diamond.tscn\").instance()\n"
|
"var diamond = preload(\"res://diamond.tscn\").instantiate()\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -13849,7 +13849,7 @@ msgid ""
|
||||||
"Example of usage with custom scene instance:\n"
|
"Example of usage with custom scene instance:\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"func _make_custom_tooltip(for_text):\n"
|
"func _make_custom_tooltip(for_text):\n"
|
||||||
" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n"
|
" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n"
|
||||||
" tooltip.get_node(\"Label\").text = for_text\n"
|
" tooltip.get_node(\"Label\").text = for_text\n"
|
||||||
" return tooltip\n"
|
" return tooltip\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
|
@ -34715,7 +34715,7 @@ msgid ""
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
||||||
"time.\n"
|
"time.\n"
|
||||||
"var scene = preload(\"res://scene.tscn\").instance()\n"
|
"var scene = preload(\"res://scene.tscn\").instantiate()\n"
|
||||||
"# Add the node as a child of the node the script is attached to.\n"
|
"# Add the node as a child of the node the script is attached to.\n"
|
||||||
"add_child(scene)\n"
|
"add_child(scene)\n"
|
||||||
"[/codeblock]\n"
|
"[/codeblock]\n"
|
||||||
|
|
|
@ -701,7 +701,7 @@ msgid ""
|
||||||
"the FileSystem dock into the script.\n"
|
"the FileSystem dock into the script.\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Instance a scene.\n"
|
"# Instance a scene.\n"
|
||||||
"var diamond = preload(\"res://diamond.tscn\").instance()\n"
|
"var diamond = preload(\"res://diamond.tscn\").instantiate()\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -13825,7 +13825,7 @@ msgid ""
|
||||||
"Example of usage with custom scene instance:\n"
|
"Example of usage with custom scene instance:\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"func _make_custom_tooltip(for_text):\n"
|
"func _make_custom_tooltip(for_text):\n"
|
||||||
" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n"
|
" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n"
|
||||||
" tooltip.get_node(\"Label\").text = for_text\n"
|
" tooltip.get_node(\"Label\").text = for_text\n"
|
||||||
" return tooltip\n"
|
" return tooltip\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
|
@ -34691,7 +34691,7 @@ msgid ""
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
||||||
"time.\n"
|
"time.\n"
|
||||||
"var scene = preload(\"res://scene.tscn\").instance()\n"
|
"var scene = preload(\"res://scene.tscn\").instantiate()\n"
|
||||||
"# Add the node as a child of the node the script is attached to.\n"
|
"# Add the node as a child of the node the script is attached to.\n"
|
||||||
"add_child(scene)\n"
|
"add_child(scene)\n"
|
||||||
"[/codeblock]\n"
|
"[/codeblock]\n"
|
||||||
|
|
|
@ -787,7 +787,7 @@ msgid ""
|
||||||
"the FileSystem dock into the script.\n"
|
"the FileSystem dock into the script.\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Instance a scene.\n"
|
"# Instance a scene.\n"
|
||||||
"var diamond = preload(\"res://diamond.tscn\").instance()\n"
|
"var diamond = preload(\"res://diamond.tscn\").instantiate()\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -13911,7 +13911,7 @@ msgid ""
|
||||||
"Example of usage with custom scene instance:\n"
|
"Example of usage with custom scene instance:\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"func _make_custom_tooltip(for_text):\n"
|
"func _make_custom_tooltip(for_text):\n"
|
||||||
" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n"
|
" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n"
|
||||||
" tooltip.get_node(\"Label\").text = for_text\n"
|
" tooltip.get_node(\"Label\").text = for_text\n"
|
||||||
" return tooltip\n"
|
" return tooltip\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
|
@ -34777,7 +34777,7 @@ msgid ""
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
||||||
"time.\n"
|
"time.\n"
|
||||||
"var scene = preload(\"res://scene.tscn\").instance()\n"
|
"var scene = preload(\"res://scene.tscn\").instantiate()\n"
|
||||||
"# Add the node as a child of the node the script is attached to.\n"
|
"# Add the node as a child of the node the script is attached to.\n"
|
||||||
"add_child(scene)\n"
|
"add_child(scene)\n"
|
||||||
"[/codeblock]\n"
|
"[/codeblock]\n"
|
||||||
|
|
|
@ -934,7 +934,7 @@ msgid ""
|
||||||
"the FileSystem dock into the script.\n"
|
"the FileSystem dock into the script.\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Instance a scene.\n"
|
"# Instance a scene.\n"
|
||||||
"var diamond = preload(\"res://diamond.tscn\").instance()\n"
|
"var diamond = preload(\"res://diamond.tscn\").instantiate()\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -14058,7 +14058,7 @@ msgid ""
|
||||||
"Example of usage with custom scene instance:\n"
|
"Example of usage with custom scene instance:\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"func _make_custom_tooltip(for_text):\n"
|
"func _make_custom_tooltip(for_text):\n"
|
||||||
" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n"
|
" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n"
|
||||||
" tooltip.get_node(\"Label\").text = for_text\n"
|
" tooltip.get_node(\"Label\").text = for_text\n"
|
||||||
" return tooltip\n"
|
" return tooltip\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
|
@ -34928,7 +34928,7 @@ msgid ""
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
||||||
"time.\n"
|
"time.\n"
|
||||||
"var scene = preload(\"res://scene.tscn\").instance()\n"
|
"var scene = preload(\"res://scene.tscn\").instantiate()\n"
|
||||||
"# Add the node as a child of the node the script is attached to.\n"
|
"# Add the node as a child of the node the script is attached to.\n"
|
||||||
"add_child(scene)\n"
|
"add_child(scene)\n"
|
||||||
"[/codeblock]\n"
|
"[/codeblock]\n"
|
||||||
|
|
|
@ -738,7 +738,7 @@ msgid ""
|
||||||
"the FileSystem dock into the script.\n"
|
"the FileSystem dock into the script.\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Instance a scene.\n"
|
"# Instance a scene.\n"
|
||||||
"var diamond = preload(\"res://diamond.tscn\").instance()\n"
|
"var diamond = preload(\"res://diamond.tscn\").instantiate()\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -13862,7 +13862,7 @@ msgid ""
|
||||||
"Example of usage with custom scene instance:\n"
|
"Example of usage with custom scene instance:\n"
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"func _make_custom_tooltip(for_text):\n"
|
"func _make_custom_tooltip(for_text):\n"
|
||||||
" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n"
|
" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n"
|
||||||
" tooltip.get_node(\"Label\").text = for_text\n"
|
" tooltip.get_node(\"Label\").text = for_text\n"
|
||||||
" return tooltip\n"
|
" return tooltip\n"
|
||||||
"[/codeblock]"
|
"[/codeblock]"
|
||||||
|
@ -34728,7 +34728,7 @@ msgid ""
|
||||||
"[codeblock]\n"
|
"[codeblock]\n"
|
||||||
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
"# Use `load()` instead of `preload()` if the path isn't known at compile-"
|
||||||
"time.\n"
|
"time.\n"
|
||||||
"var scene = preload(\"res://scene.tscn\").instance()\n"
|
"var scene = preload(\"res://scene.tscn\").instantiate()\n"
|
||||||
"# Add the node as a child of the node the script is attached to.\n"
|
"# Add the node as a child of the node the script is attached to.\n"
|
||||||
"add_child(scene)\n"
|
"add_child(scene)\n"
|
||||||
"[/codeblock]\n"
|
"[/codeblock]\n"
|
||||||
|
|
|
@ -59,7 +59,7 @@ void ImageLoaderPNG::get_recognized_extensions(List<String> *p_extensions) const
|
||||||
|
|
||||||
Ref<Image> ImageLoaderPNG::load_mem_png(const uint8_t *p_png, int p_size) {
|
Ref<Image> ImageLoaderPNG::load_mem_png(const uint8_t *p_png, int p_size) {
|
||||||
Ref<Image> img;
|
Ref<Image> img;
|
||||||
img.instance();
|
img.instantiate();
|
||||||
|
|
||||||
// the value of p_force_linear does not matter since it only applies to 16 bit
|
// the value of p_force_linear does not matter since it only applies to 16 bit
|
||||||
Error err = PNGDriverCommon::png_to_image(p_png, p_size, false, img);
|
Error err = PNGDriverCommon::png_to_image(p_png, p_size, false, img);
|
||||||
|
|
|
@ -40,7 +40,7 @@ void register_core_driver_types() {
|
||||||
image_loader_png = memnew(ImageLoaderPNG);
|
image_loader_png = memnew(ImageLoaderPNG);
|
||||||
ImageLoader::add_image_format_loader(image_loader_png);
|
ImageLoader::add_image_format_loader(image_loader_png);
|
||||||
|
|
||||||
resource_saver_png.instance();
|
resource_saver_png.instantiate();
|
||||||
ResourceSaver::add_resource_format_saver(resource_saver_png);
|
ResourceSaver::add_resource_format_saver(resource_saver_png);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -310,7 +310,7 @@ void InputEventConfigurationDialog::_update_input_list() {
|
||||||
MouseButton mouse_buttons[9] = { MOUSE_BUTTON_LEFT, MOUSE_BUTTON_RIGHT, MOUSE_BUTTON_MIDDLE, MOUSE_BUTTON_WHEEL_UP, MOUSE_BUTTON_WHEEL_DOWN, MOUSE_BUTTON_WHEEL_LEFT, MOUSE_BUTTON_WHEEL_RIGHT, MOUSE_BUTTON_XBUTTON1, MOUSE_BUTTON_XBUTTON2 };
|
MouseButton mouse_buttons[9] = { MOUSE_BUTTON_LEFT, MOUSE_BUTTON_RIGHT, MOUSE_BUTTON_MIDDLE, MOUSE_BUTTON_WHEEL_UP, MOUSE_BUTTON_WHEEL_DOWN, MOUSE_BUTTON_WHEEL_LEFT, MOUSE_BUTTON_WHEEL_RIGHT, MOUSE_BUTTON_XBUTTON1, MOUSE_BUTTON_XBUTTON2 };
|
||||||
for (int i = 0; i < 9; i++) {
|
for (int i = 0; i < 9; i++) {
|
||||||
Ref<InputEventMouseButton> mb;
|
Ref<InputEventMouseButton> mb;
|
||||||
mb.instance();
|
mb.instantiate();
|
||||||
mb->set_button_index(mouse_buttons[i]);
|
mb->set_button_index(mouse_buttons[i]);
|
||||||
String desc = get_event_text(mb);
|
String desc = get_event_text(mb);
|
||||||
|
|
||||||
|
@ -333,7 +333,7 @@ void InputEventConfigurationDialog::_update_input_list() {
|
||||||
|
|
||||||
for (int i = 0; i < JOY_BUTTON_MAX; i++) {
|
for (int i = 0; i < JOY_BUTTON_MAX; i++) {
|
||||||
Ref<InputEventJoypadButton> joyb;
|
Ref<InputEventJoypadButton> joyb;
|
||||||
joyb.instance();
|
joyb.instantiate();
|
||||||
joyb->set_button_index(i);
|
joyb->set_button_index(i);
|
||||||
String desc = get_event_text(joyb);
|
String desc = get_event_text(joyb);
|
||||||
|
|
||||||
|
@ -358,7 +358,7 @@ void InputEventConfigurationDialog::_update_input_list() {
|
||||||
int axis = i / 2;
|
int axis = i / 2;
|
||||||
int direction = (i & 1) ? 1 : -1;
|
int direction = (i & 1) ? 1 : -1;
|
||||||
Ref<InputEventJoypadMotion> joym;
|
Ref<InputEventJoypadMotion> joym;
|
||||||
joym.instance();
|
joym.instantiate();
|
||||||
joym->set_axis(axis);
|
joym->set_axis(axis);
|
||||||
joym->set_axis_value(direction);
|
joym->set_axis_value(direction);
|
||||||
String desc = get_event_text(joym);
|
String desc = get_event_text(joym);
|
||||||
|
@ -458,7 +458,7 @@ void InputEventConfigurationDialog::_input_list_item_selected() {
|
||||||
case InputEventConfigurationDialog::INPUT_KEY: {
|
case InputEventConfigurationDialog::INPUT_KEY: {
|
||||||
int kc = selected->get_meta("__keycode");
|
int kc = selected->get_meta("__keycode");
|
||||||
Ref<InputEventKey> k;
|
Ref<InputEventKey> k;
|
||||||
k.instance();
|
k.instantiate();
|
||||||
|
|
||||||
if (physical_key_checkbox->is_pressed()) {
|
if (physical_key_checkbox->is_pressed()) {
|
||||||
k->set_physical_keycode(kc);
|
k->set_physical_keycode(kc);
|
||||||
|
@ -481,7 +481,7 @@ void InputEventConfigurationDialog::_input_list_item_selected() {
|
||||||
case InputEventConfigurationDialog::INPUT_MOUSE_BUTTON: {
|
case InputEventConfigurationDialog::INPUT_MOUSE_BUTTON: {
|
||||||
int idx = selected->get_meta("__index");
|
int idx = selected->get_meta("__index");
|
||||||
Ref<InputEventMouseButton> mb;
|
Ref<InputEventMouseButton> mb;
|
||||||
mb.instance();
|
mb.instantiate();
|
||||||
mb->set_button_index(idx);
|
mb->set_button_index(idx);
|
||||||
// Maintain modifier state from checkboxes
|
// Maintain modifier state from checkboxes
|
||||||
mb->set_alt_pressed(mod_checkboxes[MOD_ALT]->is_pressed());
|
mb->set_alt_pressed(mod_checkboxes[MOD_ALT]->is_pressed());
|
||||||
|
@ -503,7 +503,7 @@ void InputEventConfigurationDialog::_input_list_item_selected() {
|
||||||
int value = selected->get_meta("__value");
|
int value = selected->get_meta("__value");
|
||||||
|
|
||||||
Ref<InputEventJoypadMotion> jm;
|
Ref<InputEventJoypadMotion> jm;
|
||||||
jm.instance();
|
jm.instantiate();
|
||||||
jm->set_axis(axis);
|
jm->set_axis(axis);
|
||||||
jm->set_axis_value(value);
|
jm->set_axis_value(value);
|
||||||
_set_event(jm);
|
_set_event(jm);
|
||||||
|
|
|
@ -3760,7 +3760,7 @@ Ref<Animation> AnimationTrackEditor::_create_and_get_reset_animation() {
|
||||||
return player->get_animation("RESET");
|
return player->get_animation("RESET");
|
||||||
} else {
|
} else {
|
||||||
Ref<Animation> reset_anim;
|
Ref<Animation> reset_anim;
|
||||||
reset_anim.instance();
|
reset_anim.instantiate();
|
||||||
reset_anim->set_length(ANIM_MIN_LENGTH);
|
reset_anim->set_length(ANIM_MIN_LENGTH);
|
||||||
undo_redo->add_do_method(player, "add_animation", "RESET", reset_anim);
|
undo_redo->add_do_method(player, "add_animation", "RESET", reset_anim);
|
||||||
undo_redo->add_do_method(AnimationPlayerEditor::singleton, "_animation_player_changed", player);
|
undo_redo->add_do_method(AnimationPlayerEditor::singleton, "_animation_player_changed", player);
|
||||||
|
@ -5983,7 +5983,7 @@ AnimationTrackEditor::AnimationTrackEditor() {
|
||||||
//default plugins
|
//default plugins
|
||||||
|
|
||||||
Ref<AnimationTrackEditDefaultPlugin> def_plugin;
|
Ref<AnimationTrackEditDefaultPlugin> def_plugin;
|
||||||
def_plugin.instance();
|
def_plugin.instantiate();
|
||||||
add_track_edit_plugin(def_plugin);
|
add_track_edit_plugin(def_plugin);
|
||||||
|
|
||||||
//dialogs
|
//dialogs
|
||||||
|
|
|
@ -192,7 +192,7 @@ Ref<AudioStreamPreview> AudioStreamPreviewGenerator::generate_preview(const Ref<
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
preview->preview.instance();
|
preview->preview.instantiate();
|
||||||
preview->preview->preview = maxmin;
|
preview->preview->preview = maxmin;
|
||||||
preview->preview->length = len_s;
|
preview->preview->length = len_s;
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,7 @@ bool CreateDialog::_should_hide_type(const String &p_type) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ClassDB::class_exists(p_type)) {
|
if (ClassDB::class_exists(p_type)) {
|
||||||
if (!ClassDB::can_instance(p_type)) {
|
if (!ClassDB::can_instantiate(p_type)) {
|
||||||
return true; // Can't create abstract class.
|
return true; // Can't create abstract class.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,8 +234,8 @@ void CreateDialog::_configure_search_option_item(TreeItem *r_item, const String
|
||||||
r_item->set_text(0, p_type);
|
r_item->set_text(0, p_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool can_instance = (p_cpp_type && ClassDB::can_instance(p_type)) || !p_cpp_type;
|
bool can_instantiate = (p_cpp_type && ClassDB::can_instantiate(p_type)) || !p_cpp_type;
|
||||||
if (!can_instance) {
|
if (!can_instantiate) {
|
||||||
r_item->set_custom_color(0, search_options->get_theme_color("disabled_font_color", "Editor"));
|
r_item->set_custom_color(0, search_options->get_theme_color("disabled_font_color", "Editor"));
|
||||||
r_item->set_icon(0, EditorNode::get_singleton()->get_class_icon(p_type, "NodeDisabled"));
|
r_item->set_icon(0, EditorNode::get_singleton()->get_class_icon(p_type, "NodeDisabled"));
|
||||||
r_item->set_selectable(0, false);
|
r_item->set_selectable(0, false);
|
||||||
|
@ -247,7 +247,7 @@ void CreateDialog::_configure_search_option_item(TreeItem *r_item, const String
|
||||||
r_item->set_collapsed(false);
|
r_item->set_collapsed(false);
|
||||||
} else {
|
} else {
|
||||||
// Don't collapse the root node or an abstract node on the first tree level.
|
// Don't collapse the root node or an abstract node on the first tree level.
|
||||||
bool should_collapse = p_type != base_type && (r_item->get_parent()->get_text(0) != base_type || can_instance);
|
bool should_collapse = p_type != base_type && (r_item->get_parent()->get_text(0) != base_type || can_instantiate);
|
||||||
|
|
||||||
if (should_collapse && bool(EditorSettings::get_singleton()->get("docks/scene_tree/start_create_dialog_fully_expanded"))) {
|
if (should_collapse && bool(EditorSettings::get_singleton()->get("docks/scene_tree/start_create_dialog_fully_expanded"))) {
|
||||||
should_collapse = false; // Collapse all nodes anyway.
|
should_collapse = false; // Collapse all nodes anyway.
|
||||||
|
@ -432,7 +432,7 @@ Variant CreateDialog::instance_selected() {
|
||||||
obj = EditorNode::get_editor_data().instance_custom_type(selected->get_text(0), custom);
|
obj = EditorNode::get_editor_data().instance_custom_type(selected->get_text(0), custom);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
obj = ClassDB::instance(selected->get_text(0));
|
obj = ClassDB::instantiate(selected->get_text(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if any Object-type property should be instantiated.
|
// Check if any Object-type property should be instantiated.
|
||||||
|
@ -442,7 +442,7 @@ Variant CreateDialog::instance_selected() {
|
||||||
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
|
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
|
||||||
PropertyInfo pi = E->get();
|
PropertyInfo pi = E->get();
|
||||||
if (pi.type == Variant::OBJECT && pi.usage & PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT) {
|
if (pi.type == Variant::OBJECT && pi.usage & PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT) {
|
||||||
Object *prop = ClassDB::instance(pi.class_name);
|
Object *prop = ClassDB::instantiate(pi.class_name);
|
||||||
((Object *)obj)->set(pi.name, prop);
|
((Object *)obj)->set(pi.name, prop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,7 @@ EditorDebuggerNode::EditorDebuggerNode() {
|
||||||
add_child(tabs);
|
add_child(tabs);
|
||||||
|
|
||||||
Ref<StyleBoxEmpty> empty;
|
Ref<StyleBoxEmpty> empty;
|
||||||
empty.instance();
|
empty.instantiate();
|
||||||
tabs->add_theme_style_override("panel", empty);
|
tabs->add_theme_style_override("panel", empty);
|
||||||
|
|
||||||
auto_switch_remote_scene_tree = EDITOR_DEF("debugger/auto_switch_to_remote_scene_tree", false);
|
auto_switch_remote_scene_tree = EDITOR_DEF("debugger/auto_switch_to_remote_scene_tree", false);
|
||||||
|
|
|
@ -60,7 +60,7 @@ EditorDebuggerServer *EditorDebuggerServerTCP::create(const String &p_protocol)
|
||||||
}
|
}
|
||||||
|
|
||||||
EditorDebuggerServerTCP::EditorDebuggerServerTCP() {
|
EditorDebuggerServerTCP::EditorDebuggerServerTCP() {
|
||||||
server.instance();
|
server.instantiate();
|
||||||
}
|
}
|
||||||
|
|
||||||
Error EditorDebuggerServerTCP::start() {
|
Error EditorDebuggerServerTCP::start() {
|
||||||
|
|
|
@ -305,12 +305,12 @@ void EditorProfiler::_update_plot() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<Image> img;
|
Ref<Image> img;
|
||||||
img.instance();
|
img.instantiate();
|
||||||
img->create(w, h, false, Image::FORMAT_RGBA8, graph_image);
|
img->create(w, h, false, Image::FORMAT_RGBA8, graph_image);
|
||||||
|
|
||||||
if (reset_texture) {
|
if (reset_texture) {
|
||||||
if (graph_texture.is_null()) {
|
if (graph_texture.is_null()) {
|
||||||
graph_texture.instance();
|
graph_texture.instantiate();
|
||||||
}
|
}
|
||||||
graph_texture->create_from_image(img);
|
graph_texture->create_from_image(img);
|
||||||
}
|
}
|
||||||
|
|
|
@ -299,12 +299,12 @@ void EditorVisualProfiler::_update_plot() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<Image> img;
|
Ref<Image> img;
|
||||||
img.instance();
|
img.instantiate();
|
||||||
img->create(w, h, false, Image::FORMAT_RGBA8, graph_image);
|
img->create(w, h, false, Image::FORMAT_RGBA8, graph_image);
|
||||||
|
|
||||||
if (reset_texture) {
|
if (reset_texture) {
|
||||||
if (graph_texture.is_null()) {
|
if (graph_texture.is_null()) {
|
||||||
graph_texture.instance();
|
graph_texture.instantiate();
|
||||||
}
|
}
|
||||||
graph_texture->create_from_image(img);
|
graph_texture->create_from_image(img);
|
||||||
}
|
}
|
||||||
|
|
|
@ -206,14 +206,14 @@ static Variant get_documentation_default_value(const StringName &p_class_name, c
|
||||||
Variant default_value = Variant();
|
Variant default_value = Variant();
|
||||||
r_default_value_valid = false;
|
r_default_value_valid = false;
|
||||||
|
|
||||||
if (ClassDB::can_instance(p_class_name)) {
|
if (ClassDB::can_instantiate(p_class_name)) {
|
||||||
default_value = ClassDB::class_get_default_property_value(p_class_name, p_property_name, &r_default_value_valid);
|
default_value = ClassDB::class_get_default_property_value(p_class_name, p_property_name, &r_default_value_valid);
|
||||||
} else {
|
} else {
|
||||||
// Cannot get default value of classes that can't be instanced
|
// Cannot get default value of classes that can't be instantiated
|
||||||
List<StringName> inheriting_classes;
|
List<StringName> inheriting_classes;
|
||||||
ClassDB::get_direct_inheriters_from_class(p_class_name, &inheriting_classes);
|
ClassDB::get_direct_inheriters_from_class(p_class_name, &inheriting_classes);
|
||||||
for (List<StringName>::Element *E2 = inheriting_classes.front(); E2; E2 = E2->next()) {
|
for (List<StringName>::Element *E2 = inheriting_classes.front(); E2; E2 = E2->next()) {
|
||||||
if (ClassDB::can_instance(E2->get())) {
|
if (ClassDB::can_instantiate(E2->get())) {
|
||||||
default_value = ClassDB::class_get_default_property_value(E2->get(), p_property_name, &r_default_value_valid);
|
default_value = ClassDB::class_get_default_property_value(E2->get(), p_property_name, &r_default_value_valid);
|
||||||
if (r_default_value_valid) {
|
if (r_default_value_valid) {
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -105,7 +105,7 @@ void EditorAtlasPacker::chart_pack(Vector<Chart> &charts, int &r_width, int &r_h
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<BitMap> src_bitmap;
|
Ref<BitMap> src_bitmap;
|
||||||
src_bitmap.instance();
|
src_bitmap.instantiate();
|
||||||
src_bitmap->create(aabb.size / divide_by);
|
src_bitmap->create(aabb.size / divide_by);
|
||||||
|
|
||||||
int w = src_bitmap->get_size().width;
|
int w = src_bitmap->get_size().width;
|
||||||
|
|
|
@ -525,7 +525,7 @@ void EditorAudioBus::_effect_add(int p_which) {
|
||||||
|
|
||||||
StringName name = effect_options->get_item_metadata(p_which);
|
StringName name = effect_options->get_item_metadata(p_which);
|
||||||
|
|
||||||
Object *fx = ClassDB::instance(name);
|
Object *fx = ClassDB::instantiate(name);
|
||||||
ERR_FAIL_COND(!fx);
|
ERR_FAIL_COND(!fx);
|
||||||
AudioEffect *afx = Object::cast_to<AudioEffect>(fx);
|
AudioEffect *afx = Object::cast_to<AudioEffect>(fx);
|
||||||
ERR_FAIL_COND(!afx);
|
ERR_FAIL_COND(!afx);
|
||||||
|
@ -921,7 +921,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
|
||||||
ClassDB::get_inheriters_from_class("AudioEffect", &effects);
|
ClassDB::get_inheriters_from_class("AudioEffect", &effects);
|
||||||
effects.sort_custom<StringName::AlphCompare>();
|
effects.sort_custom<StringName::AlphCompare>();
|
||||||
for (List<StringName>::Element *E = effects.front(); E; E = E->next()) {
|
for (List<StringName>::Element *E = effects.front(); E; E = E->next()) {
|
||||||
if (!ClassDB::can_instance(E->get())) {
|
if (!ClassDB::can_instantiate(E->get())) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1238,7 +1238,7 @@ void EditorAudioBuses::_file_dialog_callback(const String &p_string) {
|
||||||
} else if (file_dialog->get_file_mode() == EditorFileDialog::FILE_MODE_SAVE_FILE) {
|
} else if (file_dialog->get_file_mode() == EditorFileDialog::FILE_MODE_SAVE_FILE) {
|
||||||
if (new_layout) {
|
if (new_layout) {
|
||||||
Ref<AudioBusLayout> empty_state;
|
Ref<AudioBusLayout> empty_state;
|
||||||
empty_state.instance();
|
empty_state.instantiate();
|
||||||
AudioServer::get_singleton()->set_bus_layout(empty_state);
|
AudioServer::get_singleton()->set_bus_layout(empty_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -349,14 +349,14 @@ Node *EditorAutoloadSettings::_create_autoload(const String &p_path) {
|
||||||
Node *n = nullptr;
|
Node *n = nullptr;
|
||||||
if (res->is_class("PackedScene")) {
|
if (res->is_class("PackedScene")) {
|
||||||
Ref<PackedScene> ps = res;
|
Ref<PackedScene> ps = res;
|
||||||
n = ps->instance();
|
n = ps->instantiate();
|
||||||
} else if (res->is_class("Script")) {
|
} else if (res->is_class("Script")) {
|
||||||
Ref<Script> s = res;
|
Ref<Script> s = res;
|
||||||
StringName ibt = s->get_instance_base_type();
|
StringName ibt = s->get_instance_base_type();
|
||||||
bool valid_type = ClassDB::is_parent_class(ibt, "Node");
|
bool valid_type = ClassDB::is_parent_class(ibt, "Node");
|
||||||
ERR_FAIL_COND_V_MSG(!valid_type, nullptr, "Script does not inherit a Node: " + p_path + ".");
|
ERR_FAIL_COND_V_MSG(!valid_type, nullptr, "Script does not inherit a Node: " + p_path + ".");
|
||||||
|
|
||||||
Object *obj = ClassDB::instance(ibt);
|
Object *obj = ClassDB::instantiate(ibt);
|
||||||
|
|
||||||
ERR_FAIL_COND_V_MSG(obj == nullptr, nullptr, "Cannot instance script for autoload, expected 'Node' inheritance, got: " + String(ibt) + ".");
|
ERR_FAIL_COND_V_MSG(obj == nullptr, nullptr, "Cannot instance script for autoload, expected 'Node' inheritance, got: " + String(ibt) + ".");
|
||||||
|
|
||||||
|
|
|
@ -476,7 +476,7 @@ Variant EditorData::instance_custom_type(const String &p_type, const String &p_i
|
||||||
if (get_custom_types()[p_inherits][i].name == p_type) {
|
if (get_custom_types()[p_inherits][i].name == p_type) {
|
||||||
Ref<Script> script = get_custom_types()[p_inherits][i].script;
|
Ref<Script> script = get_custom_types()[p_inherits][i].script;
|
||||||
|
|
||||||
Variant ob = ClassDB::instance(p_inherits);
|
Variant ob = ClassDB::instantiate(p_inherits);
|
||||||
ERR_FAIL_COND_V(!ob, Variant());
|
ERR_FAIL_COND_V(!ob, Variant());
|
||||||
Node *n = Object::cast_to<Node>(ob);
|
Node *n = Object::cast_to<Node>(ob);
|
||||||
if (n) {
|
if (n) {
|
||||||
|
@ -603,7 +603,7 @@ bool EditorData::check_and_update_scene(int p_idx) {
|
||||||
|
|
||||||
if (must_reload) {
|
if (must_reload) {
|
||||||
Ref<PackedScene> pscene;
|
Ref<PackedScene> pscene;
|
||||||
pscene.instance();
|
pscene.instantiate();
|
||||||
|
|
||||||
EditorProgress ep("update_scene", TTR("Updating Scene"), 2);
|
EditorProgress ep("update_scene", TTR("Updating Scene"), 2);
|
||||||
ep.step(TTR("Storing local changes..."), 0);
|
ep.step(TTR("Storing local changes..."), 0);
|
||||||
|
@ -611,7 +611,7 @@ bool EditorData::check_and_update_scene(int p_idx) {
|
||||||
Error err = pscene->pack(edited_scene[p_idx].root);
|
Error err = pscene->pack(edited_scene[p_idx].root);
|
||||||
ERR_FAIL_COND_V(err != OK, false);
|
ERR_FAIL_COND_V(err != OK, false);
|
||||||
ep.step(TTR("Updating scene..."), 1);
|
ep.step(TTR("Updating scene..."), 1);
|
||||||
Node *new_scene = pscene->instance(PackedScene::GEN_EDIT_STATE_MAIN);
|
Node *new_scene = pscene->instantiate(PackedScene::GEN_EDIT_STATE_MAIN);
|
||||||
ERR_FAIL_COND_V(!new_scene, false);
|
ERR_FAIL_COND_V(!new_scene, false);
|
||||||
|
|
||||||
//transfer selection
|
//transfer selection
|
||||||
|
@ -908,7 +908,7 @@ StringName EditorData::script_class_get_base(const String &p_class) const {
|
||||||
|
|
||||||
Variant EditorData::script_class_instance(const String &p_class) {
|
Variant EditorData::script_class_instance(const String &p_class) {
|
||||||
if (ScriptServer::is_global_class(p_class)) {
|
if (ScriptServer::is_global_class(p_class)) {
|
||||||
Variant obj = ClassDB::instance(ScriptServer::get_global_class_native_base(p_class));
|
Variant obj = ClassDB::instantiate(ScriptServer::get_global_class_native_base(p_class));
|
||||||
if (obj) {
|
if (obj) {
|
||||||
Ref<Script> script = script_class_load_script(p_class);
|
Ref<Script> script = script_class_load_script(p_class);
|
||||||
if (script.is_valid()) {
|
if (script.is_valid()) {
|
||||||
|
|
|
@ -430,7 +430,7 @@ bool EditorExportPlatform::exists_export_template(String template_file_name, Str
|
||||||
|
|
||||||
Ref<EditorExportPreset> EditorExportPlatform::create_preset() {
|
Ref<EditorExportPreset> EditorExportPlatform::create_preset() {
|
||||||
Ref<EditorExportPreset> preset;
|
Ref<EditorExportPreset> preset;
|
||||||
preset.instance();
|
preset.instantiate();
|
||||||
preset->platform = Ref<EditorExportPlatform>(this);
|
preset->platform = Ref<EditorExportPlatform>(this);
|
||||||
|
|
||||||
List<ExportOption> options;
|
List<ExportOption> options;
|
||||||
|
@ -873,7 +873,7 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &
|
||||||
if (FileAccess::exists(path + ".import")) {
|
if (FileAccess::exists(path + ".import")) {
|
||||||
//file is imported, replace by what it imports
|
//file is imported, replace by what it imports
|
||||||
Ref<ConfigFile> config;
|
Ref<ConfigFile> config;
|
||||||
config.instance();
|
config.instantiate();
|
||||||
err = config->load(path + ".import");
|
err = config->load(path + ".import");
|
||||||
if (err != OK) {
|
if (err != OK) {
|
||||||
ERR_PRINT("Could not parse: '" + path + "', not exported.");
|
ERR_PRINT("Could not parse: '" + path + "', not exported.");
|
||||||
|
@ -1391,7 +1391,7 @@ EditorExport *EditorExport::singleton = nullptr;
|
||||||
|
|
||||||
void EditorExport::_save() {
|
void EditorExport::_save() {
|
||||||
Ref<ConfigFile> config;
|
Ref<ConfigFile> config;
|
||||||
config.instance();
|
config.instantiate();
|
||||||
for (int i = 0; i < export_presets.size(); i++) {
|
for (int i = 0; i < export_presets.size(); i++) {
|
||||||
Ref<EditorExportPreset> preset = export_presets[i];
|
Ref<EditorExportPreset> preset = export_presets[i];
|
||||||
String section = "preset." + itos(i);
|
String section = "preset." + itos(i);
|
||||||
|
@ -1546,7 +1546,7 @@ void EditorExport::_notification(int p_what) {
|
||||||
|
|
||||||
void EditorExport::load_config() {
|
void EditorExport::load_config() {
|
||||||
Ref<ConfigFile> config;
|
Ref<ConfigFile> config;
|
||||||
config.instance();
|
config.instantiate();
|
||||||
Error err = config->load("res://export_presets.cfg");
|
Error err = config->load("res://export_presets.cfg");
|
||||||
if (err != OK) {
|
if (err != OK) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -311,7 +311,7 @@ void EditorFeatureProfileManager::_notification(int p_what) {
|
||||||
if (p_what == NOTIFICATION_READY) {
|
if (p_what == NOTIFICATION_READY) {
|
||||||
current_profile = EDITOR_GET("_default_feature_profile");
|
current_profile = EDITOR_GET("_default_feature_profile");
|
||||||
if (current_profile != String()) {
|
if (current_profile != String()) {
|
||||||
current.instance();
|
current.instantiate();
|
||||||
Error err = current->load_from_file(EditorSettings::get_singleton()->get_feature_profiles_dir().plus_file(current_profile + ".profile"));
|
Error err = current->load_from_file(EditorSettings::get_singleton()->get_feature_profiles_dir().plus_file(current_profile + ".profile"));
|
||||||
if (err != OK) {
|
if (err != OK) {
|
||||||
ERR_PRINT("Error loading default feature profile: " + current_profile);
|
ERR_PRINT("Error loading default feature profile: " + current_profile);
|
||||||
|
@ -473,7 +473,7 @@ void EditorFeatureProfileManager::_create_new_profile() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<EditorFeatureProfile> new_profile;
|
Ref<EditorFeatureProfile> new_profile;
|
||||||
new_profile.instance();
|
new_profile.instantiate();
|
||||||
new_profile->save_to_file(file);
|
new_profile->save_to_file(file);
|
||||||
|
|
||||||
_update_profile_list(name);
|
_update_profile_list(name);
|
||||||
|
@ -730,7 +730,7 @@ void EditorFeatureProfileManager::_update_selected_profile() {
|
||||||
ERR_FAIL_COND(current.is_null()); //nothing selected, current should never be null
|
ERR_FAIL_COND(current.is_null()); //nothing selected, current should never be null
|
||||||
} else {
|
} else {
|
||||||
//reload edited, if different from current
|
//reload edited, if different from current
|
||||||
edited.instance();
|
edited.instantiate();
|
||||||
Error err = edited->load_from_file(EditorSettings::get_singleton()->get_feature_profiles_dir().plus_file(profile + ".profile"));
|
Error err = edited->load_from_file(EditorSettings::get_singleton()->get_feature_profiles_dir().plus_file(profile + ".profile"));
|
||||||
ERR_FAIL_COND_MSG(err != OK, "Error when loading EditorSettings from file '" + EditorSettings::get_singleton()->get_feature_profiles_dir().plus_file(profile + ".profile") + "'.");
|
ERR_FAIL_COND_MSG(err != OK, "Error when loading EditorSettings from file '" + EditorSettings::get_singleton()->get_feature_profiles_dir().plus_file(profile + ".profile") + "'.");
|
||||||
}
|
}
|
||||||
|
@ -779,7 +779,7 @@ void EditorFeatureProfileManager::_import_profiles(const Vector<String> &p_paths
|
||||||
//test it first
|
//test it first
|
||||||
for (int i = 0; i < p_paths.size(); i++) {
|
for (int i = 0; i < p_paths.size(); i++) {
|
||||||
Ref<EditorFeatureProfile> profile;
|
Ref<EditorFeatureProfile> profile;
|
||||||
profile.instance();
|
profile.instantiate();
|
||||||
Error err = profile->load_from_file(p_paths[i]);
|
Error err = profile->load_from_file(p_paths[i]);
|
||||||
String basefile = p_paths[i].get_file();
|
String basefile = p_paths[i].get_file();
|
||||||
if (err != OK) {
|
if (err != OK) {
|
||||||
|
@ -798,7 +798,7 @@ void EditorFeatureProfileManager::_import_profiles(const Vector<String> &p_paths
|
||||||
//do it second
|
//do it second
|
||||||
for (int i = 0; i < p_paths.size(); i++) {
|
for (int i = 0; i < p_paths.size(); i++) {
|
||||||
Ref<EditorFeatureProfile> profile;
|
Ref<EditorFeatureProfile> profile;
|
||||||
profile.instance();
|
profile.instantiate();
|
||||||
Error err = profile->load_from_file(p_paths[i]);
|
Error err = profile->load_from_file(p_paths[i]);
|
||||||
ERR_CONTINUE(err != OK);
|
ERR_CONTINUE(err != OK);
|
||||||
String basefile = p_paths[i].get_file();
|
String basefile = p_paths[i].get_file();
|
||||||
|
|
|
@ -1544,7 +1544,7 @@ EditorFileDialog::EditorFileDialog() {
|
||||||
pathhb->add_child(memnew(VSeparator));
|
pathhb->add_child(memnew(VSeparator));
|
||||||
|
|
||||||
Ref<ButtonGroup> view_mode_group;
|
Ref<ButtonGroup> view_mode_group;
|
||||||
view_mode_group.instance();
|
view_mode_group.instantiate();
|
||||||
|
|
||||||
mode_thumbnails = memnew(Button);
|
mode_thumbnails = memnew(Button);
|
||||||
mode_thumbnails->set_flat(true);
|
mode_thumbnails->set_flat(true);
|
||||||
|
|
|
@ -1524,7 +1524,7 @@ Error EditorFileSystem::_reimport_group(const String &p_group_file, const Vector
|
||||||
Map<String, String> base_paths;
|
Map<String, String> base_paths;
|
||||||
for (int i = 0; i < p_files.size(); i++) {
|
for (int i = 0; i < p_files.size(); i++) {
|
||||||
Ref<ConfigFile> config;
|
Ref<ConfigFile> config;
|
||||||
config.instance();
|
config.instantiate();
|
||||||
Error err = config->load(p_files[i] + ".import");
|
Error err = config->load(p_files[i] + ".import");
|
||||||
ERR_CONTINUE(err != OK);
|
ERR_CONTINUE(err != OK);
|
||||||
ERR_CONTINUE(!config->has_section_key("remap", "importer"));
|
ERR_CONTINUE(!config->has_section_key("remap", "importer"));
|
||||||
|
@ -1706,7 +1706,7 @@ void EditorFileSystem::_reimport_file(const String &p_file, const Map<StringName
|
||||||
//use existing
|
//use existing
|
||||||
if (p_custom_options == nullptr) {
|
if (p_custom_options == nullptr) {
|
||||||
Ref<ConfigFile> cf;
|
Ref<ConfigFile> cf;
|
||||||
cf.instance();
|
cf.instantiate();
|
||||||
Error err = cf->load(p_file + ".import");
|
Error err = cf->load(p_file + ".import");
|
||||||
if (err == OK) {
|
if (err == OK) {
|
||||||
if (cf->has_section("params")) {
|
if (cf->has_section("params")) {
|
||||||
|
@ -2068,7 +2068,7 @@ void EditorFileSystem::_move_group_files(EditorFileSystemDirectory *efd, const S
|
||||||
files[i]->import_group_file = p_new_location;
|
files[i]->import_group_file = p_new_location;
|
||||||
|
|
||||||
Ref<ConfigFile> config;
|
Ref<ConfigFile> config;
|
||||||
config.instance();
|
config.instantiate();
|
||||||
String path = efd->get_file_path(i) + ".import";
|
String path = efd->get_file_path(i) + ".import";
|
||||||
Error err = config->load(path);
|
Error err = config->load(path);
|
||||||
if (err != OK) {
|
if (err != OK) {
|
||||||
|
|
|
@ -50,7 +50,7 @@ Vector<String> EditorFolding::_get_unfolds(const Object *p_object) {
|
||||||
|
|
||||||
void EditorFolding::save_resource_folding(const RES &p_resource, const String &p_path) {
|
void EditorFolding::save_resource_folding(const RES &p_resource, const String &p_path) {
|
||||||
Ref<ConfigFile> config;
|
Ref<ConfigFile> config;
|
||||||
config.instance();
|
config.instantiate();
|
||||||
Vector<String> unfolds = _get_unfolds(p_resource.ptr());
|
Vector<String> unfolds = _get_unfolds(p_resource.ptr());
|
||||||
config->set_value("folding", "sections_unfolded", unfolds);
|
config->set_value("folding", "sections_unfolded", unfolds);
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ void EditorFolding::_set_unfolds(Object *p_object, const Vector<String> &p_unfol
|
||||||
|
|
||||||
void EditorFolding::load_resource_folding(RES p_resource, const String &p_path) {
|
void EditorFolding::load_resource_folding(RES p_resource, const String &p_path) {
|
||||||
Ref<ConfigFile> config;
|
Ref<ConfigFile> config;
|
||||||
config.instance();
|
config.instantiate();
|
||||||
|
|
||||||
String file = p_path.get_file() + "-folding-" + p_path.md5_text() + ".cfg";
|
String file = p_path.get_file() + "-folding-" + p_path.md5_text() + ".cfg";
|
||||||
file = EditorSettings::get_singleton()->get_project_settings_dir().plus_file(file);
|
file = EditorSettings::get_singleton()->get_project_settings_dir().plus_file(file);
|
||||||
|
@ -137,7 +137,7 @@ void EditorFolding::save_scene_folding(const Node *p_scene, const String &p_path
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<ConfigFile> config;
|
Ref<ConfigFile> config;
|
||||||
config.instance();
|
config.instantiate();
|
||||||
|
|
||||||
Array unfolds, res_unfolds;
|
Array unfolds, res_unfolds;
|
||||||
Set<RES> resources;
|
Set<RES> resources;
|
||||||
|
@ -155,7 +155,7 @@ void EditorFolding::save_scene_folding(const Node *p_scene, const String &p_path
|
||||||
|
|
||||||
void EditorFolding::load_scene_folding(Node *p_scene, const String &p_path) {
|
void EditorFolding::load_scene_folding(Node *p_scene, const String &p_path) {
|
||||||
Ref<ConfigFile> config;
|
Ref<ConfigFile> config;
|
||||||
config.instance();
|
config.instantiate();
|
||||||
|
|
||||||
String path = EditorSettings::get_singleton()->get_project_settings_dir();
|
String path = EditorSettings::get_singleton()->get_project_settings_dir();
|
||||||
String file = p_path.get_file() + "-folding-" + p_path.md5_text() + ".cfg";
|
String file = p_path.get_file() + "-folding-" + p_path.md5_text() + ".cfg";
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
// the custom spacings might only work with Noto Sans
|
// the custom spacings might only work with Noto Sans
|
||||||
#define MAKE_DEFAULT_FONT(m_name) \
|
#define MAKE_DEFAULT_FONT(m_name) \
|
||||||
Ref<Font> m_name; \
|
Ref<Font> m_name; \
|
||||||
m_name.instance(); \
|
m_name.instantiate(); \
|
||||||
if (CustomFont.is_valid()) { \
|
if (CustomFont.is_valid()) { \
|
||||||
m_name->add_data(CustomFont); \
|
m_name->add_data(CustomFont); \
|
||||||
m_name->add_data(DefaultFont); \
|
m_name->add_data(DefaultFont); \
|
||||||
|
@ -68,7 +68,7 @@
|
||||||
|
|
||||||
#define MAKE_BOLD_FONT(m_name) \
|
#define MAKE_BOLD_FONT(m_name) \
|
||||||
Ref<Font> m_name; \
|
Ref<Font> m_name; \
|
||||||
m_name.instance(); \
|
m_name.instantiate(); \
|
||||||
if (CustomFontBold.is_valid()) { \
|
if (CustomFontBold.is_valid()) { \
|
||||||
m_name->add_data(CustomFontBold); \
|
m_name->add_data(CustomFontBold); \
|
||||||
m_name->add_data(DefaultFontBold); \
|
m_name->add_data(DefaultFontBold); \
|
||||||
|
@ -81,7 +81,7 @@
|
||||||
|
|
||||||
#define MAKE_SOURCE_FONT(m_name) \
|
#define MAKE_SOURCE_FONT(m_name) \
|
||||||
Ref<Font> m_name; \
|
Ref<Font> m_name; \
|
||||||
m_name.instance(); \
|
m_name.instantiate(); \
|
||||||
if (CustomFontSource.is_valid()) { \
|
if (CustomFontSource.is_valid()) { \
|
||||||
m_name->add_data(CustomFontSource); \
|
m_name->add_data(CustomFontSource); \
|
||||||
m_name->add_data(dfmono); \
|
m_name->add_data(dfmono); \
|
||||||
|
@ -129,7 +129,7 @@ void editor_register_fonts(Ref<Theme> p_theme) {
|
||||||
String custom_font_path = EditorSettings::get_singleton()->get("interface/editor/main_font");
|
String custom_font_path = EditorSettings::get_singleton()->get("interface/editor/main_font");
|
||||||
Ref<FontData> CustomFont;
|
Ref<FontData> CustomFont;
|
||||||
if (custom_font_path.length() > 0 && dir->file_exists(custom_font_path)) {
|
if (custom_font_path.length() > 0 && dir->file_exists(custom_font_path)) {
|
||||||
CustomFont.instance();
|
CustomFont.instantiate();
|
||||||
CustomFont->load_resource(custom_font_path, default_font_size);
|
CustomFont->load_resource(custom_font_path, default_font_size);
|
||||||
CustomFont->set_antialiased(font_antialiased);
|
CustomFont->set_antialiased(font_antialiased);
|
||||||
CustomFont->set_hinting(font_hinting);
|
CustomFont->set_hinting(font_hinting);
|
||||||
|
@ -143,7 +143,7 @@ void editor_register_fonts(Ref<Theme> p_theme) {
|
||||||
String custom_font_path_bold = EditorSettings::get_singleton()->get("interface/editor/main_font_bold");
|
String custom_font_path_bold = EditorSettings::get_singleton()->get("interface/editor/main_font_bold");
|
||||||
Ref<FontData> CustomFontBold;
|
Ref<FontData> CustomFontBold;
|
||||||
if (custom_font_path_bold.length() > 0 && dir->file_exists(custom_font_path_bold)) {
|
if (custom_font_path_bold.length() > 0 && dir->file_exists(custom_font_path_bold)) {
|
||||||
CustomFontBold.instance();
|
CustomFontBold.instantiate();
|
||||||
CustomFontBold->load_resource(custom_font_path_bold, default_font_size);
|
CustomFontBold->load_resource(custom_font_path_bold, default_font_size);
|
||||||
CustomFontBold->set_antialiased(font_antialiased);
|
CustomFontBold->set_antialiased(font_antialiased);
|
||||||
CustomFontBold->set_hinting(font_hinting);
|
CustomFontBold->set_hinting(font_hinting);
|
||||||
|
@ -157,7 +157,7 @@ void editor_register_fonts(Ref<Theme> p_theme) {
|
||||||
String custom_font_path_source = EditorSettings::get_singleton()->get("interface/editor/code_font");
|
String custom_font_path_source = EditorSettings::get_singleton()->get("interface/editor/code_font");
|
||||||
Ref<FontData> CustomFontSource;
|
Ref<FontData> CustomFontSource;
|
||||||
if (custom_font_path_source.length() > 0 && dir->file_exists(custom_font_path_source)) {
|
if (custom_font_path_source.length() > 0 && dir->file_exists(custom_font_path_source)) {
|
||||||
CustomFontSource.instance();
|
CustomFontSource.instantiate();
|
||||||
CustomFontSource->load_resource(custom_font_path_source, default_font_size);
|
CustomFontSource->load_resource(custom_font_path_source, default_font_size);
|
||||||
CustomFontSource->set_antialiased(font_antialiased);
|
CustomFontSource->set_antialiased(font_antialiased);
|
||||||
CustomFontSource->set_hinting(font_hinting);
|
CustomFontSource->set_hinting(font_hinting);
|
||||||
|
@ -178,105 +178,105 @@ void editor_register_fonts(Ref<Theme> p_theme) {
|
||||||
/* Droid Sans */
|
/* Droid Sans */
|
||||||
|
|
||||||
Ref<FontData> DefaultFont;
|
Ref<FontData> DefaultFont;
|
||||||
DefaultFont.instance();
|
DefaultFont.instantiate();
|
||||||
DefaultFont->load_memory(_font_NotoSansUI_Regular, _font_NotoSansUI_Regular_size, "ttf", default_font_size);
|
DefaultFont->load_memory(_font_NotoSansUI_Regular, _font_NotoSansUI_Regular_size, "ttf", default_font_size);
|
||||||
DefaultFont->set_antialiased(font_antialiased);
|
DefaultFont->set_antialiased(font_antialiased);
|
||||||
DefaultFont->set_hinting(font_hinting);
|
DefaultFont->set_hinting(font_hinting);
|
||||||
DefaultFont->set_force_autohinter(true); //just looks better..i think?
|
DefaultFont->set_force_autohinter(true); //just looks better..i think?
|
||||||
|
|
||||||
Ref<FontData> DefaultFontBold;
|
Ref<FontData> DefaultFontBold;
|
||||||
DefaultFontBold.instance();
|
DefaultFontBold.instantiate();
|
||||||
DefaultFontBold->load_memory(_font_NotoSansUI_Bold, _font_NotoSansUI_Bold_size, "ttf", default_font_size);
|
DefaultFontBold->load_memory(_font_NotoSansUI_Bold, _font_NotoSansUI_Bold_size, "ttf", default_font_size);
|
||||||
DefaultFontBold->set_antialiased(font_antialiased);
|
DefaultFontBold->set_antialiased(font_antialiased);
|
||||||
DefaultFontBold->set_hinting(font_hinting);
|
DefaultFontBold->set_hinting(font_hinting);
|
||||||
DefaultFontBold->set_force_autohinter(true); // just looks better..i think?
|
DefaultFontBold->set_force_autohinter(true); // just looks better..i think?
|
||||||
|
|
||||||
Ref<FontData> FontFallback;
|
Ref<FontData> FontFallback;
|
||||||
FontFallback.instance();
|
FontFallback.instantiate();
|
||||||
FontFallback->load_memory(_font_DroidSansFallback, _font_DroidSansFallback_size, "ttf", default_font_size);
|
FontFallback->load_memory(_font_DroidSansFallback, _font_DroidSansFallback_size, "ttf", default_font_size);
|
||||||
FontFallback->set_antialiased(font_antialiased);
|
FontFallback->set_antialiased(font_antialiased);
|
||||||
FontFallback->set_hinting(font_hinting);
|
FontFallback->set_hinting(font_hinting);
|
||||||
FontFallback->set_force_autohinter(true); //just looks better..i think?
|
FontFallback->set_force_autohinter(true); //just looks better..i think?
|
||||||
|
|
||||||
Ref<FontData> FontJapanese;
|
Ref<FontData> FontJapanese;
|
||||||
FontJapanese.instance();
|
FontJapanese.instantiate();
|
||||||
FontJapanese->load_memory(_font_DroidSansJapanese, _font_DroidSansJapanese_size, "ttf", default_font_size);
|
FontJapanese->load_memory(_font_DroidSansJapanese, _font_DroidSansJapanese_size, "ttf", default_font_size);
|
||||||
FontJapanese->set_antialiased(font_antialiased);
|
FontJapanese->set_antialiased(font_antialiased);
|
||||||
FontJapanese->set_hinting(font_hinting);
|
FontJapanese->set_hinting(font_hinting);
|
||||||
FontJapanese->set_force_autohinter(true); //just looks better..i think?
|
FontJapanese->set_force_autohinter(true); //just looks better..i think?
|
||||||
|
|
||||||
Ref<FontData> FontArabic;
|
Ref<FontData> FontArabic;
|
||||||
FontArabic.instance();
|
FontArabic.instantiate();
|
||||||
FontArabic->load_memory(_font_NotoNaskhArabicUI_Regular, _font_NotoNaskhArabicUI_Regular_size, "ttf", default_font_size);
|
FontArabic->load_memory(_font_NotoNaskhArabicUI_Regular, _font_NotoNaskhArabicUI_Regular_size, "ttf", default_font_size);
|
||||||
FontArabic->set_antialiased(font_antialiased);
|
FontArabic->set_antialiased(font_antialiased);
|
||||||
FontArabic->set_hinting(font_hinting);
|
FontArabic->set_hinting(font_hinting);
|
||||||
FontArabic->set_force_autohinter(true); //just looks better..i think?
|
FontArabic->set_force_autohinter(true); //just looks better..i think?
|
||||||
|
|
||||||
Ref<FontData> FontBengali;
|
Ref<FontData> FontBengali;
|
||||||
FontBengali.instance();
|
FontBengali.instantiate();
|
||||||
FontBengali->load_memory(_font_NotoSansBengali_Regular, _font_NotoSansBengali_Regular_size, "ttf", default_font_size);
|
FontBengali->load_memory(_font_NotoSansBengali_Regular, _font_NotoSansBengali_Regular_size, "ttf", default_font_size);
|
||||||
FontBengali->set_antialiased(font_antialiased);
|
FontBengali->set_antialiased(font_antialiased);
|
||||||
FontBengali->set_hinting(font_hinting);
|
FontBengali->set_hinting(font_hinting);
|
||||||
FontBengali->set_force_autohinter(true); //just looks better..i think?
|
FontBengali->set_force_autohinter(true); //just looks better..i think?
|
||||||
|
|
||||||
Ref<FontData> FontGeorgian;
|
Ref<FontData> FontGeorgian;
|
||||||
FontGeorgian.instance();
|
FontGeorgian.instantiate();
|
||||||
FontGeorgian->load_memory(_font_NotoSansGeorgian_Regular, _font_NotoSansGeorgian_Regular_size, "ttf", default_font_size);
|
FontGeorgian->load_memory(_font_NotoSansGeorgian_Regular, _font_NotoSansGeorgian_Regular_size, "ttf", default_font_size);
|
||||||
FontGeorgian->set_antialiased(font_antialiased);
|
FontGeorgian->set_antialiased(font_antialiased);
|
||||||
FontGeorgian->set_hinting(font_hinting);
|
FontGeorgian->set_hinting(font_hinting);
|
||||||
FontGeorgian->set_force_autohinter(true); //just looks better..i think?
|
FontGeorgian->set_force_autohinter(true); //just looks better..i think?
|
||||||
|
|
||||||
Ref<FontData> FontHebrew;
|
Ref<FontData> FontHebrew;
|
||||||
FontHebrew.instance();
|
FontHebrew.instantiate();
|
||||||
FontHebrew->load_memory(_font_NotoSansHebrew_Regular, _font_NotoSansHebrew_Regular_size, "ttf", default_font_size);
|
FontHebrew->load_memory(_font_NotoSansHebrew_Regular, _font_NotoSansHebrew_Regular_size, "ttf", default_font_size);
|
||||||
FontHebrew->set_antialiased(font_antialiased);
|
FontHebrew->set_antialiased(font_antialiased);
|
||||||
FontHebrew->set_hinting(font_hinting);
|
FontHebrew->set_hinting(font_hinting);
|
||||||
FontHebrew->set_force_autohinter(true); //just looks better..i think?
|
FontHebrew->set_force_autohinter(true); //just looks better..i think?
|
||||||
|
|
||||||
Ref<FontData> FontMalayalam;
|
Ref<FontData> FontMalayalam;
|
||||||
FontMalayalam.instance();
|
FontMalayalam.instantiate();
|
||||||
FontMalayalam->load_memory(_font_NotoSansMalayalamUI_Regular, _font_NotoSansMalayalamUI_Regular_size, "ttf", default_font_size);
|
FontMalayalam->load_memory(_font_NotoSansMalayalamUI_Regular, _font_NotoSansMalayalamUI_Regular_size, "ttf", default_font_size);
|
||||||
FontMalayalam->set_antialiased(font_antialiased);
|
FontMalayalam->set_antialiased(font_antialiased);
|
||||||
FontMalayalam->set_hinting(font_hinting);
|
FontMalayalam->set_hinting(font_hinting);
|
||||||
FontMalayalam->set_force_autohinter(true); //just looks better..i think?
|
FontMalayalam->set_force_autohinter(true); //just looks better..i think?
|
||||||
|
|
||||||
Ref<FontData> FontOriya;
|
Ref<FontData> FontOriya;
|
||||||
FontOriya.instance();
|
FontOriya.instantiate();
|
||||||
FontOriya->load_memory(_font_NotoSansOriyaUI_Regular, _font_NotoSansOriyaUI_Regular_size, "ttf", default_font_size);
|
FontOriya->load_memory(_font_NotoSansOriyaUI_Regular, _font_NotoSansOriyaUI_Regular_size, "ttf", default_font_size);
|
||||||
FontOriya->set_antialiased(font_antialiased);
|
FontOriya->set_antialiased(font_antialiased);
|
||||||
FontOriya->set_hinting(font_hinting);
|
FontOriya->set_hinting(font_hinting);
|
||||||
FontOriya->set_force_autohinter(true); //just looks better..i think?
|
FontOriya->set_force_autohinter(true); //just looks better..i think?
|
||||||
|
|
||||||
Ref<FontData> FontSinhala;
|
Ref<FontData> FontSinhala;
|
||||||
FontSinhala.instance();
|
FontSinhala.instantiate();
|
||||||
FontSinhala->load_memory(_font_NotoSansSinhalaUI_Regular, _font_NotoSansSinhalaUI_Regular_size, "ttf", default_font_size);
|
FontSinhala->load_memory(_font_NotoSansSinhalaUI_Regular, _font_NotoSansSinhalaUI_Regular_size, "ttf", default_font_size);
|
||||||
FontSinhala->set_antialiased(font_antialiased);
|
FontSinhala->set_antialiased(font_antialiased);
|
||||||
FontSinhala->set_hinting(font_hinting);
|
FontSinhala->set_hinting(font_hinting);
|
||||||
FontSinhala->set_force_autohinter(true); //just looks better..i think?
|
FontSinhala->set_force_autohinter(true); //just looks better..i think?
|
||||||
|
|
||||||
Ref<FontData> FontTamil;
|
Ref<FontData> FontTamil;
|
||||||
FontTamil.instance();
|
FontTamil.instantiate();
|
||||||
FontTamil->load_memory(_font_NotoSansTamilUI_Regular, _font_NotoSansTamilUI_Regular_size, "ttf", default_font_size);
|
FontTamil->load_memory(_font_NotoSansTamilUI_Regular, _font_NotoSansTamilUI_Regular_size, "ttf", default_font_size);
|
||||||
FontTamil->set_antialiased(font_antialiased);
|
FontTamil->set_antialiased(font_antialiased);
|
||||||
FontTamil->set_hinting(font_hinting);
|
FontTamil->set_hinting(font_hinting);
|
||||||
FontTamil->set_force_autohinter(true); //just looks better..i think?
|
FontTamil->set_force_autohinter(true); //just looks better..i think?
|
||||||
|
|
||||||
Ref<FontData> FontTelugu;
|
Ref<FontData> FontTelugu;
|
||||||
FontTelugu.instance();
|
FontTelugu.instantiate();
|
||||||
FontTelugu->load_memory(_font_NotoSansTeluguUI_Regular, _font_NotoSansTeluguUI_Regular_size, "ttf", default_font_size);
|
FontTelugu->load_memory(_font_NotoSansTeluguUI_Regular, _font_NotoSansTeluguUI_Regular_size, "ttf", default_font_size);
|
||||||
FontTelugu->set_antialiased(font_antialiased);
|
FontTelugu->set_antialiased(font_antialiased);
|
||||||
FontTelugu->set_hinting(font_hinting);
|
FontTelugu->set_hinting(font_hinting);
|
||||||
FontTelugu->set_force_autohinter(true); //just looks better..i think?
|
FontTelugu->set_force_autohinter(true); //just looks better..i think?
|
||||||
|
|
||||||
Ref<FontData> FontThai;
|
Ref<FontData> FontThai;
|
||||||
FontThai.instance();
|
FontThai.instantiate();
|
||||||
FontThai->load_memory(_font_NotoSansThaiUI_Regular, _font_NotoSansThaiUI_Regular_size, "ttf", default_font_size);
|
FontThai->load_memory(_font_NotoSansThaiUI_Regular, _font_NotoSansThaiUI_Regular_size, "ttf", default_font_size);
|
||||||
FontThai->set_antialiased(font_antialiased);
|
FontThai->set_antialiased(font_antialiased);
|
||||||
FontThai->set_hinting(font_hinting);
|
FontThai->set_hinting(font_hinting);
|
||||||
FontThai->set_force_autohinter(true); //just looks better..i think?
|
FontThai->set_force_autohinter(true); //just looks better..i think?
|
||||||
|
|
||||||
Ref<FontData> FontHindi;
|
Ref<FontData> FontHindi;
|
||||||
FontHindi.instance();
|
FontHindi.instantiate();
|
||||||
FontHindi->load_memory(_font_NotoSansDevanagariUI_Regular, _font_NotoSansDevanagariUI_Regular_size, "ttf", default_font_size);
|
FontHindi->load_memory(_font_NotoSansDevanagariUI_Regular, _font_NotoSansDevanagariUI_Regular_size, "ttf", default_font_size);
|
||||||
FontHindi->set_antialiased(font_antialiased);
|
FontHindi->set_antialiased(font_antialiased);
|
||||||
FontHindi->set_hinting(font_hinting);
|
FontHindi->set_hinting(font_hinting);
|
||||||
|
@ -285,7 +285,7 @@ void editor_register_fonts(Ref<Theme> p_theme) {
|
||||||
/* Hack */
|
/* Hack */
|
||||||
|
|
||||||
Ref<FontData> dfmono;
|
Ref<FontData> dfmono;
|
||||||
dfmono.instance();
|
dfmono.instantiate();
|
||||||
dfmono->load_memory(_font_Hack_Regular, _font_Hack_Regular_size, "ttf", default_font_size);
|
dfmono->load_memory(_font_Hack_Regular, _font_Hack_Regular_size, "ttf", default_font_size);
|
||||||
dfmono->set_antialiased(font_antialiased);
|
dfmono->set_antialiased(font_antialiased);
|
||||||
dfmono->set_hinting(font_hinting);
|
dfmono->set_hinting(font_hinting);
|
||||||
|
|
|
@ -417,7 +417,7 @@ bool EditorPropertyRevert::may_node_be_in_instance(Node *p_node) {
|
||||||
return might_be; // or might not be
|
return might_be; // or might not be
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EditorPropertyRevert::get_instanced_node_original_property(Node *p_node, const StringName &p_prop, Variant &value) {
|
bool EditorPropertyRevert::get_instantiated_node_original_property(Node *p_node, const StringName &p_prop, Variant &value) {
|
||||||
Node *node = p_node;
|
Node *node = p_node;
|
||||||
Node *orig = node;
|
Node *orig = node;
|
||||||
|
|
||||||
|
@ -524,7 +524,7 @@ bool EditorPropertyRevert::can_property_revert(Object *p_object, const StringNam
|
||||||
if (node && EditorPropertyRevert::may_node_be_in_instance(node)) {
|
if (node && EditorPropertyRevert::may_node_be_in_instance(node)) {
|
||||||
//check for difference including instantiation
|
//check for difference including instantiation
|
||||||
Variant vorig;
|
Variant vorig;
|
||||||
if (EditorPropertyRevert::get_instanced_node_original_property(node, p_property, vorig)) {
|
if (EditorPropertyRevert::get_instantiated_node_original_property(node, p_property, vorig)) {
|
||||||
Variant v = p_object->get(p_property);
|
Variant v = p_object->get(p_property);
|
||||||
|
|
||||||
if (EditorPropertyRevert::is_node_property_different(node, v, vorig)) {
|
if (EditorPropertyRevert::is_node_property_different(node, v, vorig)) {
|
||||||
|
@ -764,7 +764,7 @@ void EditorProperty::_gui_input(const Ref<InputEvent> &p_event) {
|
||||||
Variant vorig;
|
Variant vorig;
|
||||||
|
|
||||||
Node *node = Object::cast_to<Node>(object);
|
Node *node = Object::cast_to<Node>(object);
|
||||||
if (node && EditorPropertyRevert::may_node_be_in_instance(node) && EditorPropertyRevert::get_instanced_node_original_property(node, property, vorig)) {
|
if (node && EditorPropertyRevert::may_node_be_in_instance(node) && EditorPropertyRevert::get_instantiated_node_original_property(node, property, vorig)) {
|
||||||
emit_changed(property, vorig.duplicate(true));
|
emit_changed(property, vorig.duplicate(true));
|
||||||
update_property();
|
update_property();
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -40,7 +40,7 @@ class UndoRedo;
|
||||||
class EditorPropertyRevert {
|
class EditorPropertyRevert {
|
||||||
public:
|
public:
|
||||||
static bool may_node_be_in_instance(Node *p_node);
|
static bool may_node_be_in_instance(Node *p_node);
|
||||||
static bool get_instanced_node_original_property(Node *p_node, const StringName &p_prop, Variant &value);
|
static bool get_instantiated_node_original_property(Node *p_node, const StringName &p_prop, Variant &value);
|
||||||
static bool is_node_property_different(Node *p_node, const Variant &p_current, const Variant &p_orig);
|
static bool is_node_property_different(Node *p_node, const Variant &p_current, const Variant &p_orig);
|
||||||
|
|
||||||
static bool can_property_revert(Object *p_object, const StringName &p_property);
|
static bool can_property_revert(Object *p_object, const StringName &p_property);
|
||||||
|
@ -83,7 +83,7 @@ private:
|
||||||
bool draw_top_bg;
|
bool draw_top_bg;
|
||||||
|
|
||||||
bool _is_property_different(const Variant &p_current, const Variant &p_orig);
|
bool _is_property_different(const Variant &p_current, const Variant &p_orig);
|
||||||
bool _get_instanced_node_original_property(const StringName &p_prop, Variant &value);
|
bool _get_instantiated_node_original_property(const StringName &p_prop, Variant &value);
|
||||||
void _focusable_focused(int p_index);
|
void _focusable_focused(int p_index);
|
||||||
|
|
||||||
bool selectable;
|
bool selectable;
|
||||||
|
@ -271,7 +271,7 @@ class EditorInspector : public ScrollContainer {
|
||||||
|
|
||||||
VBoxContainer *main_vbox;
|
VBoxContainer *main_vbox;
|
||||||
|
|
||||||
//map use to cache the instanced editors
|
//map use to cache the instantiated editors
|
||||||
Map<StringName, List<EditorProperty *>> editor_property_map;
|
Map<StringName, List<EditorProperty *>> editor_property_map;
|
||||||
List<EditorInspectorSection *> sections;
|
List<EditorInspectorSection *> sections;
|
||||||
Set<StringName> pending;
|
Set<StringName> pending;
|
||||||
|
|
|
@ -83,7 +83,7 @@ void EditorLayoutsDialog::_post_popup() {
|
||||||
layout_names->clear();
|
layout_names->clear();
|
||||||
|
|
||||||
Ref<ConfigFile> config;
|
Ref<ConfigFile> config;
|
||||||
config.instance();
|
config.instantiate();
|
||||||
Error err = config->load(EditorSettings::get_singleton()->get_editor_layouts_config());
|
Error err = config->load(EditorSettings::get_singleton()->get_editor_layouts_config());
|
||||||
if (err != OK) {
|
if (err != OK) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -103,7 +103,7 @@ void EditorLog::_start_state_save_timer() {
|
||||||
|
|
||||||
void EditorLog::_save_state() {
|
void EditorLog::_save_state() {
|
||||||
Ref<ConfigFile> config;
|
Ref<ConfigFile> config;
|
||||||
config.instance();
|
config.instantiate();
|
||||||
// Load and amend existing config if it exists.
|
// Load and amend existing config if it exists.
|
||||||
config->load(EditorSettings::get_singleton()->get_project_settings_dir().plus_file("editor_layout.cfg"));
|
config->load(EditorSettings::get_singleton()->get_project_settings_dir().plus_file("editor_layout.cfg"));
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ void EditorLog::_load_state() {
|
||||||
is_loading_state = true;
|
is_loading_state = true;
|
||||||
|
|
||||||
Ref<ConfigFile> config;
|
Ref<ConfigFile> config;
|
||||||
config.instance();
|
config.instantiate();
|
||||||
Error err = config->load(EditorSettings::get_singleton()->get_project_settings_dir().plus_file("editor_layout.cfg"));
|
Error err = config->load(EditorSettings::get_singleton()->get_project_settings_dir().plus_file("editor_layout.cfg"));
|
||||||
|
|
||||||
if (err == OK) {
|
if (err == OK) {
|
||||||
|
|
|
@ -1243,7 +1243,7 @@ void EditorNode::_get_scene_metadata(const String &p_file) {
|
||||||
String path = EditorSettings::get_singleton()->get_project_settings_dir().plus_file(p_file.get_file() + "-editstate-" + p_file.md5_text() + ".cfg");
|
String path = EditorSettings::get_singleton()->get_project_settings_dir().plus_file(p_file.get_file() + "-editstate-" + p_file.md5_text() + ".cfg");
|
||||||
|
|
||||||
Ref<ConfigFile> cf;
|
Ref<ConfigFile> cf;
|
||||||
cf.instance();
|
cf.instantiate();
|
||||||
|
|
||||||
Error err = cf->load(path);
|
Error err = cf->load(path);
|
||||||
if (err != OK || !cf->has_section("editor_states")) {
|
if (err != OK || !cf->has_section("editor_states")) {
|
||||||
|
@ -1277,7 +1277,7 @@ void EditorNode::_set_scene_metadata(const String &p_file, int p_idx) {
|
||||||
String path = EditorSettings::get_singleton()->get_project_settings_dir().plus_file(p_file.get_file() + "-editstate-" + p_file.md5_text() + ".cfg");
|
String path = EditorSettings::get_singleton()->get_project_settings_dir().plus_file(p_file.get_file() + "-editstate-" + p_file.md5_text() + ".cfg");
|
||||||
|
|
||||||
Ref<ConfigFile> cf;
|
Ref<ConfigFile> cf;
|
||||||
cf.instance();
|
cf.instantiate();
|
||||||
|
|
||||||
Dictionary md;
|
Dictionary md;
|
||||||
|
|
||||||
|
@ -1422,7 +1422,7 @@ void EditorNode::_save_scene_with_preview(String p_file, int p_idx) {
|
||||||
// We cannot fallback on the 2D editor, because it may not have been used yet,
|
// We cannot fallback on the 2D editor, because it may not have been used yet,
|
||||||
// which would result in an invalid texture.
|
// which would result in an invalid texture.
|
||||||
if (c3d == 0 && c2d == 0) {
|
if (c3d == 0 && c2d == 0) {
|
||||||
img.instance();
|
img.instantiate();
|
||||||
img->create(1, 1, false, Image::FORMAT_RGB8);
|
img->create(1, 1, false, Image::FORMAT_RGB8);
|
||||||
} else if (c3d < c2d) {
|
} else if (c3d < c2d) {
|
||||||
Ref<ViewportTexture> viewport_texture = scene_root->get_texture();
|
Ref<ViewportTexture> viewport_texture = scene_root->get_texture();
|
||||||
|
@ -1607,16 +1607,16 @@ void EditorNode::_save_scene(String p_file, int idx) {
|
||||||
if (ResourceCache::has(p_file)) {
|
if (ResourceCache::has(p_file)) {
|
||||||
// something may be referencing this resource and we are good with that.
|
// something may be referencing this resource and we are good with that.
|
||||||
// we must update it, but also let the previous scene state go, as
|
// we must update it, but also let the previous scene state go, as
|
||||||
// old version still work for referencing changes in instanced or inherited scenes
|
// old version still work for referencing changes in instantiated or inherited scenes
|
||||||
|
|
||||||
sdata = Ref<PackedScene>(Object::cast_to<PackedScene>(ResourceCache::get(p_file)));
|
sdata = Ref<PackedScene>(Object::cast_to<PackedScene>(ResourceCache::get(p_file)));
|
||||||
if (sdata.is_valid()) {
|
if (sdata.is_valid()) {
|
||||||
sdata->recreate_state();
|
sdata->recreate_state();
|
||||||
} else {
|
} else {
|
||||||
sdata.instance();
|
sdata.instantiate();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sdata.instance();
|
sdata.instantiate();
|
||||||
}
|
}
|
||||||
Error err = sdata->pack(scene);
|
Error err = sdata->pack(scene);
|
||||||
|
|
||||||
|
@ -1840,11 +1840,11 @@ void EditorNode::_dialog_action(String p_file) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<ConfigFile> config;
|
Ref<ConfigFile> config;
|
||||||
config.instance();
|
config.instantiate();
|
||||||
Error err = config->load(EditorSettings::get_singleton()->get_editor_layouts_config());
|
Error err = config->load(EditorSettings::get_singleton()->get_editor_layouts_config());
|
||||||
|
|
||||||
if (err == ERR_FILE_CANT_OPEN || err == ERR_FILE_NOT_FOUND) {
|
if (err == ERR_FILE_CANT_OPEN || err == ERR_FILE_NOT_FOUND) {
|
||||||
config.instance(); // new config
|
config.instantiate(); // new config
|
||||||
} else if (err != OK) {
|
} else if (err != OK) {
|
||||||
show_warning(TTR("An error occurred while trying to save the editor layout.\nMake sure the editor's user data path is writable."));
|
show_warning(TTR("An error occurred while trying to save the editor layout.\nMake sure the editor's user data path is writable."));
|
||||||
return;
|
return;
|
||||||
|
@ -1868,7 +1868,7 @@ void EditorNode::_dialog_action(String p_file) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<ConfigFile> config;
|
Ref<ConfigFile> config;
|
||||||
config.instance();
|
config.instantiate();
|
||||||
Error err = config->load(EditorSettings::get_singleton()->get_editor_layouts_config());
|
Error err = config->load(EditorSettings::get_singleton()->get_editor_layouts_config());
|
||||||
|
|
||||||
if (err != OK || !config->has_section(p_file)) {
|
if (err != OK || !config->has_section(p_file)) {
|
||||||
|
@ -2073,7 +2073,7 @@ void EditorNode::_edit_current() {
|
||||||
editable_warning = TTR("This resource belongs to a scene that was imported, so it's not editable.\nPlease read the documentation relevant to importing scenes to better understand this workflow.");
|
editable_warning = TTR("This resource belongs to a scene that was imported, so it's not editable.\nPlease read the documentation relevant to importing scenes to better understand this workflow.");
|
||||||
} else {
|
} else {
|
||||||
if ((!get_edited_scene() || get_edited_scene()->get_filename() != base_path) && ResourceLoader::get_resource_type(base_path) == "PackedScene") {
|
if ((!get_edited_scene() || get_edited_scene()->get_filename() != base_path) && ResourceLoader::get_resource_type(base_path) == "PackedScene") {
|
||||||
editable_warning = TTR("This resource belongs to a scene that was instanced or inherited.\nChanges to it won't be kept when saving the current scene.");
|
editable_warning = TTR("This resource belongs to a scene that was instantiated or inherited.\nChanges to it won't be kept when saving the current scene.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (current_res->get_path().is_resource_file()) {
|
} else if (current_res->get_path().is_resource_file()) {
|
||||||
|
@ -3135,7 +3135,7 @@ void EditorNode::set_addon_plugin_enabled(const String &p_addon, bool p_enabled,
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<ConfigFile> cf;
|
Ref<ConfigFile> cf;
|
||||||
cf.instance();
|
cf.instantiate();
|
||||||
if (!DirAccess::exists(p_addon.get_base_dir())) {
|
if (!DirAccess::exists(p_addon.get_base_dir())) {
|
||||||
_remove_plugin_from_enabled(p_addon);
|
_remove_plugin_from_enabled(p_addon);
|
||||||
WARN_PRINT("Addon '" + p_addon + "' failed to load. No directory found. Removing from enabled plugins.");
|
WARN_PRINT("Addon '" + p_addon + "' failed to load. No directory found. Removing from enabled plugins.");
|
||||||
|
@ -3516,7 +3516,7 @@ Error EditorNode::load_scene(const String &p_scene, bool p_ignore_broken_deps, b
|
||||||
sdata->set_path(lpath, true); //take over path
|
sdata->set_path(lpath, true); //take over path
|
||||||
}
|
}
|
||||||
|
|
||||||
Node *new_scene = sdata->instance(PackedScene::GEN_EDIT_STATE_MAIN);
|
Node *new_scene = sdata->instantiate(PackedScene::GEN_EDIT_STATE_MAIN);
|
||||||
|
|
||||||
if (!new_scene) {
|
if (!new_scene) {
|
||||||
sdata.unref();
|
sdata.unref();
|
||||||
|
@ -3580,11 +3580,11 @@ void EditorNode::open_request(const String &p_path) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorNode::request_instance_scene(const String &p_path) {
|
void EditorNode::request_instance_scene(const String &p_path) {
|
||||||
scene_tree_dock->instance(p_path);
|
scene_tree_dock->instantiate(p_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorNode::request_instance_scenes(const Vector<String> &p_files) {
|
void EditorNode::request_instantiate_scenes(const Vector<String> &p_files) {
|
||||||
scene_tree_dock->instance_scenes(p_files);
|
scene_tree_dock->instantiate_scenes(p_files);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImportDock *EditorNode::get_import_dock() {
|
ImportDock *EditorNode::get_import_dock() {
|
||||||
|
@ -3608,8 +3608,8 @@ void EditorNode::_inherit_request(String p_file) {
|
||||||
_dialog_action(p_file);
|
_dialog_action(p_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorNode::_instance_request(const Vector<String> &p_files) {
|
void EditorNode::_instantiate_request(const Vector<String> &p_files) {
|
||||||
request_instance_scenes(p_files);
|
request_instantiate_scenes(p_files);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorNode::_close_messages() {
|
void EditorNode::_close_messages() {
|
||||||
|
@ -4343,7 +4343,7 @@ void EditorNode::_save_docks() {
|
||||||
return; //scanning, do not touch docks
|
return; //scanning, do not touch docks
|
||||||
}
|
}
|
||||||
Ref<ConfigFile> config;
|
Ref<ConfigFile> config;
|
||||||
config.instance();
|
config.instantiate();
|
||||||
// Load and amend existing config if it exists.
|
// Load and amend existing config if it exists.
|
||||||
config->load(EditorSettings::get_singleton()->get_project_settings_dir().plus_file("editor_layout.cfg"));
|
config->load(EditorSettings::get_singleton()->get_project_settings_dir().plus_file("editor_layout.cfg"));
|
||||||
|
|
||||||
|
@ -4408,7 +4408,7 @@ void EditorNode::_dock_split_dragged(int ofs) {
|
||||||
|
|
||||||
void EditorNode::_load_docks() {
|
void EditorNode::_load_docks() {
|
||||||
Ref<ConfigFile> config;
|
Ref<ConfigFile> config;
|
||||||
config.instance();
|
config.instantiate();
|
||||||
Error err = config->load(EditorSettings::get_singleton()->get_project_settings_dir().plus_file("editor_layout.cfg"));
|
Error err = config->load(EditorSettings::get_singleton()->get_project_settings_dir().plus_file("editor_layout.cfg"));
|
||||||
if (err != OK) {
|
if (err != OK) {
|
||||||
//no config
|
//no config
|
||||||
|
@ -4641,7 +4641,7 @@ bool EditorNode::has_scenes_in_session() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Ref<ConfigFile> config;
|
Ref<ConfigFile> config;
|
||||||
config.instance();
|
config.instantiate();
|
||||||
Error err = config->load(EditorSettings::get_singleton()->get_project_settings_dir().plus_file("editor_layout.cfg"));
|
Error err = config->load(EditorSettings::get_singleton()->get_project_settings_dir().plus_file("editor_layout.cfg"));
|
||||||
if (err != OK) {
|
if (err != OK) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -4734,7 +4734,7 @@ void EditorNode::_update_layouts_menu() {
|
||||||
editor_layouts->add_shortcut(ED_SHORTCUT("layout/default", TTR("Default")), SETTINGS_LAYOUT_DEFAULT);
|
editor_layouts->add_shortcut(ED_SHORTCUT("layout/default", TTR("Default")), SETTINGS_LAYOUT_DEFAULT);
|
||||||
|
|
||||||
Ref<ConfigFile> config;
|
Ref<ConfigFile> config;
|
||||||
config.instance();
|
config.instantiate();
|
||||||
Error err = config->load(EditorSettings::get_singleton()->get_editor_layouts_config());
|
Error err = config->load(EditorSettings::get_singleton()->get_editor_layouts_config());
|
||||||
if (err != OK) {
|
if (err != OK) {
|
||||||
return; //no config
|
return; //no config
|
||||||
|
@ -4777,7 +4777,7 @@ void EditorNode::_layout_menu_option(int p_id) {
|
||||||
} break;
|
} break;
|
||||||
default: {
|
default: {
|
||||||
Ref<ConfigFile> config;
|
Ref<ConfigFile> config;
|
||||||
config.instance();
|
config.instantiate();
|
||||||
Error err = config->load(EditorSettings::get_singleton()->get_editor_layouts_config());
|
Error err = config->load(EditorSettings::get_singleton()->get_editor_layouts_config());
|
||||||
if (err != OK) {
|
if (err != OK) {
|
||||||
return; //no config
|
return; //no config
|
||||||
|
@ -5328,7 +5328,7 @@ void EditorNode::reload_scene(const String &p_path) {
|
||||||
|
|
||||||
if (scene_idx == -1) {
|
if (scene_idx == -1) {
|
||||||
if (get_edited_scene()) {
|
if (get_edited_scene()) {
|
||||||
//scene is not open, so at it might be instanced. We'll refresh the whole scene later.
|
//scene is not open, so at it might be instantiated. We'll refresh the whole scene later.
|
||||||
editor_data.get_undo_redo().clear_history();
|
editor_data.get_undo_redo().clear_history();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -5725,87 +5725,87 @@ EditorNode::EditorNode() {
|
||||||
|
|
||||||
{ //register importers at the beginning, so dialogs are created with the right extensions
|
{ //register importers at the beginning, so dialogs are created with the right extensions
|
||||||
Ref<ResourceImporterTexture> import_texture;
|
Ref<ResourceImporterTexture> import_texture;
|
||||||
import_texture.instance();
|
import_texture.instantiate();
|
||||||
ResourceFormatImporter::get_singleton()->add_importer(import_texture);
|
ResourceFormatImporter::get_singleton()->add_importer(import_texture);
|
||||||
|
|
||||||
Ref<ResourceImporterLayeredTexture> import_cubemap;
|
Ref<ResourceImporterLayeredTexture> import_cubemap;
|
||||||
import_cubemap.instance();
|
import_cubemap.instantiate();
|
||||||
import_cubemap->set_mode(ResourceImporterLayeredTexture::MODE_CUBEMAP);
|
import_cubemap->set_mode(ResourceImporterLayeredTexture::MODE_CUBEMAP);
|
||||||
ResourceFormatImporter::get_singleton()->add_importer(import_cubemap);
|
ResourceFormatImporter::get_singleton()->add_importer(import_cubemap);
|
||||||
|
|
||||||
Ref<ResourceImporterLayeredTexture> import_array;
|
Ref<ResourceImporterLayeredTexture> import_array;
|
||||||
import_array.instance();
|
import_array.instantiate();
|
||||||
import_array->set_mode(ResourceImporterLayeredTexture::MODE_2D_ARRAY);
|
import_array->set_mode(ResourceImporterLayeredTexture::MODE_2D_ARRAY);
|
||||||
ResourceFormatImporter::get_singleton()->add_importer(import_array);
|
ResourceFormatImporter::get_singleton()->add_importer(import_array);
|
||||||
|
|
||||||
Ref<ResourceImporterLayeredTexture> import_cubemap_array;
|
Ref<ResourceImporterLayeredTexture> import_cubemap_array;
|
||||||
import_cubemap_array.instance();
|
import_cubemap_array.instantiate();
|
||||||
import_cubemap_array->set_mode(ResourceImporterLayeredTexture::MODE_CUBEMAP_ARRAY);
|
import_cubemap_array->set_mode(ResourceImporterLayeredTexture::MODE_CUBEMAP_ARRAY);
|
||||||
ResourceFormatImporter::get_singleton()->add_importer(import_cubemap_array);
|
ResourceFormatImporter::get_singleton()->add_importer(import_cubemap_array);
|
||||||
|
|
||||||
Ref<ResourceImporterLayeredTexture> import_3d;
|
Ref<ResourceImporterLayeredTexture> import_3d;
|
||||||
import_3d.instance();
|
import_3d.instantiate();
|
||||||
import_3d->set_mode(ResourceImporterLayeredTexture::MODE_3D);
|
import_3d->set_mode(ResourceImporterLayeredTexture::MODE_3D);
|
||||||
ResourceFormatImporter::get_singleton()->add_importer(import_3d);
|
ResourceFormatImporter::get_singleton()->add_importer(import_3d);
|
||||||
|
|
||||||
Ref<ResourceImporterImage> import_image;
|
Ref<ResourceImporterImage> import_image;
|
||||||
import_image.instance();
|
import_image.instantiate();
|
||||||
ResourceFormatImporter::get_singleton()->add_importer(import_image);
|
ResourceFormatImporter::get_singleton()->add_importer(import_image);
|
||||||
|
|
||||||
Ref<ResourceImporterTextureAtlas> import_texture_atlas;
|
Ref<ResourceImporterTextureAtlas> import_texture_atlas;
|
||||||
import_texture_atlas.instance();
|
import_texture_atlas.instantiate();
|
||||||
ResourceFormatImporter::get_singleton()->add_importer(import_texture_atlas);
|
ResourceFormatImporter::get_singleton()->add_importer(import_texture_atlas);
|
||||||
|
|
||||||
Ref<ResourceImporterCSVTranslation> import_csv_translation;
|
Ref<ResourceImporterCSVTranslation> import_csv_translation;
|
||||||
import_csv_translation.instance();
|
import_csv_translation.instantiate();
|
||||||
ResourceFormatImporter::get_singleton()->add_importer(import_csv_translation);
|
ResourceFormatImporter::get_singleton()->add_importer(import_csv_translation);
|
||||||
|
|
||||||
Ref<ResourceImporterWAV> import_wav;
|
Ref<ResourceImporterWAV> import_wav;
|
||||||
import_wav.instance();
|
import_wav.instantiate();
|
||||||
ResourceFormatImporter::get_singleton()->add_importer(import_wav);
|
ResourceFormatImporter::get_singleton()->add_importer(import_wav);
|
||||||
|
|
||||||
Ref<ResourceImporterOBJ> import_obj;
|
Ref<ResourceImporterOBJ> import_obj;
|
||||||
import_obj.instance();
|
import_obj.instantiate();
|
||||||
ResourceFormatImporter::get_singleton()->add_importer(import_obj);
|
ResourceFormatImporter::get_singleton()->add_importer(import_obj);
|
||||||
|
|
||||||
Ref<ResourceImporterShaderFile> import_shader_file;
|
Ref<ResourceImporterShaderFile> import_shader_file;
|
||||||
import_shader_file.instance();
|
import_shader_file.instantiate();
|
||||||
ResourceFormatImporter::get_singleton()->add_importer(import_shader_file);
|
ResourceFormatImporter::get_singleton()->add_importer(import_shader_file);
|
||||||
|
|
||||||
Ref<ResourceImporterScene> import_scene;
|
Ref<ResourceImporterScene> import_scene;
|
||||||
import_scene.instance();
|
import_scene.instantiate();
|
||||||
ResourceFormatImporter::get_singleton()->add_importer(import_scene);
|
ResourceFormatImporter::get_singleton()->add_importer(import_scene);
|
||||||
|
|
||||||
{
|
{
|
||||||
Ref<EditorSceneImporterCollada> import_collada;
|
Ref<EditorSceneImporterCollada> import_collada;
|
||||||
import_collada.instance();
|
import_collada.instantiate();
|
||||||
import_scene->add_importer(import_collada);
|
import_scene->add_importer(import_collada);
|
||||||
|
|
||||||
Ref<EditorOBJImporter> import_obj2;
|
Ref<EditorOBJImporter> import_obj2;
|
||||||
import_obj2.instance();
|
import_obj2.instantiate();
|
||||||
import_scene->add_importer(import_obj2);
|
import_scene->add_importer(import_obj2);
|
||||||
|
|
||||||
Ref<EditorSceneImporterESCN> import_escn;
|
Ref<EditorSceneImporterESCN> import_escn;
|
||||||
import_escn.instance();
|
import_escn.instantiate();
|
||||||
import_scene->add_importer(import_escn);
|
import_scene->add_importer(import_escn);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<ResourceImporterBitMap> import_bitmap;
|
Ref<ResourceImporterBitMap> import_bitmap;
|
||||||
import_bitmap.instance();
|
import_bitmap.instantiate();
|
||||||
ResourceFormatImporter::get_singleton()->add_importer(import_bitmap);
|
ResourceFormatImporter::get_singleton()->add_importer(import_bitmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
Ref<EditorInspectorDefaultPlugin> eidp;
|
Ref<EditorInspectorDefaultPlugin> eidp;
|
||||||
eidp.instance();
|
eidp.instantiate();
|
||||||
EditorInspector::add_inspector_plugin(eidp);
|
EditorInspector::add_inspector_plugin(eidp);
|
||||||
|
|
||||||
Ref<EditorInspectorRootMotionPlugin> rmp;
|
Ref<EditorInspectorRootMotionPlugin> rmp;
|
||||||
rmp.instance();
|
rmp.instantiate();
|
||||||
EditorInspector::add_inspector_plugin(rmp);
|
EditorInspector::add_inspector_plugin(rmp);
|
||||||
|
|
||||||
Ref<EditorInspectorShaderModePlugin> smp;
|
Ref<EditorInspectorShaderModePlugin> smp;
|
||||||
smp.instance();
|
smp.instantiate();
|
||||||
EditorInspector::add_inspector_plugin(smp);
|
EditorInspector::add_inspector_plugin(smp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6508,7 +6508,7 @@ EditorNode::EditorNode() {
|
||||||
|
|
||||||
filesystem_dock = memnew(FileSystemDock(this));
|
filesystem_dock = memnew(FileSystemDock(this));
|
||||||
filesystem_dock->connect("inherit", callable_mp(this, &EditorNode::_inherit_request));
|
filesystem_dock->connect("inherit", callable_mp(this, &EditorNode::_inherit_request));
|
||||||
filesystem_dock->connect("instance", callable_mp(this, &EditorNode::_instance_request));
|
filesystem_dock->connect("instance", callable_mp(this, &EditorNode::_instantiate_request));
|
||||||
filesystem_dock->connect("display_mode_changed", callable_mp(this, &EditorNode::_save_docks));
|
filesystem_dock->connect("display_mode_changed", callable_mp(this, &EditorNode::_save_docks));
|
||||||
|
|
||||||
// Scene: Top left
|
// Scene: Top left
|
||||||
|
@ -6548,7 +6548,7 @@ EditorNode::EditorNode() {
|
||||||
|
|
||||||
const String docks_section = "docks";
|
const String docks_section = "docks";
|
||||||
overridden_default_layout = -1;
|
overridden_default_layout = -1;
|
||||||
default_layout.instance();
|
default_layout.instantiate();
|
||||||
// Dock numbers are based on DockSlot enum value + 1
|
// Dock numbers are based on DockSlot enum value + 1
|
||||||
default_layout->set_value(docks_section, "dock_3", "Scene,Import");
|
default_layout->set_value(docks_section, "dock_3", "Scene,Import");
|
||||||
default_layout->set_value(docks_section, "dock_4", "FileSystem");
|
default_layout->set_value(docks_section, "dock_4", "FileSystem");
|
||||||
|
@ -6829,31 +6829,31 @@ EditorNode::EditorNode() {
|
||||||
|
|
||||||
{
|
{
|
||||||
Ref<StandardMaterial3DConversionPlugin> spatial_mat_convert;
|
Ref<StandardMaterial3DConversionPlugin> spatial_mat_convert;
|
||||||
spatial_mat_convert.instance();
|
spatial_mat_convert.instantiate();
|
||||||
resource_conversion_plugins.push_back(spatial_mat_convert);
|
resource_conversion_plugins.push_back(spatial_mat_convert);
|
||||||
|
|
||||||
Ref<CanvasItemMaterialConversionPlugin> canvas_item_mat_convert;
|
Ref<CanvasItemMaterialConversionPlugin> canvas_item_mat_convert;
|
||||||
canvas_item_mat_convert.instance();
|
canvas_item_mat_convert.instantiate();
|
||||||
resource_conversion_plugins.push_back(canvas_item_mat_convert);
|
resource_conversion_plugins.push_back(canvas_item_mat_convert);
|
||||||
|
|
||||||
Ref<ParticlesMaterialConversionPlugin> particles_mat_convert;
|
Ref<ParticlesMaterialConversionPlugin> particles_mat_convert;
|
||||||
particles_mat_convert.instance();
|
particles_mat_convert.instantiate();
|
||||||
resource_conversion_plugins.push_back(particles_mat_convert);
|
resource_conversion_plugins.push_back(particles_mat_convert);
|
||||||
|
|
||||||
Ref<ProceduralSkyMaterialConversionPlugin> procedural_sky_mat_convert;
|
Ref<ProceduralSkyMaterialConversionPlugin> procedural_sky_mat_convert;
|
||||||
procedural_sky_mat_convert.instance();
|
procedural_sky_mat_convert.instantiate();
|
||||||
resource_conversion_plugins.push_back(procedural_sky_mat_convert);
|
resource_conversion_plugins.push_back(procedural_sky_mat_convert);
|
||||||
|
|
||||||
Ref<PanoramaSkyMaterialConversionPlugin> panorama_sky_mat_convert;
|
Ref<PanoramaSkyMaterialConversionPlugin> panorama_sky_mat_convert;
|
||||||
panorama_sky_mat_convert.instance();
|
panorama_sky_mat_convert.instantiate();
|
||||||
resource_conversion_plugins.push_back(panorama_sky_mat_convert);
|
resource_conversion_plugins.push_back(panorama_sky_mat_convert);
|
||||||
|
|
||||||
Ref<PhysicalSkyMaterialConversionPlugin> physical_sky_mat_convert;
|
Ref<PhysicalSkyMaterialConversionPlugin> physical_sky_mat_convert;
|
||||||
physical_sky_mat_convert.instance();
|
physical_sky_mat_convert.instantiate();
|
||||||
resource_conversion_plugins.push_back(physical_sky_mat_convert);
|
resource_conversion_plugins.push_back(physical_sky_mat_convert);
|
||||||
|
|
||||||
Ref<VisualShaderConversionPlugin> vshader_convert;
|
Ref<VisualShaderConversionPlugin> vshader_convert;
|
||||||
vshader_convert.instance();
|
vshader_convert.instantiate();
|
||||||
resource_conversion_plugins.push_back(vshader_convert);
|
resource_conversion_plugins.push_back(vshader_convert);
|
||||||
}
|
}
|
||||||
update_spinner_step_msec = OS::get_singleton()->get_ticks_msec();
|
update_spinner_step_msec = OS::get_singleton()->get_ticks_msec();
|
||||||
|
@ -6866,12 +6866,12 @@ EditorNode::EditorNode() {
|
||||||
editor_plugins_force_input_forwarding = memnew(EditorPluginList);
|
editor_plugins_force_input_forwarding = memnew(EditorPluginList);
|
||||||
|
|
||||||
Ref<EditorExportTextSceneToBinaryPlugin> export_text_to_binary_plugin;
|
Ref<EditorExportTextSceneToBinaryPlugin> export_text_to_binary_plugin;
|
||||||
export_text_to_binary_plugin.instance();
|
export_text_to_binary_plugin.instantiate();
|
||||||
|
|
||||||
EditorExport::get_singleton()->add_export_plugin(export_text_to_binary_plugin);
|
EditorExport::get_singleton()->add_export_plugin(export_text_to_binary_plugin);
|
||||||
|
|
||||||
Ref<PackedSceneEditorTranslationParserPlugin> packed_scene_translation_parser_plugin;
|
Ref<PackedSceneEditorTranslationParserPlugin> packed_scene_translation_parser_plugin;
|
||||||
packed_scene_translation_parser_plugin.instance();
|
packed_scene_translation_parser_plugin.instantiate();
|
||||||
EditorTranslationParser::get_singleton()->add_parser(packed_scene_translation_parser_plugin, EditorTranslationParser::STANDARD);
|
EditorTranslationParser::get_singleton()->add_parser(packed_scene_translation_parser_plugin, EditorTranslationParser::STANDARD);
|
||||||
|
|
||||||
_edit_current();
|
_edit_current();
|
||||||
|
@ -6892,7 +6892,7 @@ EditorNode::EditorNode() {
|
||||||
|
|
||||||
saved_version = 1;
|
saved_version = 1;
|
||||||
unsaved_cache = true;
|
unsaved_cache = true;
|
||||||
_last_instanced_scene = nullptr;
|
_last_instantiated_scene = nullptr;
|
||||||
|
|
||||||
quick_open = memnew(EditorQuickOpen);
|
quick_open = memnew(EditorQuickOpen);
|
||||||
gui_base->add_child(quick_open);
|
gui_base->add_child(quick_open);
|
||||||
|
|
|
@ -332,7 +332,7 @@ private:
|
||||||
EditorNativeShaderSourceVisualizer *native_shader_source_visualizer;
|
EditorNativeShaderSourceVisualizer *native_shader_source_visualizer;
|
||||||
|
|
||||||
String defer_load_scene;
|
String defer_load_scene;
|
||||||
Node *_last_instanced_scene;
|
Node *_last_instantiated_scene;
|
||||||
|
|
||||||
EditorLog *log;
|
EditorLog *log;
|
||||||
CenterContainer *tabs_center;
|
CenterContainer *tabs_center;
|
||||||
|
@ -491,7 +491,7 @@ private:
|
||||||
void _discard_changes(const String &p_str = String());
|
void _discard_changes(const String &p_str = String());
|
||||||
|
|
||||||
void _inherit_request(String p_file);
|
void _inherit_request(String p_file);
|
||||||
void _instance_request(const Vector<String> &p_files);
|
void _instantiate_request(const Vector<String> &p_files);
|
||||||
|
|
||||||
void _display_top_editors(bool p_display);
|
void _display_top_editors(bool p_display);
|
||||||
void _set_top_editors(Vector<EditorPlugin *> p_editor_plugins_over);
|
void _set_top_editors(Vector<EditorPlugin *> p_editor_plugins_over);
|
||||||
|
@ -770,7 +770,7 @@ public:
|
||||||
static VSplitContainer *get_top_split() { return singleton->top_split; }
|
static VSplitContainer *get_top_split() { return singleton->top_split; }
|
||||||
|
|
||||||
void request_instance_scene(const String &p_path);
|
void request_instance_scene(const String &p_path);
|
||||||
void request_instance_scenes(const Vector<String> &p_files);
|
void request_instantiate_scenes(const Vector<String> &p_files);
|
||||||
FileSystemDock *get_filesystem_dock();
|
FileSystemDock *get_filesystem_dock();
|
||||||
ImportDock *get_import_dock();
|
ImportDock *get_import_dock();
|
||||||
SceneTreeDock *get_scene_tree_dock();
|
SceneTreeDock *get_scene_tree_dock();
|
||||||
|
|
|
@ -57,7 +57,7 @@ void EditorPluginSettings::update_plugins() {
|
||||||
|
|
||||||
for (int i = 0; i < plugins.size(); i++) {
|
for (int i = 0; i < plugins.size(); i++) {
|
||||||
Ref<ConfigFile> cf;
|
Ref<ConfigFile> cf;
|
||||||
cf.instance();
|
cf.instantiate();
|
||||||
const String path = plugins[i];
|
const String path = plugins[i];
|
||||||
|
|
||||||
Error err2 = cf->load(path);
|
Error err2 = cf->load(path);
|
||||||
|
|
|
@ -2535,7 +2535,7 @@ void EditorPropertyResource::_viewport_selected(const NodePath &p_path) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<ViewportTexture> vt;
|
Ref<ViewportTexture> vt;
|
||||||
vt.instance();
|
vt.instantiate();
|
||||||
vt->set_viewport_path_in_scene(get_tree()->get_edited_scene_root()->get_path_to(to_node));
|
vt->set_viewport_path_in_scene(get_tree()->get_edited_scene_root()->get_path_to(to_node));
|
||||||
vt->setup_local_to_scene();
|
vt->setup_local_to_scene();
|
||||||
|
|
||||||
|
|
|
@ -572,7 +572,7 @@ void EditorPropertyArray::_bind_methods() {
|
||||||
}
|
}
|
||||||
|
|
||||||
EditorPropertyArray::EditorPropertyArray() {
|
EditorPropertyArray::EditorPropertyArray() {
|
||||||
object.instance();
|
object.instantiate();
|
||||||
page_len = int(EDITOR_GET("interface/inspector/max_array_dictionary_items_per_page"));
|
page_len = int(EDITOR_GET("interface/inspector/max_array_dictionary_items_per_page"));
|
||||||
edit = memnew(Button);
|
edit = memnew(Button);
|
||||||
edit->set_h_size_flags(SIZE_EXPAND_FILL);
|
edit->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||||
|
@ -971,7 +971,7 @@ void EditorPropertyDictionary::update_property() {
|
||||||
PanelContainer *pc = memnew(PanelContainer);
|
PanelContainer *pc = memnew(PanelContainer);
|
||||||
vbox->add_child(pc);
|
vbox->add_child(pc);
|
||||||
Ref<StyleBoxFlat> flat;
|
Ref<StyleBoxFlat> flat;
|
||||||
flat.instance();
|
flat.instantiate();
|
||||||
for (int j = 0; j < 4; j++) {
|
for (int j = 0; j < 4; j++) {
|
||||||
flat->set_default_margin(Side(j), 2 * EDSCALE);
|
flat->set_default_margin(Side(j), 2 * EDSCALE);
|
||||||
}
|
}
|
||||||
|
@ -1066,7 +1066,7 @@ void EditorPropertyDictionary::_bind_methods() {
|
||||||
}
|
}
|
||||||
|
|
||||||
EditorPropertyDictionary::EditorPropertyDictionary() {
|
EditorPropertyDictionary::EditorPropertyDictionary() {
|
||||||
object.instance();
|
object.instantiate();
|
||||||
page_len = int(EDITOR_GET("interface/inspector/max_array_dictionary_items_per_page"));
|
page_len = int(EDITOR_GET("interface/inspector/max_array_dictionary_items_per_page"));
|
||||||
edit = memnew(Button);
|
edit = memnew(Button);
|
||||||
edit->set_h_size_flags(SIZE_EXPAND_FILL);
|
edit->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||||
|
|
|
@ -271,7 +271,7 @@ void EditorResourcePicker::_edit_menu_cbk(int p_which) {
|
||||||
}
|
}
|
||||||
|
|
||||||
String orig_type = edited_resource->get_class();
|
String orig_type = edited_resource->get_class();
|
||||||
Object *inst = ClassDB::instance(orig_type);
|
Object *inst = ClassDB::instantiate(orig_type);
|
||||||
Ref<Resource> unique_resource = Ref<Resource>(Object::cast_to<Resource>(inst));
|
Ref<Resource> unique_resource = Ref<Resource>(Object::cast_to<Resource>(inst));
|
||||||
ERR_FAIL_COND(unique_resource.is_null());
|
ERR_FAIL_COND(unique_resource.is_null());
|
||||||
|
|
||||||
|
@ -334,7 +334,7 @@ void EditorResourcePicker::_edit_menu_cbk(int p_which) {
|
||||||
Variant obj;
|
Variant obj;
|
||||||
|
|
||||||
if (ScriptServer::is_global_class(intype)) {
|
if (ScriptServer::is_global_class(intype)) {
|
||||||
obj = ClassDB::instance(ScriptServer::get_global_class_native_base(intype));
|
obj = ClassDB::instantiate(ScriptServer::get_global_class_native_base(intype));
|
||||||
if (obj) {
|
if (obj) {
|
||||||
Ref<Script> script = ResourceLoader::load(ScriptServer::get_global_class_path(intype));
|
Ref<Script> script = ResourceLoader::load(ScriptServer::get_global_class_path(intype));
|
||||||
if (script.is_valid()) {
|
if (script.is_valid()) {
|
||||||
|
@ -342,7 +342,7 @@ void EditorResourcePicker::_edit_menu_cbk(int p_which) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
obj = ClassDB::instance(intype);
|
obj = ClassDB::instantiate(intype);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!obj) {
|
if (!obj) {
|
||||||
|
@ -395,7 +395,7 @@ void EditorResourcePicker::set_create_options(Object *p_menu_node) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_custom_resource && !(ScriptServer::is_global_class(t) || ClassDB::can_instance(t))) {
|
if (!is_custom_resource && !(ScriptServer::is_global_class(t) || ClassDB::can_instantiate(t))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -177,7 +177,7 @@ void EditorResourcePreview::_generate_preview(Ref<ImageTexture> &r_texture, Ref<
|
||||||
Ref<Image> small_image = r_texture->get_image();
|
Ref<Image> small_image = r_texture->get_image();
|
||||||
small_image = small_image->duplicate();
|
small_image = small_image->duplicate();
|
||||||
small_image->resize(small_thumbnail_size, small_thumbnail_size, Image::INTERPOLATE_CUBIC);
|
small_image->resize(small_thumbnail_size, small_thumbnail_size, Image::INTERPOLATE_CUBIC);
|
||||||
r_small_texture.instance();
|
r_small_texture.instantiate();
|
||||||
r_small_texture->create_from_image(small_image);
|
r_small_texture->create_from_image(small_image);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -293,21 +293,21 @@ void EditorResourcePreview::_thread() {
|
||||||
|
|
||||||
if (cache_valid) {
|
if (cache_valid) {
|
||||||
Ref<Image> img;
|
Ref<Image> img;
|
||||||
img.instance();
|
img.instantiate();
|
||||||
Ref<Image> small_img;
|
Ref<Image> small_img;
|
||||||
small_img.instance();
|
small_img.instantiate();
|
||||||
|
|
||||||
if (img->load(cache_base + ".png") != OK) {
|
if (img->load(cache_base + ".png") != OK) {
|
||||||
cache_valid = false;
|
cache_valid = false;
|
||||||
} else {
|
} else {
|
||||||
texture.instance();
|
texture.instantiate();
|
||||||
texture->create_from_image(img);
|
texture->create_from_image(img);
|
||||||
|
|
||||||
if (has_small_texture) {
|
if (has_small_texture) {
|
||||||
if (small_img->load(cache_base + "_small.png") != OK) {
|
if (small_img->load(cache_base + "_small.png") != OK) {
|
||||||
cache_valid = false;
|
cache_valid = false;
|
||||||
} else {
|
} else {
|
||||||
small_texture.instance();
|
small_texture.instantiate();
|
||||||
small_texture->create_from_image(small_img);
|
small_texture->create_from_image(small_img);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ void EditorRunNative::_notification(int p_what) {
|
||||||
if (!im->is_empty()) {
|
if (!im->is_empty()) {
|
||||||
im->resize(16 * EDSCALE, 16 * EDSCALE);
|
im->resize(16 * EDSCALE, 16 * EDSCALE);
|
||||||
Ref<ImageTexture> small_icon;
|
Ref<ImageTexture> small_icon;
|
||||||
small_icon.instance();
|
small_icon.instantiate();
|
||||||
small_icon->create_from_image(im);
|
small_icon->create_from_image(im);
|
||||||
MenuButton *mb = memnew(MenuButton);
|
MenuButton *mb = memnew(MenuButton);
|
||||||
mb->get_popup()->connect("id_pressed", callable_mp(this, &EditorRunNative::_run_native), varray(i));
|
mb->get_popup()->connect("id_pressed", callable_mp(this, &EditorRunNative::_run_native), varray(i));
|
||||||
|
|
|
@ -79,7 +79,7 @@ bool EditorSettings::_set_only(const StringName &p_name, const Variant &p_value)
|
||||||
Ref<InputEvent> shortcut = arr[i + 1];
|
Ref<InputEvent> shortcut = arr[i + 1];
|
||||||
|
|
||||||
Ref<Shortcut> sc;
|
Ref<Shortcut> sc;
|
||||||
sc.instance();
|
sc.instantiate();
|
||||||
sc->set_shortcut(shortcut);
|
sc->set_shortcut(shortcut);
|
||||||
add_shortcut(name, sc);
|
add_shortcut(name, sc);
|
||||||
}
|
}
|
||||||
|
@ -1476,7 +1476,7 @@ Ref<Shortcut> EditorSettings::get_shortcut(const String &p_name) const {
|
||||||
Ref<Shortcut> sc;
|
Ref<Shortcut> sc;
|
||||||
const Map<String, List<Ref<InputEvent>>>::Element *builtin_override = builtin_action_overrides.find(p_name);
|
const Map<String, List<Ref<InputEvent>>>::Element *builtin_override = builtin_action_overrides.find(p_name);
|
||||||
if (builtin_override) {
|
if (builtin_override) {
|
||||||
sc.instance();
|
sc.instantiate();
|
||||||
sc->set_shortcut(builtin_override->get().front()->get());
|
sc->set_shortcut(builtin_override->get().front()->get());
|
||||||
sc->set_name(InputMap::get_singleton()->get_builtin_display_name(p_name));
|
sc->set_name(InputMap::get_singleton()->get_builtin_display_name(p_name));
|
||||||
}
|
}
|
||||||
|
@ -1485,7 +1485,7 @@ Ref<Shortcut> EditorSettings::get_shortcut(const String &p_name) const {
|
||||||
if (sc.is_null()) {
|
if (sc.is_null()) {
|
||||||
const OrderedHashMap<String, List<Ref<InputEvent>>>::ConstElement builtin_default = InputMap::get_singleton()->get_builtins().find(p_name);
|
const OrderedHashMap<String, List<Ref<InputEvent>>>::ConstElement builtin_default = InputMap::get_singleton()->get_builtins().find(p_name);
|
||||||
if (builtin_default) {
|
if (builtin_default) {
|
||||||
sc.instance();
|
sc.instantiate();
|
||||||
sc->set_shortcut(builtin_default.get().front()->get());
|
sc->set_shortcut(builtin_default.get().front()->get());
|
||||||
sc->set_name(InputMap::get_singleton()->get_builtin_display_name(p_name));
|
sc->set_name(InputMap::get_singleton()->get_builtin_display_name(p_name));
|
||||||
}
|
}
|
||||||
|
@ -1528,7 +1528,7 @@ Ref<Shortcut> ED_SHORTCUT(const String &p_path, const String &p_name, uint32_t p
|
||||||
|
|
||||||
Ref<InputEventKey> ie;
|
Ref<InputEventKey> ie;
|
||||||
if (p_keycode) {
|
if (p_keycode) {
|
||||||
ie.instance();
|
ie.instantiate();
|
||||||
|
|
||||||
ie->set_unicode(p_keycode & KEY_CODE_MASK);
|
ie->set_unicode(p_keycode & KEY_CODE_MASK);
|
||||||
ie->set_keycode(p_keycode & KEY_CODE_MASK);
|
ie->set_keycode(p_keycode & KEY_CODE_MASK);
|
||||||
|
@ -1540,7 +1540,7 @@ Ref<Shortcut> ED_SHORTCUT(const String &p_path, const String &p_name, uint32_t p
|
||||||
|
|
||||||
if (!EditorSettings::get_singleton()) {
|
if (!EditorSettings::get_singleton()) {
|
||||||
Ref<Shortcut> sc;
|
Ref<Shortcut> sc;
|
||||||
sc.instance();
|
sc.instantiate();
|
||||||
sc->set_name(p_name);
|
sc->set_name(p_name);
|
||||||
sc->set_shortcut(ie);
|
sc->set_shortcut(ie);
|
||||||
sc->set_meta("original", ie);
|
sc->set_meta("original", ie);
|
||||||
|
@ -1554,7 +1554,7 @@ Ref<Shortcut> ED_SHORTCUT(const String &p_path, const String &p_name, uint32_t p
|
||||||
return sc;
|
return sc;
|
||||||
}
|
}
|
||||||
|
|
||||||
sc.instance();
|
sc.instantiate();
|
||||||
sc->set_name(p_name);
|
sc->set_name(p_name);
|
||||||
sc->set_shortcut(ie);
|
sc->set_shortcut(ie);
|
||||||
sc->set_meta("original", ie); //to compare against changes
|
sc->set_meta("original", ie); //to compare against changes
|
||||||
|
|
|
@ -373,7 +373,7 @@ void EditorSpinSlider::_evaluate_input_text() {
|
||||||
const String text = TS->parse_number(value_input->get_text().replace(",", "."));
|
const String text = TS->parse_number(value_input->get_text().replace(",", "."));
|
||||||
|
|
||||||
Ref<Expression> expr;
|
Ref<Expression> expr;
|
||||||
expr.instance();
|
expr.instantiate();
|
||||||
Error err = expr->parse(text);
|
Error err = expr->parse(text);
|
||||||
if (err != OK) {
|
if (err != OK) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -766,12 +766,12 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
||||||
theme->set_stylebox("sub_inspector_bg" + itos(i), "Editor", sub_inspector_bg);
|
theme->set_stylebox("sub_inspector_bg" + itos(i), "Editor", sub_inspector_bg);
|
||||||
|
|
||||||
Ref<StyleBoxFlat> bg_color;
|
Ref<StyleBoxFlat> bg_color;
|
||||||
bg_color.instance();
|
bg_color.instantiate();
|
||||||
bg_color->set_bg_color(si_base_color * Color(0.7, 0.7, 0.7, 0.8));
|
bg_color->set_bg_color(si_base_color * Color(0.7, 0.7, 0.7, 0.8));
|
||||||
bg_color->set_border_width_all(0);
|
bg_color->set_border_width_all(0);
|
||||||
|
|
||||||
Ref<StyleBoxFlat> bg_color_selected;
|
Ref<StyleBoxFlat> bg_color_selected;
|
||||||
bg_color_selected.instance();
|
bg_color_selected.instantiate();
|
||||||
bg_color_selected->set_border_width_all(0);
|
bg_color_selected->set_border_width_all(0);
|
||||||
bg_color_selected->set_bg_color(si_base_color * Color(0.8, 0.8, 0.8, 0.8));
|
bg_color_selected->set_bg_color(si_base_color * Color(0.8, 0.8, 0.8, 0.8));
|
||||||
|
|
||||||
|
|
|
@ -312,7 +312,7 @@ void EditorFileServer::stop() {
|
||||||
}
|
}
|
||||||
|
|
||||||
EditorFileServer::EditorFileServer() {
|
EditorFileServer::EditorFileServer() {
|
||||||
server.instance();
|
server.instantiate();
|
||||||
quit = false;
|
quit = false;
|
||||||
active = false;
|
active = false;
|
||||||
cmd = CMD_NONE;
|
cmd = CMD_NONE;
|
||||||
|
|
|
@ -945,7 +945,7 @@ void FileSystemDock::_select_file(const String &p_path, bool p_select_in_favorit
|
||||||
} else if (fpath != "Favorites") {
|
} else if (fpath != "Favorites") {
|
||||||
if (FileAccess::exists(fpath + ".import")) {
|
if (FileAccess::exists(fpath + ".import")) {
|
||||||
Ref<ConfigFile> config;
|
Ref<ConfigFile> config;
|
||||||
config.instance();
|
config.instantiate();
|
||||||
Error err = config->load(fpath + ".import");
|
Error err = config->load(fpath + ".import");
|
||||||
if (err == OK) {
|
if (err == OK) {
|
||||||
if (config->has_section_key("remap", "importer")) {
|
if (config->has_section_key("remap", "importer")) {
|
||||||
|
@ -2675,7 +2675,7 @@ void FileSystemDock::_update_import_dock() {
|
||||||
for (int i = 0; i < efiles.size(); i++) {
|
for (int i = 0; i < efiles.size(); i++) {
|
||||||
String fpath = efiles[i];
|
String fpath = efiles[i];
|
||||||
Ref<ConfigFile> cf;
|
Ref<ConfigFile> cf;
|
||||||
cf.instance();
|
cf.instantiate();
|
||||||
Error err = cf->load(fpath + ".import");
|
Error err = cf->load(fpath + ".import");
|
||||||
if (err != OK) {
|
if (err != OK) {
|
||||||
imports.clear();
|
imports.clear();
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue