Merge pull request #21392 from MarianoGnu/tileset_editor

Backward compatibility for autotile setup from Godot 3.0.X
This commit is contained in:
Rémi Verschelde 2018-08-25 10:40:34 +02:00 committed by GitHub
commit db0a2563c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -59,7 +59,13 @@ bool TileSet::_set(const StringName &p_name, const Variant &p_value) {
tile_set_region(id, p_value);
else if (what == "tile_mode")
tile_set_tile_mode(id, (TileMode)((int)p_value));
else if (what.left(9) == "autotile/") {
else if (what == "is_autotile") {
// backward compatibility for Godot 3.0.x
// autotile used to be a bool, it's now an enum
bool is_autotile = p_value;
if (is_autotile)
tile_set_tile_mode(id, AUTO_TILE);
} else if (what.left(9) == "autotile/") {
what = what.right(9);
if (what == "bitmask_mode")
autotile_set_bitmask_mode(id, (BitmaskMode)((int)p_value));