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

Method SetDisplayedPlane

src/widget.cpp:1450–1457  ·  view source on GitHub ↗

* Select which plane to show (for #NWID_SELECTION only). * @param plane Plane number to display. * @return true iff the shown plane changed. */

Source from the content-addressed store, hash-verified

1448 * @return true iff the shown plane changed.
1449 */
1450bool NWidgetStacked::SetDisplayedPlane(int plane)
1451{
1452 if (this->shown_plane == plane) return false;
1453 this->shown_plane = plane;
1454 /* In case widget IDs are repeated, make sure Window::GetWidget works on displayed widgets. */
1455 if (static_cast<size_t>(this->shown_plane) < this->children.size()) this->children[shown_plane]->FillWidgetLookup(*this->widget_lookup);
1456 return true;
1457}
1458
1459class NWidgetLayer : public NWidgetContainer {
1460public:

Callers 15

OnInitMethod · 0.80
OnInitMethod · 0.80
SaveLoadWindowMethod · 0.80
GoalListWindowMethod · 0.80
GoalQuestionWindowMethod · 0.80
NewGRFWindowMethod · 0.80
BuildTreesWindowMethod · 0.80
SetShadedMethod · 0.80
UpdateButtonStateMethod · 0.80
BuildIndustryWindowMethod · 0.80

Calls 2

sizeMethod · 0.45
FillWidgetLookupMethod · 0.45

Tested by

no test coverage detected