2014-04-03 04:08:06 +02:00
|
|
|
/*****************************************************************************
|
2023-01-01 11:58:01 +01:00
|
|
|
* Copyright (c) 2014-2023 OpenRCT2 developers
|
2014-04-03 04:08:06 +02:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* For a complete list of all authors, please refer to contributors.md
|
|
|
|
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
2014-04-03 04:08:06 +02:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
2014-04-03 04:08:06 +02:00
|
|
|
*****************************************************************************/
|
|
|
|
|
2018-06-22 23:21:44 +02:00
|
|
|
#include <openrct2-ui/interface/Widget.h>
|
2017-08-06 21:20:05 +02:00
|
|
|
#include <openrct2-ui/windows/Window.h>
|
2018-06-22 23:21:44 +02:00
|
|
|
#include <openrct2/drawing/Drawing.h>
|
|
|
|
#include <openrct2/interface/Colour.h>
|
2018-01-06 18:32:25 +01:00
|
|
|
#include <openrct2/localisation/Localisation.h>
|
2017-09-18 17:05:28 +02:00
|
|
|
#include <openrct2/sprites.h>
|
2014-04-03 04:08:06 +02:00
|
|
|
|
2020-05-09 17:05:01 +02:00
|
|
|
static constexpr const int32_t WW = 232;
|
|
|
|
static constexpr const int32_t WH = 136;
|
2020-04-16 13:18:09 +02:00
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
WIDX_LOGO
|
|
|
|
};
|
|
|
|
|
2022-12-24 16:50:29 +01:00
|
|
|
static Widget window_title_logo_widgets[] = {
|
2020-11-27 04:14:20 +01:00
|
|
|
MakeWidget({ 0, 0 }, { WW + 1, WH + 1 }, WindowWidgetType::ImgBtn, WindowColour::Primary),
|
2021-09-26 11:11:42 +02:00
|
|
|
WIDGETS_END,
|
2016-06-12 18:19:31 +02:00
|
|
|
};
|
|
|
|
|
2022-10-13 12:16:16 +02:00
|
|
|
class TitleLogoWindow final : public Window
|
2020-09-28 20:36:15 +02:00
|
|
|
{
|
2022-10-13 12:16:16 +02:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Creates the window containing the logo and the expansion packs on the title screen.
|
|
|
|
* rct2: 0x0066B679 (part of 0x0066B3E8)
|
|
|
|
*/
|
|
|
|
void OnOpen() override
|
|
|
|
{
|
|
|
|
widgets = window_title_logo_widgets;
|
|
|
|
WindowInitScrollWidgets(*this);
|
|
|
|
colours[0] = TRANSLUCENT(COLOUR_GREY);
|
|
|
|
colours[1] = TRANSLUCENT(COLOUR_GREY);
|
|
|
|
colours[2] = TRANSLUCENT(COLOUR_GREY);
|
|
|
|
}
|
2017-08-06 05:22:00 +02:00
|
|
|
|
2022-10-13 12:16:16 +02:00
|
|
|
void OnMouseUp(WidgetIndex widgetIndex) override
|
|
|
|
{
|
|
|
|
switch (widgetIndex)
|
|
|
|
{
|
|
|
|
case WIDX_LOGO:
|
|
|
|
WindowAboutOpen();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2014-04-29 21:10:23 +02:00
|
|
|
|
2022-10-13 12:16:16 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* rct2: 0x0066B872
|
|
|
|
*/
|
|
|
|
void OnDraw(rct_drawpixelinfo& dpi) override
|
2020-04-16 13:18:09 +02:00
|
|
|
{
|
2022-10-13 12:16:16 +02:00
|
|
|
auto screenCoords = windowPos + ScreenCoordsXY{ 2, 2 };
|
|
|
|
gfx_draw_sprite(&dpi, ImageId(SPR_G2_LOGO), screenCoords);
|
|
|
|
gfx_draw_sprite(&dpi, ImageId(SPR_G2_TITLE), screenCoords + ScreenCoordsXY{ 104, 18 });
|
2020-04-16 13:18:09 +02:00
|
|
|
}
|
2022-10-13 12:16:16 +02:00
|
|
|
};
|
2020-04-16 13:18:09 +02:00
|
|
|
|
2022-10-13 12:16:16 +02:00
|
|
|
rct_window* WindowTitleLogoOpen()
|
2014-04-29 21:10:23 +02:00
|
|
|
{
|
2022-10-13 12:16:16 +02:00
|
|
|
auto* window = window_bring_to_front_by_class(WindowClass::TitleLogo);
|
|
|
|
if (window == nullptr)
|
|
|
|
{
|
|
|
|
window = WindowCreate<TitleLogoWindow>(
|
|
|
|
WindowClass::TitleLogo, ScreenCoordsXY(0, 0), WW, WH, WF_STICK_TO_BACK | WF_TRANSPARENT);
|
|
|
|
}
|
|
|
|
return window;
|
2015-12-21 05:03:37 +01:00
|
|
|
}
|