Also one small question in diff....

Diff comments:

> 
> === modified file 'src/logic/map_objects/tribes/building.cc'
> --- src/logic/map_objects/tribes/building.cc  2016-03-10 12:40:49 +0000
> +++ src/logic/map_objects/tribes/building.cc  2016-03-19 18:56:25 +0000
> @@ -664,38 +661,26 @@
>  Draw overlay help strings when enabled.
>  ===============
>  */
> -void Building::draw_help
> -     (const EditorGameBase& game, RenderTarget& dst, const FCoords&, const 
> Point& pos)
> +void Building::draw_info(const EditorGameBase& game, RenderTarget& dst, 
> const Point& pos)
>  {
>       const InteractiveGameBase & igbase =
>               dynamic_cast<const InteractiveGameBase&>(*game.get_ibase());
>       uint32_t const dpyflags = igbase.get_display_flags();
>  
> -     if (dpyflags & InteractiveBase::dfShowCensus || dpyflags & 
> InteractiveBase::dfShowStatistics) {
> -             // We always render this so we can have a stable position for 
> the statistics string.
> -             const Image* rendered_census_info =
> -                             
> UI::g_fh1->render(as_condensed(info_string(InfoStringFormat::kCensus), 
> UI::Align::kCenter),
> -                                                                             
> 120);
> -             const Point census_pos(pos - Point(0, 48));
> -
> -             if (dpyflags & InteractiveBase::dfShowCensus) {
> -                     dst.blit(census_pos, rendered_census_info, 
> BlendMode::UseAlpha, UI::Align::kCenter);
> -             }
> -
> -             if (dpyflags & InteractiveBase::dfShowStatistics) {
> -                     if (upcast(InteractivePlayer const, iplayer, &igbase))
> -                             if
> -                                     (!iplayer->player().see_all() &&
> -                                      
> iplayer->player().is_hostile(*get_owner()))
> -                                     return;
> -                     const std::string& info = 
> info_string(InfoStringFormat::kStatistics);
> -                     if (!info.empty()) {
> -                             dst.blit(census_pos + Point(0, 
> rendered_census_info->height() / 2 + 10),
> -                                                     
> UI::g_fh1->render(as_condensed(info)),
> -                                                     BlendMode::UseAlpha, 
> UI::Align::kCenter);
> +     bool show_statistics_string = dpyflags & 
> InteractiveBase::dfShowStatistics;

What exactly this show_statistics_string affects? Only text over ships?

> +     if (show_statistics_string) {
> +             if (upcast(InteractivePlayer const, iplayer, &igbase)) {
> +                     if (!iplayer->player().see_all() && 
> iplayer->player().is_hostile(*get_owner())) {
> +                             show_statistics_string = false;
>                       }
>               }
>       }
> +     const std::string statistics_string =
> +                     show_statistics_string ? 
> info_string(InfoStringFormat::kStatistics) : "";
> +
> +     do_draw_info(dpyflags & InteractiveBase::dfShowCensus, 
> info_string(InfoStringFormat::kCensus),
> +                                      show_statistics_string, 
> statistics_string,
> +                                      dst, pos);
>  }
>  
>  int32_t Building::get_priority


-- 
https://code.launchpad.net/~widelands-dev/widelands/show-ship-names/+merge/289562
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/show-ship-names into lp:widelands.

_______________________________________________
Mailing list: https://launchpad.net/~widelands-dev
Post to     : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to