Opened 8 years ago

Last modified 2 years ago

#4097 new defect

Not enough space for resources in summary screen

Reported by: echotangoecho Owned by:
Priority: Should Have Milestone: Backlog
Component: UI – Miscellaneous Keywords:
Cc: Patch:

Description (last modified by Langbart)

When a high number of resources gathered / used needs to be displayed, there is not enough place in the summary screen for this to be displayed, as can be seen in the attached screenshot.

Attachments (1)

screenshot0001.png (1.2 MB ) - added by echotangoecho 8 years ago.

Download all attachments as: .zip

Change History (8)

by echotangoecho, 8 years ago

Attachment: screenshot0001.png added

comment:1 by elexis, 8 years ago

Keywords: simple added

As usual: 1024x768 is the smallest resolution that ought to be supported and while at it, ought to be tested against the "long-translations" mock language (which can be generated from source/tools/i18n/generateLongStringTranslations.py. can upload the language pack on request too).

comment:2 by Imarok, 5 years ago

Component: UI & SimulationMisc. UI

Move tickets to Misc. UI as "UI & Simulation" got some sub components.

comment:3 by Freagarach, 3 years ago

Description: modified (diff)

Refs. #6063.

comment:4 by Silier, 3 years ago

Keywords: simple removed
severity: simple

comment:5 by Silier, 3 years ago

Keywords: simple added

comment:6 by Langbart, 3 years ago

Description: modified (diff)
Keywords: simple removed
Milestone: BacklogAlpha 26

It would be easy if only the summary numbers would need to be adjusted. One could simply use the abbreviateLargeNumbers function from gui/common/tooltips.js, but that would break the charts since the format is not supported via source/gui/ObjectTypes/CChart.cpp.

CSize2D CChart::AddFormattedValue(const CStrW& format, const float value, const CStrW& font, const float buffer_zone)
{
	// TODO: we need to catch cases with equal formatted values.
	CGUIString gui_str;
	if (format == L"DECIMAL2")
	{
		wchar_t buffer[64];
		swprintf(buffer, 64, L"%.2f", value);
		gui_str.SetValue(buffer);
	}
	else if (format == L"INTEGER")
	{
		wchar_t buffer[64];
		swprintf(buffer, 64, L"%d", std::lround(value));
		gui_str.SetValue(buffer);
	}
	else if (format == L"DURATION_SHORT")
	{
		const int seconds = value;
		wchar_t buffer[64];
		swprintf(buffer, 64, L"%d:%02d", seconds / 60, seconds % 60);
		gui_str.SetValue(buffer);
	}
	else if (format == L"PERCENTAGE")
	{
		wchar_t buffer[64];
		swprintf(buffer, 64, L"%d%%", std::lround(value));
		gui_str.SetValue(buffer);
	}
	else
	{
		LOGERROR("Unsupported chart format: " + format.EscapeToPrintableASCII());
		return CSize2D();
	}

	return AddText(gui_str, font, 0, buffer_zone).GetSize();
}

comment:7 by Freagarach, 2 years ago

Milestone: Alpha 26Backlog
Note: See TracTickets for help on using tickets.