diff --git a/src/game/boe.main.cpp b/src/game/boe.main.cpp index 51be89ab..bcda41e1 100644 --- a/src/game/boe.main.cpp +++ b/src/game/boe.main.cpp @@ -1473,7 +1473,10 @@ void handle_one_minimap_event(const sf::Event& event) { const std::vector& sign_locs = is_out() ? univ.out->sign_locs : univ.town->sign_locs; for(sign_loc_t sign : sign_locs){ if(sign == tile){ - tooltip_text += "Sign: " + sign.text + " |"; + // make sure the terrain is a sign + ter_num_t ter = is_out() ? univ.out[real_tile] : univ.town->terrain(real_tile.x, real_tile.y); + if(is_sign(ter)) + tooltip_text += "Sign: " + sign.text + " |"; } } // Town entrance hovered @@ -1481,7 +1484,10 @@ void handle_one_minimap_event(const sf::Event& event) { const std::vector& city_locs = univ.out->city_locs; for(spec_loc_t city : city_locs){ if(city == tile){ - tooltip_text += univ.scenario.towns[city.spec]->name + " |"; + // don't tooltip hidden towns + ter_num_t ter = is_out() ? univ.out[real_tile] : univ.town->terrain(real_tile.x, real_tile.y); + if(univ.scenario.ter_types[ter].special == eTerSpec::TOWN_ENTRANCE) + tooltip_text += univ.scenario.towns[city.spec]->name + " |"; } } } diff --git a/src/game/boe.town.cpp b/src/game/boe.town.cpp index a8ccb5a2..a16eaea8 100644 --- a/src/game/boe.town.cpp +++ b/src/game/boe.town.cpp @@ -1496,12 +1496,18 @@ void draw_map(bool need_refresh, std::string tooltip_text) { if(canMap) { rect_draw_some_item(map_gworld().getTexture(),the_rect,mini_map(),area_to_draw_on); - auto mark_loc = [view_rect, &draw_rect, area_to_draw_on](location where, sf::Color inner, sf::Color outer) -> void { + auto mark_loc = [view_rect, &draw_rect, area_to_draw_on](location where, sf::Color inner, sf::Color outer, eTerSpec if_spec = eTerSpec::NONE) -> void { location real_where = where; if(is_out()) real_where = local_to_global(where); if((is_explored(real_where.x,real_where.y)) && ((where.x >= view_rect.left) && (where.x < view_rect.right) && where.y >= view_rect.top && where.y < view_rect.bottom)){ + // if if_spec is specified, make sure the terrain on the spot has the given special + if(if_spec != eTerSpec::NONE){ + ter_num_t ter = is_out() ? univ.out[real_where] : univ.town->terrain(real_where.x, real_where.y); + if(univ.scenario.ter_types[ter].special != if_spec) return; + } + draw_rect.left = area_to_draw_on.left + 6 * (where.x - view_rect.left); draw_rect.top = area_to_draw_on.top + 6 * (where.y - view_rect.top); draw_rect.right = draw_rect.left + 6; @@ -1530,13 +1536,14 @@ void draw_map(bool need_refresh, std::string tooltip_text) { // Draw signs const std::vector& sign_locs = is_out() ? univ.out->sign_locs : univ.town->sign_locs; for(sign_loc_t sign : sign_locs){ - mark_loc(sign, Colours::EMPTY, Colours::YELLOW); + mark_loc(sign, Colours::EMPTY, Colours::YELLOW, eTerSpec::IS_A_SIGN); } // Draw town entrances if(is_out()){ const std::vector& city_locs = univ.out->city_locs; + // TODO don't draw hidden ones for(spec_loc_t city : city_locs){ - mark_loc(city, Colours::EMPTY, Colours::GREEN); + mark_loc(city, Colours::EMPTY, Colours::GREEN, eTerSpec::TOWN_ENTRANCE); } } // Draw vehicles