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

Function ToggleRailButton_Remove

src/rail_gui.cpp:320–327  ·  view source on GitHub ↗

* Toggles state of the Remove button of Build rail toolbar * @param w window the button belongs to */

Source from the content-addressed store, hash-verified

318 * @param w window the button belongs to
319 */
320static void ToggleRailButton_Remove(Window *w)
321{
322 CloseWindowById(WC_SELECT_STATION, 0);
323 w->ToggleWidgetLoweredState(WID_RAT_REMOVE);
324 w->SetWidgetDirty(WID_RAT_REMOVE);
325 _remove_button_clicked = w->IsWidgetLowered(WID_RAT_REMOVE);
326 SetSelectionRed(_remove_button_clicked);
327}
328
329/**
330 * Updates the Remove button because of Ctrl state change

Callers 3

RailToolbar_CtrlChangedFunction · 0.85
BuildRailClick_RemoveFunction · 0.85
OnClickMethod · 0.85

Calls 5

CloseWindowByIdFunction · 0.85
SetSelectionRedFunction · 0.85
SetWidgetDirtyMethod · 0.80
IsWidgetLoweredMethod · 0.80

Tested by

no test coverage detected