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

Function MayBeShown

src/window.cpp:857–871  ·  view source on GitHub ↗

* Returns whether a window may be shown or not. * @param w The window to consider. * @return True iff it may be shown, otherwise false. */

Source from the content-addressed store, hash-verified

855 * @return True iff it may be shown, otherwise false.
856 */
857static bool MayBeShown(const Window *w)
858{
859 /* If we're not modal, everything is okay. */
860 if (!HasModalProgress()) return true;
861
862 switch (w->window_class) {
863 case WC_MAIN_WINDOW: ///< The background, i.e. the game.
864 case WC_MODAL_PROGRESS: ///< The actual progress window.
865 case WC_CONFIRM_POPUP_QUERY: ///< The abort window.
866 return true;
867
868 default:
869 return false;
870 }
871}
872
873/**
874 * Generate repaint events for the visible part of window w within the rectangle.

Callers 3

DrawOverlappedWindowFunction · 0.85
FindWindowFromPtFunction · 0.85

Calls 1

HasModalProgressFunction · 0.85

Tested by

no test coverage detected