aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Common/UI/UIScene_SignEntryMenu.h
blob: 4e1c2a5baeed055eb732810136c5177c99ea2f6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#pragma once

#include "UIScene.h"

class SignTileEntity;

class UIScene_SignEntryMenu : public UIScene
{
private:
	enum EControls
	{
		// Lines should be 0-3
		eControl_Line1,
		eControl_Line2,
		eControl_Line3,
		eControl_Line4,
		eControl_Confirm
	};

	shared_ptr<SignTileEntity> m_sign;
	int m_iEditingLine;
	bool m_bConfirmed;
	bool m_bIgnoreInput;
	int m_iSignCursorFrame;
#ifdef _WINDOWS64
	int m_iActiveDirectEditLine;
	bool m_bNeedsInitialEdit;
	bool m_bSkipTickNav;
#endif

	UIControl_Button m_buttonConfirm;
	UIControl_Label m_labelMessage;
	UIControl_TextInput m_textInputLines[4];
	UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene)
		UI_MAP_ELEMENT( m_buttonConfirm, "Confirm")
		UI_MAP_ELEMENT( m_labelMessage, "Message")

		UI_MAP_ELEMENT( m_textInputLines[0], "Line1")
		UI_MAP_ELEMENT( m_textInputLines[1], "Line2")
		UI_MAP_ELEMENT( m_textInputLines[2], "Line3")
		UI_MAP_ELEMENT( m_textInputLines[3], "Line4")
	UI_END_MAP_ELEMENTS_AND_NAMES()
public:
	UIScene_SignEntryMenu(int iPad, void *initData, UILayer *parentLayer);
	virtual ~UIScene_SignEntryMenu();

	virtual EUIScene getSceneType() { return eUIScene_SignEntryMenu;}
	virtual void updateTooltips();

	virtual void tick();

protected:
	// TODO: This should be pure virtual in this class
	virtual wstring getMoviePath();

public:
	// INPUT
	virtual void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled);
#ifdef _WINDOWS64
	virtual void getDirectEditInputs(vector<UIControl_TextInput*> &inputs);
	virtual void onDirectEditFinished(UIControl_TextInput *input, UIControl_TextInput::EDirectEditResult result);
	virtual bool handleMouseClick(F32 x, F32 y);
#endif

protected:
	void handlePress(F64 controlId, F64 childId);
	static int KeyboardCompleteCallback(LPVOID lpParam,const bool bRes);
	virtual void handleDestroy();
};