Root/src/helppopup.cpp

1// Various authors.
2// License: GPL version 2 or later.
3
4#include "helppopup.h"
5
6#include "gmenu2x.h"
7
8
9HelpPopup::HelpPopup(GMenu2X &gmenu2x)
10    : gmenu2x(gmenu2x)
11{
12}
13
14void HelpPopup::paint(Surface &s) {
15    Font *font = gmenu2x.font;
16    Translator &tr = gmenu2x.tr;
17    int helpBoxHeight = 154;
18
19    s.box(10, 50, 300, helpBoxHeight + 4,
20            gmenu2x.skinConfColors[COLOR_MESSAGE_BOX_BG]);
21    s.rectangle(12, 52, 296, helpBoxHeight,
22            gmenu2x.skinConfColors[COLOR_MESSAGE_BOX_BORDER]);
23    s.write(font, tr["CONTROLS"], 20, 60);
24#if defined(PLATFORM_A320) || defined(PLATFORM_GCW0)
25    s.write(font, tr["A: Launch link / Confirm action"], 20, 80);
26    s.write(font, tr["B: Show this help menu"], 20, 95);
27    s.write(font, tr["L, R: Change section"], 20, 110);
28    s.write(font, tr["SELECT: Show contextual menu"], 20, 155);
29    s.write(font, tr["START: Show options menu"], 20, 170);
30#endif
31}
32
33bool HelpPopup::handleButtonPress(InputManager::Button button) {
34    if (button == InputManager::CANCEL) {
35        dismiss();
36    }
37    return true;
38}
39
40bool HelpPopup::handleTouchscreen(Touchscreen &ts) {
41    if (ts.pressed()) {
42        dismiss();
43        ts.setHandled();
44    }
45    return true;
46}
47

Archive Download this file



interactive