← Back to team overview

widelands-dev team mailing list archive

Re: [Merge] lp:~widelands-dev/widelands/show-ship-names into lp:widelands

 

I agree the labels could be improved.

I don't like "Transport mode" - too techy.

For "Unloading", I used to have "Building Port", but I didn't like that either, because as soon as the wares and builder are unloaded, the ship goes into transport mode while the port is building - how about "Founding Colony"?

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;

In this case, text over buildings ;)

dpyflags & InteractiveBase::dfShowStatistics is true if the user has pressed s ("Show Building Statistics" is on).

It would be nice to test for this in MapObject directly, but it doesn't like references to InteractiveBase.

> +	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.


References