MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / NWidgetCore

Method NWidgetCore

src/widget.cpp:1170–1176  ·  view source on GitHub ↗

* Initialization of a 'real' widget. * @param tp Type of the widget. * @param colour Colour of the widget. * @param index Index of the widget. * @param fill_x Default horizontal filling. * @param fill_y Default vertical filling. * @param widget_data Data component of the widget. @see Widget::data * @param tool_tip Tool tip of the widget. @see Widget::tooltip

Source from the content-addressed store, hash-verified

1168 * @param tool_tip Tool tip of the widget. @see Widget::tooltips
1169 */
1170NWidgetCore::NWidgetCore(WidgetType tp, Colours colour, WidgetID index, uint fill_x, uint fill_y, const WidgetData &widget_data, StringID tool_tip) : NWidgetResizeBase(tp, index, fill_x, fill_y)
1171{
1172 this->colour = colour;
1173 this->widget_data = widget_data;
1174 this->SetToolTip(tool_tip);
1175 this->text_colour = tp == WWT_CAPTION ? TC_WHITE : TC_BLACK;
1176}
1177
1178/**
1179 * Set string of the nested widget.

Callers

nothing calls this directly

Calls 1

SetToolTipMethod · 0.95

Tested by

no test coverage detected