From 98fdd20f84c5d1dc64b8b07dca533fc41be4d8e3 Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 30 Jun 2013 14:32:31 +0000 Subject: (svn r25531) -Codechange: Use separate function to set data of WWT_MATRIX widgets. --- src/widget_type.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/widget_type.h') diff --git a/src/widget_type.h b/src/widget_type.h index 222983cd2..14b555315 100644 --- a/src/widget_type.h +++ b/src/widget_type.h @@ -1020,6 +1020,18 @@ static inline NWidgetPart SetDataTip(uint16 data, StringID tip) return part; } +/** + * Widget part function for setting the data and tooltip of WWT_MATRIX widgets + * @param cols Number of columns. + * @param rows Number of rows. + * @param tip Tooltip of the widget. + * @ingroup NestedWidgetParts + */ +static inline NWidgetPart SetMatrixDataTip(uint8 cols, uint8 rows, StringID tip) +{ + return SetDataTip((rows << MAT_ROW_START) | (cols << MAT_COL_START), tip); +} + /** * Widget part function for setting additional space around a widget. * Parameters start above the widget, and are specified in clock-wise direction. -- cgit v1.2.3-54-g00ecf