-
-
Notifications
You must be signed in to change notification settings - Fork 452
/
Copy pathCGUI.h
122 lines (93 loc) · 3.49 KB
/
CGUI.h
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/*****************************************************************************
*
* PROJECT: Multi Theft Auto v1.0
* LICENSE: See LICENSE in the top level directory
* FILE: core/CGUI.h
* PURPOSE: Header file for core graphical user interface class
*
* Multi Theft Auto is available from http://www.multitheftauto.com/
*
*****************************************************************************/
class CLocalGUI;
#pragma once
#ifndef WM_MOUSEWHEEL
#define WM_MOUSEWHEEL 0x20A // Defined only when including Windows.h -> Not getting defined? (<=XP only?)
#endif
#define DIRECT3D_VERSION 0x0900
#include "d3d9.h"
#include "d3dx9.h"
#include <gui/CGUI.h>
#include "CConsole.h"
#include "CMainMenu.h"
#include "CSetCursorPosHook.h"
#include "CSingleton.h"
#include "CVersionUpdater.h"
#include <windows.h>
class CChat;
class CDebugView;
class CLocalGUI : public CSingleton<CLocalGUI>
{
public:
CLocalGUI();
~CLocalGUI();
void SetSkin(const char* szName);
void ChangeLocale(const char* szName);
void CreateWindows(bool bGameIsAlreadyLoaded);
void DestroyWindows();
void CreateObjects(IUnknown* pDevice);
void DestroyObjects();
void DoPulse();
void Draw();
void Invalidate();
void Restore();
void DrawMouseCursor();
void SetCursorPos(int iX, int iY, bool bForce = false, bool overrideStored = true);
CConsole* GetConsole();
void SetConsoleVisible(bool bVisible);
bool IsConsoleVisible();
void EchoConsole(const char* szText);
CMainMenu* GetMainMenu();
void SetMainMenuVisible(bool bVisible);
bool IsMainMenuVisible();
CChat* GetChat();
float GetChatBottomPosition() const noexcept;
void SetChatBoxVisible(bool bVisible, bool bInputBlocked = true);
bool IsChatBoxVisible();
bool IsChatBoxInputBlocked();
void SetChatBoxInputEnabled(bool bInputEnabled);
bool IsChatBoxInputEnabled();
void EchoChat(const char* szText, bool bColorCoded);
bool IsWebRequestGUIVisible();
CDebugView* GetDebugView();
void SetDebugViewVisible(bool bVisible);
bool IsDebugViewVisible();
void EchoDebug(const char* szText);
bool ProcessMessage(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
bool InputGoesToGUI();
bool IsCursorForcedVisible() { return m_bForceCursorVisible; }
void ForceCursorVisible(bool bVisible);
void InitiateUpdate(const char* szType, const char* szData, const char* szHost) { m_pVersionUpdater->InitiateUpdate(szType, szData, szHost); }
bool IsOptionalUpdateInfoRequired(const char* szHost) { return m_pVersionUpdater->IsOptionalUpdateInfoRequired(szHost); }
void InitiateDataFilesFix() { m_pVersionUpdater->InitiateDataFilesFix(); }
private:
void UpdateCursor();
DWORD TranslateScanCodeToGUIKey(DWORD dwCharacter);
CConsole* m_pConsole;
CMainMenu* m_pMainMenu;
CChat* m_pChat;
CDebugView* m_pDebugView;
CVersionUpdaterInterface* m_pVersionUpdater;
CGUILabel* m_pLabelVersionTag;
bool m_bForceCursorVisible;
bool m_bChatboxVisible;
bool m_bChatboxInputBlocked;
bool m_pDebugViewVisible;
bool m_bGUIHasInput;
int m_uiActiveCompositionSize;
POINT m_StoredMousePosition;
int m_LastSettingsRevision; // the revision number the last time we saw the skin change
SString m_LastSkinName;
SString m_LastLocaleName;
uint m_LocaleChangeCounter;
bool m_ModernSkinEnabled;
};