Added code to load old resource properties where applicable, to help converting resources to the new fixed apis. These will be removed after the next release.

This commit is contained in:
Relintai 2023-06-17 02:20:24 +02:00
parent b1de21dd58
commit e56d6fa906
6 changed files with 88 additions and 0 deletions

View File

@ -81,6 +81,19 @@ void ModelVisual::_validate_property(PropertyInfo &property) const {
}
}
#ifndef DISABLE_DEPRECATED
// TODO REMOVE AFTER NEXT RELEASE
bool ModelVisual::_set(const StringName &p_name, const Variant &p_value) {
if (p_name == "get_visual_entries") {
set_visual_entries(p_value);
return true;
}
return false;
}
#endif
void ModelVisual::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_layer"), &ModelVisual::get_layer);
ClassDB::bind_method(D_METHOD("set_layer", "layer"), &ModelVisual::set_layer);

View File

@ -49,6 +49,10 @@ public:
~ModelVisual();
protected:
#ifndef DISABLE_DEPRECATED
// TODO REMOVE AFTER NEXT RELEASE
bool _set(const StringName &p_name, const Variant &p_value);
#endif
void _validate_property(PropertyInfo &property) const;
static void _bind_methods();

View File

@ -6600,6 +6600,23 @@ bool Entity::_set(const StringName &p_name, const Variant &p_value) {
return true;
}
#ifndef DISABLE_DEPRECATED
// TODO REMOVE AFTER NEXT RELEASE
if (main_prop == "characterclass_id") {
int id = p_value;
entity_data_id_sets(id);
return true;
} else if (main_prop == "entity_data_id") {
int id = p_value;
entity_data_id_setc(id);
return true;
}
#endif
return false;
}

View File

@ -510,6 +510,15 @@ bool TiledWallData::_set(const StringName &p_name, const Variant &p_value) {
}
}
#ifndef DISABLE_DEPRECATED
// TODO REMOVE AFTER NEXT RELEASE
if (p_name == "set_tile_count") {
set_tile_count(p_value);
return true;
}
#endif
return false;
}

View File

@ -202,6 +202,47 @@ Prop2DDataSprite::Prop2DDataSprite() {
Prop2DDataSprite::~Prop2DDataSprite() {
}
#ifndef DISABLE_DEPRECATED
// TODO REMOVE AFTER NEXT RELEASE
bool Prop2DDataSprite::_set(const StringName &p_name, const Variant &p_value) {
if (p_name == "get_flip_v") {
set_flip_v(p_value);
return true;
} else if (p_name == "get_animation_h_frames") {
set_animation_h_frames(p_value);
return true;
} else if (p_name == "set_animation_v_frames") {
set_animation_v_frames(p_value);
return true;
} else if (p_name == "get_animation_frame") {
set_animation_frame(p_value);
return true;
} else if (p_name == "get_animation_frame_coords") {
set_animation_frame_coords(p_value);
return true;
} else if (p_name == "set_region_enabled") {
set_region_enabled(p_value);
return true;
} else if (p_name == "get_region") {
set_region(p_value);
return true;
} else if (p_name == "get_filter_clip") {
set_filter_clip(p_value);
return true;
}
return false;
}
#endif
void Prop2DDataSprite::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_texture"), &Prop2DDataSprite::get_texture);
ClassDB::bind_method(D_METHOD("set_texture", "value"), &Prop2DDataSprite::set_texture);

View File

@ -79,6 +79,10 @@ public:
~Prop2DDataSprite();
protected:
#ifndef DISABLE_DEPRECATED
// TODO REMOVE AFTER NEXT RELEASE
bool _set(const StringName &p_name, const Variant &p_value);
#endif
static void _bind_methods();
private: