mirror of https://github.com/OpenTTD/OpenTTD
Codechange: remove (unused) tooltip from function to set matrix dimensions
parent
3ecd1187ba
commit
c972a9ae1f
|
@ -286,7 +286,7 @@ struct DepotWindow : Window {
|
||||||
/* Don't show 'rename button' of aircraft hangar */
|
/* Don't show 'rename button' of aircraft hangar */
|
||||||
this->GetWidget<NWidgetStacked>(WID_D_SHOW_RENAME)->SetDisplayedPlane(type == VEH_AIRCRAFT ? SZSP_NONE : 0);
|
this->GetWidget<NWidgetStacked>(WID_D_SHOW_RENAME)->SetDisplayedPlane(type == VEH_AIRCRAFT ? SZSP_NONE : 0);
|
||||||
/* Only train depots have a horizontal scrollbar and a 'sell chain' button */
|
/* Only train depots have a horizontal scrollbar and a 'sell chain' button */
|
||||||
if (type == VEH_TRAIN) this->GetWidget<NWidgetCore>(WID_D_MATRIX)->widget_data = 1 << MAT_COL_START;
|
if (type == VEH_TRAIN) this->GetWidget<NWidgetCore>(WID_D_MATRIX)->SetMatrixDimension(1, 0 /* auto-scale */);
|
||||||
this->GetWidget<NWidgetStacked>(WID_D_SHOW_H_SCROLL)->SetDisplayedPlane(type == VEH_TRAIN ? 0 : SZSP_HORIZONTAL);
|
this->GetWidget<NWidgetStacked>(WID_D_SHOW_H_SCROLL)->SetDisplayedPlane(type == VEH_TRAIN ? 0 : SZSP_HORIZONTAL);
|
||||||
this->GetWidget<NWidgetStacked>(WID_D_SHOW_SELL_CHAIN)->SetDisplayedPlane(type == VEH_TRAIN ? 0 : SZSP_NONE);
|
this->GetWidget<NWidgetStacked>(WID_D_SHOW_SELL_CHAIN)->SetDisplayedPlane(type == VEH_TRAIN ? 0 : SZSP_NONE);
|
||||||
this->SetupWidgetData(type);
|
this->SetupWidgetData(type);
|
||||||
|
|
|
@ -555,7 +555,7 @@ public:
|
||||||
|
|
||||||
resize.width = 0;
|
resize.width = 0;
|
||||||
resize.height = 0;
|
resize.height = 0;
|
||||||
this->GetWidget<NWidgetCore>(WID_GRAPH_RANGE_MATRIX)->SetMatrixDataTip(1, ClampTo<uint8_t>(std::size(this->ranges)), STR_NULL);
|
this->GetWidget<NWidgetCore>(WID_GRAPH_RANGE_MATRIX)->SetMatrixDimension(1, ClampTo<uint8_t>(std::size(this->ranges)));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WID_GRAPH_GRAPH: {
|
case WID_GRAPH_GRAPH: {
|
||||||
|
|
|
@ -1174,6 +1174,16 @@ void NWidgetCore::SetSpriteTip(SpriteID sprite, StringID tool_tip)
|
||||||
this->SetToolTip(tool_tip);
|
this->SetToolTip(tool_tip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the matrix dimension.
|
||||||
|
* @param columns The number of columns in the matrix (0 for autoscaling).
|
||||||
|
* @param rows The number of rows in the matrix (0 for autoscaling).
|
||||||
|
*/
|
||||||
|
void NWidgetCore::SetMatrixDimension(uint8_t columns, uint8_t rows)
|
||||||
|
{
|
||||||
|
this->widget_data = static_cast<uint32_t>((rows << MAT_ROW_START) | (columns << MAT_COL_START));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the text style of the nested widget.
|
* Set the text style of the nested widget.
|
||||||
* @param colour TextColour to use.
|
* @param colour TextColour to use.
|
||||||
|
|
|
@ -377,7 +377,7 @@ public:
|
||||||
void SetStringTip(StringID string, StringID tool_tip);
|
void SetStringTip(StringID string, StringID tool_tip);
|
||||||
void SetSprite(SpriteID sprite);
|
void SetSprite(SpriteID sprite);
|
||||||
void SetSpriteTip(SpriteID sprite, StringID tool_tip);
|
void SetSpriteTip(SpriteID sprite, StringID tool_tip);
|
||||||
void SetMatrixDataTip(uint8_t cols, uint8_t rows, StringID tip) { this->SetDataTip(static_cast<uint32_t>((rows << MAT_ROW_START) | (cols << MAT_COL_START)), tip); }
|
void SetMatrixDimension(uint8_t columns, uint8_t rows);
|
||||||
void SetToolTip(StringID tool_tip);
|
void SetToolTip(StringID tool_tip);
|
||||||
StringID GetToolTip() const;
|
StringID GetToolTip() const;
|
||||||
void SetTextStyle(TextColour colour, FontSize size);
|
void SetTextStyle(TextColour colour, FontSize size);
|
||||||
|
|
Loading…
Reference in New Issue