diff options
| -rw-r--r-- | SConstruct | 2 | ||||
| -rw-r--r-- | editor/plugins/tile_map_editor_plugin.cpp | 6 | ||||
| -rw-r--r-- | editor/plugins/tile_set_editor_plugin.cpp | 5 | ||||
| -rw-r--r-- | scene/2d/tile_map.cpp | 7 | 
4 files changed, 16 insertions, 4 deletions
| diff --git a/SConstruct b/SConstruct index f5d9358530..57fa305a15 100644 --- a/SConstruct +++ b/SConstruct @@ -164,7 +164,7 @@ opts.Add('extra_suffix', "Custom extra suffix added to the base filename of all  opts.Add(BoolVariable('vsproj', "Generate a Visual Studio solution", False))  opts.Add(EnumVariable('macports_clang', "Build using Clang from MacPorts", 'no', ('no', '5.0', 'devel')))  opts.Add(BoolVariable('disable_3d', "Disable 3D nodes for a smaller executable", False)) -opts.Add(BoolVariable('disable_advanced_gui', "Disable advanced 3D GUI nodes and behaviors", False)) +opts.Add(BoolVariable('disable_advanced_gui', "Disable advanced GUI nodes and behaviors", False))  opts.Add(BoolVariable('no_editor_splash', "Don't use the custom splash screen for the editor", False))  opts.Add('system_certs_path', "Use this path as SSL certificates default for editor (for package maintainers)", '') diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index d3a3289a18..c9367edec6 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -516,6 +516,12 @@ void TileMapEditor::_update_palette() {  		manual_palette->set_current(selected);  		manual_palette->show();  	} + +	if (tileset->tile_get_tile_mode(sel_tile) == TileSet::AUTO_TILE) { +		manual_button->show(); +	} else { +		manual_button->hide(); +	}  }  void TileMapEditor::_pick_tile(const Point2 &p_pos) { diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index cab9a4297d..e5551d385b 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -874,6 +874,9 @@ void TileSetEditor::_on_workspace_draw() {  			draw_edited_region_subdivision();  		} else {  			int t_id = get_current_tile(); +			if (t_id < 0) +				return; +  			Rect2i region;  			if (draw_edited_region)  				region = edited_region; @@ -2260,7 +2263,7 @@ void TileSetEditor::update_workspace_tile_mode() {  		tool_editmode[EDITMODE_BITMASK]->hide();  		tool_editmode[EDITMODE_PRIORITY]->hide();  		tool_editmode[EDITMODE_Z_INDEX]->hide(); -	} else if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::AUTO_TILE || tileset->tile_get_tile_mode(get_current_tile()) == TileSet::ATLAS_TILE) { +	} else if (tileset->tile_get_tile_mode(get_current_tile()) == TileSet::AUTO_TILE) {  		if (edit_mode == EDITMODE_ICON)  			select_coord(tileset->autotile_get_icon_coordinate(get_current_tile()));  		else diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index ee76a90019..37886861e0 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -840,7 +840,7 @@ void TileMap::update_cell_bitmask(int p_x, int p_y) {  	Map<PosKey, Cell>::Element *E = tile_map.find(p);  	if (E != NULL) {  		int id = get_cell(p_x, p_y); -		if (tile_set->tile_get_tile_mode(id) == TileSet::AUTO_TILE || tile_set->tile_get_tile_mode(id) == TileSet::ATLAS_TILE) { +		if (tile_set->tile_get_tile_mode(id) == TileSet::AUTO_TILE) {  			uint16_t mask = 0;  			if (tile_set->autotile_get_bitmask_mode(id) == TileSet::BITMASK_2X2) {  				if (tile_set->is_tile_bound(id, get_cell(p_x - 1, p_y - 1)) && tile_set->is_tile_bound(id, get_cell(p_x, p_y - 1)) && tile_set->is_tile_bound(id, get_cell(p_x - 1, p_y))) { @@ -904,7 +904,8 @@ void TileMap::update_cell_bitmask(int p_x, int p_y) {  			PosKey qk(p_x / _get_quadrant_size(), p_y / _get_quadrant_size());  			Map<PosKey, Quadrant>::Element *Q = quadrant_map.find(qk);  			_make_quadrant_dirty(Q); -		} else { + +		} else if (tile_set->tile_get_tile_mode(id) == TileSet::SINGLE_TILE) {  			E->get().autotile_coord_x = 0;  			E->get().autotile_coord_y = 0;  		} @@ -1630,6 +1631,8 @@ void TileMap::_bind_methods() {  	ClassDB::bind_method(D_METHOD("is_cell_y_flipped", "x", "y"), &TileMap::is_cell_y_flipped);  	ClassDB::bind_method(D_METHOD("is_cell_transposed", "x", "y"), &TileMap::is_cell_transposed); +	ClassDB::bind_method(D_METHOD("get_cell_autotile_coord", "x", "y"), &TileMap::get_cell_autotile_coord); +  	ClassDB::bind_method(D_METHOD("fix_invalid_tiles"), &TileMap::fix_invalid_tiles);  	ClassDB::bind_method(D_METHOD("clear"), &TileMap::clear); |