* * rct2: 0x006EB806 */
| 232 | * rct2: 0x006EB806 |
| 233 | */ |
| 234 | static void WidgetTabDraw(RenderTarget& rt, WindowBase& w, WidgetIndex widgetIndex) |
| 235 | { |
| 236 | // Get the widget |
| 237 | auto& widget = w.widgets[widgetIndex]; |
| 238 | |
| 239 | if (widget.type != WidgetType::tab && widget.image.GetIndex() == kImageIndexUndefined) |
| 240 | return; |
| 241 | |
| 242 | if (widget.type == WidgetType::tab) |
| 243 | { |
| 244 | if (widgetIsDisabled(w, widgetIndex)) |
| 245 | return; |
| 246 | |
| 247 | if (widget.image.GetIndex() == kImageIndexUndefined) |
| 248 | { |
| 249 | // Set standard tab sprite to use. |
| 250 | widget.image = ImageId(SPR_TAB, FilterPaletteID::paletteNull); |
| 251 | } |
| 252 | } |
| 253 | |
| 254 | // Draw widgets that aren't explicitly disabled. |
| 255 | if (!widgetIsDisabled(w, widgetIndex)) |
| 256 | { |
| 257 | WidgetDrawImage(rt, w, widgetIndex); |
| 258 | return; |
| 259 | } |
| 260 | |
| 261 | if (widget.type != WidgetType::trnBtn) |
| 262 | { |
| 263 | WidgetDrawImage(rt, w, widgetIndex); |
| 264 | return; |
| 265 | } |
| 266 | |
| 267 | // Resolve the absolute ltrb |
| 268 | auto leftTop = w.windowPos + ScreenCoordsXY{ widget.left, widget.top }; |
| 269 | |
| 270 | // Get the colour and disabled image |
| 271 | auto colour = w.colours[widget.colour].colour; |
| 272 | const auto newIndex = widget.image.GetIndex() + 2; |
| 273 | auto image = widget.image.WithIndex(newIndex).WithPrimary(colour); |
| 274 | |
| 275 | // Draw disabled image |
| 276 | GfxDrawSprite(rt, image, leftTop); |
| 277 | } |
| 278 | |
| 279 | /** |
| 280 | * |
no test coverage detected