|
@@ -2860,18 +2860,19 @@ NWidgetContainer *MakeWindowNWidgetTree(
|
|
|
|
|
|
/**
|
|
|
* Make a number of rows with button-like graphics, for enabling/disabling each company.
|
|
|
* @param biggest_index Storage for collecting the biggest index used in the returned tree.
|
|
|
* @param widget_first The first widget index to use.
|
|
|
* @param widget_last The last widget index to use.
|
|
|
* @param colour The colour in which to draw the button.
|
|
|
* @param max_length Maximal number of company buttons in one row.
|
|
|
* @param button_tooltip The tooltip-string of every button.
|
|
|
* @return Panel with rows of company buttons.
|
|
|
* @post \c *biggest_index contains the largest used index in the tree.
|
|
|
*/
|
|
|
NWidgetBase *MakeCompanyButtonRows(int *biggest_index, int widget_first, int widget_last, int max_length, StringID button_tooltip)
|
|
|
NWidgetBase *MakeCompanyButtonRows(int *biggest_index, int widget_first, int widget_last, Colours button_colour, int max_length, StringID button_tooltip)
|
|
|
{
|
|
|
assert(max_length >= 1);
|
|
|
NWidgetVertical *vert = nullptr; // Storage for all rows.
|
|
|
NWidgetHorizontal *hor = nullptr; // Storage for buttons in one row.
|
|
|
int hor_length = 0;
|
|
|
|
|
@@ -2889,13 +2890,13 @@ NWidgetBase *MakeCompanyButtonRows(int *
|
|
|
}
|
|
|
if (hor == nullptr) {
|
|
|
hor = new NWidgetHorizontal();
|
|
|
hor_length = 0;
|
|
|
}
|
|
|
|
|
|
NWidgetBackground *panel = new NWidgetBackground(WWT_PANEL, COLOUR_GREY, widnum);
|
|
|
NWidgetBackground *panel = new NWidgetBackground(WWT_PANEL, button_colour, widnum);
|
|
|
panel->SetMinimalSize(sprite_size.width, sprite_size.height);
|
|
|
panel->SetFill(1, 1);
|
|
|
panel->SetResize(1, 0);
|
|
|
panel->SetDataTip(0x0, button_tooltip);
|
|
|
hor->Add(panel);
|
|
|
hor_length++;
|