Add visual indication when there's more than one special node assigned to a space

This commit is contained in:
2015-06-24 01:53:03 -04:00
parent 0fbb872b73
commit 269daedcd1
3 changed files with 9 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -994,7 +994,7 @@ static bool handle_terrain_action(location the_point, bool ctrl_hit) {
break;
}
}
if(x < 0)
if(x != -1)
giveError("There wasn't a special on that spot.");
set_cursor(wand_curs);
overall_mode = MODE_DRAWING;

View File

@@ -792,8 +792,15 @@ void draw_terrain(){
}
if(is_special(cen_x + q - 4,cen_y + r - 4)) {
int x = cen_x + q - 4, y = cen_y + r - 4;
std::vector<spec_loc_t>& spec_list = editing_town ? town->special_locs : current_terrain->special_locs;
int num_spec = std::count_if(spec_list.begin(), spec_list.end(), [x,y](spec_loc_t which) {
return which.spec >= 0 && which.x == x && which.y == y;
});
tiny_from = base_small_button_from;
tiny_from.offset(7 * (7),7 * (0));
if(num_spec > 1)
tiny_from.offset(7 * (7),7 * (4));
else tiny_from.offset(7 * (7),7 * (0));
rect_draw_some_item(editor_mixed,tiny_from,ter_draw_gworld,tiny_to);
tiny_to.offset(0,-7);
}