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

Method SwitchMapType

src/smallmap_gui.cpp:823–834  ·  view source on GitHub ↗

* Select a new map type. * @param map_type New map type. */

Source from the content-addressed store, hash-verified

821 * @param map_type New map type.
822 */
823 void SwitchMapType(SmallMapType map_type)
824 {
825 this->RaiseWidget(WID_SM_CONTOUR + this->map_type);
826 this->map_type = map_type;
827 this->LowerWidget(WID_SM_CONTOUR + this->map_type);
828
829 this->SetupWidgetData();
830
831 if (map_type == SMT_LINKSTATS) this->overlay->SetDirty();
832 if (map_type != SMT_INDUSTRY) this->BreakIndustryChainLink();
833 this->ReInit();
834 }
835
836 /**
837 * Set new #scroll_x, #scroll_y, and #subscroll values after limiting them such that the center

Callers 2

OnClickMethod · 0.95
OnInvalidateDataMethod · 0.95

Calls 6

SetupWidgetDataMethod · 0.95
RaiseWidgetMethod · 0.80
LowerWidgetMethod · 0.80
ReInitMethod · 0.80
SetDirtyMethod · 0.45

Tested by

no test coverage detected