1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

Revert "Replace many uses of is_class with derives_from."

This reverts commit 78b743cf4a.
This commit is contained in:
A Thousand Ships
2025-09-25 13:45:49 +02:00
parent 6e4e8072e1
commit bd65cfa876
43 changed files with 82 additions and 82 deletions

View File

@@ -891,7 +891,7 @@ void SceneDebuggerObject::deserialize(const Array &p_arr) {
if (var.is_zero()) {
var = Ref<Resource>();
} else if (var.get_type() == Variant::OBJECT) {
if (((Object *)var)->derives_from<EncodedObjectAsID>()) {
if (((Object *)var)->is_class("EncodedObjectAsID")) {
var = Object::cast_to<EncodedObjectAsID>(var)->get_object_id();
pinfo.type = var.get_type();
pinfo.hint = PROPERTY_HINT_OBJECT_ID;
@@ -1046,9 +1046,9 @@ void LiveEditor::_node_set_func(int p_id, const StringName &p_prop, const Varian
Variant orig_tf;
if (keep_transform) {
if (n2->derives_from<Node3D>()) {
if (n2->is_class("Node3D")) {
orig_tf = n2->call("get_transform");
} else if (n2->derives_from<CanvasItem>()) {
} else if (n2->is_class("CanvasItem")) {
orig_tf = n2->call("_edit_get_state");
}
}
@@ -1056,12 +1056,12 @@ void LiveEditor::_node_set_func(int p_id, const StringName &p_prop, const Varian
n2->set(p_prop, p_value);
if (keep_transform) {
if (n2->derives_from<Node3D>()) {
if (n2->is_class("Node3D")) {
Variant new_tf = n2->call("get_transform");
if (new_tf != orig_tf) {
n2->call("set_transform", orig_tf);
}
} else if (n2->derives_from<CanvasItem>()) {
} else if (n2->is_class("CanvasItem")) {
Variant new_tf = n2->call("_edit_get_state");
if (new_tf != orig_tf) {
n2->call("_edit_set_state", orig_tf);
@@ -1117,9 +1117,9 @@ void LiveEditor::_node_call_func(int p_id, const StringName &p_method, const Var
Variant orig_tf;
if (keep_transform) {
if (n2->derives_from<Node3D>()) {
if (n2->is_class("Node3D")) {
orig_tf = n2->call("get_transform");
} else if (n2->derives_from<CanvasItem>()) {
} else if (n2->is_class("CanvasItem")) {
orig_tf = n2->call("_edit_get_state");
}
}
@@ -1128,12 +1128,12 @@ void LiveEditor::_node_call_func(int p_id, const StringName &p_method, const Var
n2->callp(p_method, p_args, p_argcount, ce);
if (keep_transform) {
if (n2->derives_from<Node3D>()) {
if (n2->is_class("Node3D")) {
Variant new_tf = n2->call("get_transform");
if (new_tf != orig_tf) {
n2->call("set_transform", orig_tf);
}
} else if (n2->derives_from<CanvasItem>()) {
} else if (n2->is_class("CanvasItem")) {
Variant new_tf = n2->call("_edit_get_state");
if (new_tf != orig_tf) {
n2->call("_edit_set_state", orig_tf);