Skip to content

Commit

Permalink
Merge branch 'LovCAPONE-NontransStrTooltipTerrainIcon'
Browse files Browse the repository at this point in the history
  • Loading branch information
irydacea committed Oct 4, 2014
2 parents 54f1491 + cf32ce7 commit d5de2bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog
Expand Up @@ -326,6 +326,7 @@ Version 1.13.0-dev:
* Fix issue where the chatlog for a replayed game could not be opened in single player.
The chatlog can now always be opened.
* Fix bug #22745: choose_track function crashes the game in certain cases
* Fix bug #22650: nontranslatable strings displayed in tooltips for terrain icons

Version 1.11.11:
* Add-ons server:
Expand Down
8 changes: 5 additions & 3 deletions src/reports.cpp
Expand Up @@ -1338,10 +1338,11 @@ REPORT_GENERATOR(income, rc)
}

namespace {
void blit_tced_icon(config &cfg, const std::string &terrain_id, const std::string &icon_image, bool high_res) {
void blit_tced_icon(config &cfg, const std::string &terrain_id, const std::string &icon_image, bool high_res,
const std::string &terrain_name) {
const std::string tc_base = high_res ? "images/buttons/icon-base-32.png" : "images/buttons/icon-base-16.png";
const std::string terrain_image = "terrain/" + icon_image + (high_res ? "_30.png" : ".png");
add_image(cfg, tc_base + "~RC(magenta>" + terrain_id + ")~BLIT(" + terrain_image + ")", terrain_id);
add_image(cfg, tc_base + "~RC(magenta>" + terrain_id + ")~BLIT(" + terrain_image + ")", terrain_name);
}
}

Expand Down Expand Up @@ -1383,10 +1384,11 @@ REPORT_GENERATOR(terrain_info, rc)
if (underlying_terrain == t_translation::OFF_MAP_USER)
continue;
const std::string& terrain_id = map.get_terrain_info(underlying_terrain).id();
const std::string& terrain_name = map.get_terrain_string(underlying_terrain);
const std::string& terrain_icon = map.get_terrain_info(underlying_terrain).icon_image();
if (terrain_icon.empty())
continue;
blit_tced_icon(cfg, terrain_id, terrain_icon, high_res);
blit_tced_icon(cfg, terrain_id, terrain_icon, high_res, terrain_name);
}
return cfg;
}
Expand Down

0 comments on commit d5de2bf

Please sign in to comment.