/***************************************************************************** * Copyright (c) 2014-2025 OpenRCT2 developers * * For a complete list of all authors, please refer to contributors.md * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 * * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ #include #include #include #include #include #include #include namespace OpenRCT2::Ui::Windows { static constexpr int32_t WW = 500; static constexpr int32_t WH = 30; static constexpr uint8_t kTextOffset = 8; class TitleVersionWindow final : public Window { void OnDraw(DrawPixelInfo& dpi) override { // Write name and version information const auto whiteOutline = ColourWithFlags{ COLOUR_WHITE }.withFlag(ColourFlag::withOutline, true); DrawText(dpi, windowPos, { whiteOutline }, gVersionInfoFull); width = GfxGetStringWidth(gVersionInfoFull, FontStyle::Medium); // Write platform information constexpr const char platformInfo[] = OPENRCT2_PLATFORM " (" OPENRCT2_ARCHITECTURE ")"; DrawText(dpi, windowPos + ScreenCoordsXY(0, kListRowHeight), { whiteOutline }, platformInfo); width = std::max(width, GfxGetStringWidth(platformInfo, FontStyle::Medium)) + kTextOffset; } }; WindowBase* TitleVersionOpen() { auto* windowMgr = GetWindowManager(); auto* window = windowMgr->BringToFrontByClass(WindowClass::TitleVersion); if (window == nullptr) { window = windowMgr->Create( WindowClass::TitleVersion, ScreenCoordsXY(kTextOffset, ContextGetHeight() - 30), WW, WH, WF_STICK_TO_BACK | WF_TRANSPARENT); } return window; } } // namespace OpenRCT2::Ui::Windows