mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-08 23:34:15 +00:00
(svn r21108) -Add: Copy the 'editable' flag of the newgrf window to its layout widget.
This commit is contained in:
parent
b26b8b5b2a
commit
f961fe626b
@ -1270,6 +1270,7 @@ public:
|
|||||||
NWidgetBase *avs; ///< Widget with the available grfs list and buttons.
|
NWidgetBase *avs; ///< Widget with the available grfs list and buttons.
|
||||||
NWidgetBase *acs; ///< Widget with the active grfs list and buttons.
|
NWidgetBase *acs; ///< Widget with the active grfs list and buttons.
|
||||||
NWidgetBase *inf; ///< Info panel.
|
NWidgetBase *inf; ///< Info panel.
|
||||||
|
bool editable; ///< Editable status of the parent NewGRF window (if \c false, drop all widgets that make the window editable).
|
||||||
|
|
||||||
NWidgetNewGRFDisplay(NWidgetBase *avs, NWidgetBase *acs, NWidgetBase *inf) : NWidgetContainer(NWID_HORIZONTAL)
|
NWidgetNewGRFDisplay(NWidgetBase *avs, NWidgetBase *acs, NWidgetBase *inf) : NWidgetContainer(NWID_HORIZONTAL)
|
||||||
{
|
{
|
||||||
@ -1280,10 +1281,17 @@ public:
|
|||||||
this->Add(this->avs);
|
this->Add(this->avs);
|
||||||
this->Add(this->acs);
|
this->Add(this->acs);
|
||||||
this->Add(this->inf);
|
this->Add(this->inf);
|
||||||
|
|
||||||
|
this->editable = true; // Temporary setting, 'real' value is set in SetupSmallestSize().
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void SetupSmallestSize(Window *w, bool init_array)
|
virtual void SetupSmallestSize(Window *w, bool init_array)
|
||||||
{
|
{
|
||||||
|
/* Copy state flag from the window. */
|
||||||
|
assert(dynamic_cast<NewGRFWindow *>(w) != NULL);
|
||||||
|
NewGRFWindow *ngw = (NewGRFWindow *)w;
|
||||||
|
this->editable = ngw->editable;
|
||||||
|
|
||||||
this->avs->SetupSmallestSize(w, init_array);
|
this->avs->SetupSmallestSize(w, init_array);
|
||||||
this->acs->SetupSmallestSize(w, init_array);
|
this->acs->SetupSmallestSize(w, init_array);
|
||||||
this->inf->SetupSmallestSize(w, init_array);
|
this->inf->SetupSmallestSize(w, init_array);
|
||||||
|
Loading…
Reference in New Issue
Block a user