the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#pragma once
2
3#include "UIScene.h"
4
5class UIScene_Keyboard : public UIScene
6{
7private:
8 bool m_bKeyboardDonePressed;
9
10protected:
11 UIControl_Label m_EnterTextLabel;
12 UIControl_TextInput m_KeyboardTextInput;
13 UIControl_Button m_ButtonSpace, m_ButtonCursorLeft, m_ButtonCursorRight, m_ButtonCaps, m_ButtonDone, m_ButtonSymbols, m_ButtonBackspace;
14
15 IggyName m_funcInitFunctionButtons;
16 IggyName m_funcCursorRightButtonPressed, m_funcCursorLeftButtonPressed, m_funcCapsButtonPressed, m_funcBackspaceButtonPressed;
17 IggyName m_funcSpaceButtonPressed, m_funcSymbolButtonPressed, m_funcDoneButtonPressed;
18
19 UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene)
20 UI_MAP_ELEMENT(m_EnterTextLabel, "EnterTextLabel")
21 UI_MAP_ELEMENT(m_KeyboardTextInput, "KeyboardTextInput")
22
23 UI_MAP_ELEMENT(m_ButtonSpace, "Button_space")
24 UI_MAP_ELEMENT(m_ButtonCursorLeft, "Button_CursorLeft")
25 UI_MAP_ELEMENT(m_ButtonCursorRight, "Button_CursorRight")
26 UI_MAP_ELEMENT(m_ButtonCaps, "Button_Caps")
27 UI_MAP_ELEMENT(m_ButtonDone, "Button_Done")
28 UI_MAP_ELEMENT(m_ButtonSymbols, "Button_symbols")
29 UI_MAP_ELEMENT(m_ButtonBackspace, "Button_bspace")
30
31 UI_MAP_NAME(m_funcInitFunctionButtons, L"InitFunctionButtons");
32
33 UI_MAP_NAME(m_funcCursorRightButtonPressed, L"CursorRightButtonPressed");
34 UI_MAP_NAME(m_funcCursorLeftButtonPressed, L"CursorLeftButtonPressed");
35 UI_MAP_NAME(m_funcCapsButtonPressed, L"CapsButtonPressed");
36 UI_MAP_NAME(m_funcBackspaceButtonPressed, L"BackspaceButtonPressed");
37 UI_MAP_NAME(m_funcSpaceButtonPressed, L"SpaceButtonPressed");
38 UI_MAP_NAME(m_funcSymbolButtonPressed, L"SymbolButtonPressed");
39 UI_MAP_NAME(m_funcDoneButtonPressed, L"DoneButtonPressed");
40 UI_END_MAP_ELEMENTS_AND_NAMES()
41
42public:
43 UIScene_Keyboard(int iPad, void *initData, UILayer *parentLayer);
44 ~UIScene_Keyboard();
45
46 virtual void updateTooltips();
47
48 virtual bool allowRepeat(int key);
49 // INPUT
50 virtual void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled);
51
52 virtual void handleTimerComplete(int id);
53
54protected:
55 void handlePress(F64 controlId, F64 childId);
56
57protected:
58 // TODO: This should be pure virtual in this class
59 virtual wstring getMoviePath();
60
61private:
62 void KeyboardDonePressed();
63
64public:
65 virtual EUIScene getSceneType() { return eUIScene_Keyboard;}
66
67 // Returns true if this scene handles input
68 //virtual bool stealsFocus() { return false; }
69
70 // Returns true if this scene has focus for the pad passed in
71 //virtual bool hasFocus(int iPad) { return false; }
72 // Returns true if this scene has focus for the pad passed in
73#ifndef __PS3__
74 virtual bool hasFocus(int iPad) { return bHasFocus; }
75#endif
76
77 // Returns true if lower scenes in this scenes layer, or in any layer below this scenes layers should be hidden
78 virtual bool hidesLowerScenes() { return false; }
79};