1 /*
2  * Copyright (C) 2002-2020 by the Widelands Development Team
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17  *
18  */
19 
20 #include "ui_fsmenu/intro.h"
21 
22 #include "base/i18n.h"
23 
FullscreenMenuIntro()24 FullscreenMenuIntro::FullscreenMenuIntro()
25    : FullscreenMenuBase(),
26 
27      // Text area
28      message_(this,
29               get_w() / 2,
30               get_h() * 19 / 20,
31               0,
32               0,
33               _("Press any key or click to continue…"),
34               UI::Align::kCenter,
35               g_gr->styles().font_style(UI::FontStyle::kFsMenuIntro)) {
36 	message_.set_font_scale(scale_factor());
37 	add_overlay_image("images/loadscreens/splash.jpg",
38 	                  FullscreenWindow::Alignment(UI::Align::kCenter, UI::Align::kCenter));
39 }
40 
handle_mousepress(uint8_t,int32_t,int32_t)41 bool FullscreenMenuIntro::handle_mousepress(uint8_t, int32_t, int32_t) {
42 	end_modal<FullscreenMenuBase::MenuTarget>(FullscreenMenuBase::MenuTarget::kOk);
43 	return true;
44 }
45 
handle_key(const bool down,const SDL_Keysym)46 bool FullscreenMenuIntro::handle_key(const bool down, const SDL_Keysym) {
47 	if (down) {
48 		end_modal<FullscreenMenuBase::MenuTarget>(FullscreenMenuBase::MenuTarget::kOk);
49 	}
50 
51 	return false;
52 }
53