diff --git a/src/widget.cpp b/src/widget.cpp index 06a975788d..5184f3ec2d 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -1123,17 +1123,6 @@ NWidgetCore::NWidgetCore(WidgetType tp, Colours colour, WidgetID index, uint fil this->align = SA_CENTER; } -/** - * Set data and tool tip of the nested widget. - * @param widget_data Data to use. - * @param tool_tip Tool tip string to use. - */ -void NWidgetCore::SetDataTip(uint32_t widget_data, StringID tool_tip) -{ - this->widget_data = widget_data; - this->tool_tip = tool_tip; -} - /** * Set string of the nested widget. * @param string The new string. @@ -1184,6 +1173,15 @@ void NWidgetCore::SetMatrixDimension(uint8_t columns, uint8_t rows) this->widget_data = static_cast((rows << MAT_ROW_START) | (columns << MAT_COL_START)); } +/** + * Set the resize widget type of the nested widget. + * @param type The new resize widget. + */ +void NWidgetCore::SetResizeWidgetType(ResizeWidgetValues type) +{ + this->widget_data = type; +} + /** * Set the text style of the nested widget. * @param colour TextColour to use. @@ -2770,7 +2768,8 @@ NWidgetLeaf::NWidgetLeaf(WidgetType tp, Colours colour, WidgetID index, uint32_t case WWT_RESIZEBOX: this->SetFill(0, 0); this->SetMinimalSize(WidgetDimensions::WD_RESIZEBOX_WIDTH, 12); - this->SetDataTip(RWV_SHOW_BEVEL, STR_TOOLTIP_RESIZE); + this->SetResizeWidgetType(RWV_SHOW_BEVEL); + this->SetToolTip(STR_TOOLTIP_RESIZE); break; case WWT_CLOSEBOX: diff --git a/src/widget_type.h b/src/widget_type.h index 5dae59a778..ad30fbfd8e 100644 --- a/src/widget_type.h +++ b/src/widget_type.h @@ -372,12 +372,12 @@ class NWidgetCore : public NWidgetResizeBase { public: NWidgetCore(WidgetType tp, Colours colour, WidgetID index, uint fill_x, uint fill_y, uint32_t widget_data, StringID tool_tip); - void SetDataTip(uint32_t widget_data, StringID tool_tip); void SetString(StringID string); void SetStringTip(StringID string, StringID tool_tip); void SetSprite(SpriteID sprite); void SetSpriteTip(SpriteID sprite, StringID tool_tip); void SetMatrixDimension(uint8_t columns, uint8_t rows); + void SetResizeWidgetType(ResizeWidgetValues type); void SetToolTip(StringID tool_tip); StringID GetToolTip() const; void SetTextStyle(TextColour colour, FontSize size);