Add close/delete window function aliases for upstream
This commit is contained in:
@@ -1172,6 +1172,11 @@ Window::~Window()
|
||||
const_cast<volatile WindowClass &>(this->window_class) = WC_INVALID;
|
||||
}
|
||||
|
||||
void Window::Close()
|
||||
{
|
||||
if (this->window_class != WC_INVALID) delete this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find a window by its class and window number
|
||||
* @param cls Window class
|
||||
|
@@ -45,6 +45,10 @@ void DeleteNetworkClientWindows();
|
||||
void HideVitalWindows();
|
||||
void ShowVitalWindows();
|
||||
|
||||
inline void CloseNonVitalWindows() { DeleteNonVitalWindows(); }
|
||||
inline void CloseAllNonVitalWindows() { DeleteAllNonVitalWindows(); }
|
||||
inline void CloseConstructionWindows() { DeleteConstructionWindows(); }
|
||||
|
||||
/**
|
||||
* Re-initialize all windows.
|
||||
* @param zoom_changed Set if windows are being re-initialized due to a zoom level changed.
|
||||
@@ -59,6 +63,9 @@ void DeleteWindowById(WindowClass cls, WindowNumber number, bool force = true);
|
||||
void DeleteAllWindowsById(WindowClass cls, WindowNumber number, bool force = true);
|
||||
void DeleteWindowByClass(WindowClass cls);
|
||||
|
||||
inline void CloseWindowById(WindowClass cls, WindowNumber number, bool force = true) { DeleteWindowById(cls, number, force); }
|
||||
inline void CloseWindowByClass(WindowClass cls) { DeleteWindowByClass(cls); }
|
||||
|
||||
bool FocusWindowById(WindowClass cls, WindowNumber number);
|
||||
|
||||
bool EditBoxInGlobalFocus();
|
||||
|
@@ -289,6 +289,8 @@ public:
|
||||
|
||||
virtual ~Window();
|
||||
|
||||
virtual void Close();
|
||||
|
||||
/**
|
||||
* Helper allocation function to disallow something.
|
||||
* Don't allow arrays; arrays of Windows are pointless as you need
|
||||
@@ -520,6 +522,7 @@ public:
|
||||
static int SortButtonWidth();
|
||||
|
||||
void DeleteChildWindows(WindowClass wc = WC_INVALID) const;
|
||||
inline void CloseChildWindows(WindowClass wc = WC_INVALID) const { this->DeleteChildWindows(wc); }
|
||||
|
||||
void SetDirty();
|
||||
void SetDirtyAsBlocks();
|
||||
|
Reference in New Issue
Block a user