Changeset - r28269:2d82555aee09
[Not reviewed]
master
0 2 0
Peter Nelson - 12 months ago 2023-12-09 19:11:14
peter1138@openttd.org
Codechange: Make SetDisplayedPlane return whether the plane changed or not.
2 files changed with 5 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/widget.cpp
Show inline comments
 
@@ -1492,10 +1492,13 @@ NWidgetCore *NWidgetStacked::GetWidgetFr
 
/**
 
 * Select which plane to show (for #NWID_SELECTION only).
 
 * @param plane Plane number to display.
 
 * @return true iff the shown plane changed.
 
 */
 
void NWidgetStacked::SetDisplayedPlane(int plane)
 
bool NWidgetStacked::SetDisplayedPlane(int plane)
 
{
 
	if (this->shown_plane == plane) return false;
 
	this->shown_plane = plane;
 
	return true;
 
}
 

	
 
NWidgetPIPContainer::NWidgetPIPContainer(WidgetType tp, NWidContainerFlags flags) : NWidgetContainer(tp)
src/widget_type.h
Show inline comments
 
@@ -461,7 +461,7 @@ public:
 
	void Draw(const Window *w) override;
 
	NWidgetCore *GetWidgetFromPos(int x, int y) override;
 

	
 
	void SetDisplayedPlane(int plane);
 
	bool SetDisplayedPlane(int plane);
 

	
 
	int shown_plane; ///< Plane being displayed (for #NWID_SELECTION only).
 
	int index;       ///< If non-negative, index in the #Window::nested_array.
0 comments (0 inline, 0 general)