DDraceNetwork Docs
touch_controls.h
Go to the documentation of this file.
1#ifndef GAME_CLIENT_COMPONENTS_TOUCH_CONTROLS_H
2#define GAME_CLIENT_COMPONENTS_TOUCH_CONTROLS_H
3
4#include <base/vmath.h>
5
6#include <engine/input.h>
7
10
11#include <chrono>
12#include <functional>
13#include <memory>
14#include <optional>
15#include <string>
16#include <vector>
17
18class CJsonWriter;
19typedef struct _json_value json_value;
20
22{
23public:
25 {
26 DISABLED,
27 ACTION,
28 AIM,
29 FIRE,
30 HOOK,
31 NUM_STATES
32 };
34 {
35 DISABLED,
36 AIM,
37 NUM_STATES
38 };
39
40 int Sizeof() const override { return sizeof(*this); }
41 void OnInit() override;
42 void OnReset() override;
43 void OnWindowResize() override;
44 bool OnTouchState(const std::vector<IInput::CTouchFingerState> &vTouchFingerStates) override;
45 void OnRender() override;
46
47 bool LoadConfigurationFromFile(int StorageType);
51
54 {
56 m_EditingChanges = true;
57 }
60 {
62 m_EditingChanges = true;
63 }
64 bool IsEditingActive() const { return m_EditingActive; }
65 void SetEditingActive(bool EditingActive) { m_EditingActive = EditingActive; }
66 bool HasEditingChanges() const { return m_EditingChanges; }
67 void SetEditingChanges(bool EditingChanges) { m_EditingChanges = EditingChanges; }
68
69private:
70 static constexpr const char *const DIRECT_TOUCH_INGAME_MODE_NAMES[(int)EDirectTouchIngameMode::NUM_STATES] = {"disabled", "action", "aim", "fire", "hook"};
71 static constexpr const char *const DIRECT_TOUCH_SPECTATE_MODE_NAMES[(int)EDirectTouchSpectateMode::NUM_STATES] = {"disabled", "aim"};
72
73 enum class EButtonShape
74 {
75 RECT,
76 CIRCLE,
77 NUM_SHAPES
78 };
79
80 static constexpr const char *const SHAPE_NAMES[(int)EButtonShape::NUM_SHAPES] = {"rect", "circle"};
81
83 {
84 INGAME,
85 ZOOM_ALLOWED,
86 VOTE_ACTIVE,
87 DUMMY_ALLOWED,
88 DUMMY_CONNECTED,
89 RCON_AUTHED,
90 DEMO_PLAYER,
91 EXTRA_MENU_1,
92 EXTRA_MENU_2,
93 EXTRA_MENU_3,
94 EXTRA_MENU_4,
95 EXTRA_MENU_5,
96 NUM_VISIBILITIES
97 };
98
100 {
101 public:
104
106 m_Type(Type), m_Parity(Parity) {}
107 };
108
110 {
111 public:
112 const char *m_pId;
113 std::function<bool()> m_Function;
114 };
115
117
118 enum
119 {
124 };
125
127 {
128 public:
129 enum class EType
130 {
134 PLAIN,
139 LOCALIZED,
143 ICON,
147 NUM_TYPES
148 };
149
151 const char *m_pLabel;
152 };
153
154 static constexpr const char *const LABEL_TYPE_NAMES[(int)CButtonLabel::EType::NUM_TYPES] = {"plain", "localized", "icon"};
155
157 {
158 public:
159 int m_X;
160 int m_Y;
161 int m_W;
162 int m_H;
163 };
164
166
168 {
169 public:
170 CTouchButton(CTouchControls *pTouchControls);
171 CTouchButton(CTouchButton &&Other) noexcept;
172 CTouchButton(const CTouchButton &Other) = delete;
173
174 CTouchButton &operator=(const CTouchButton &Other) = delete;
175 CTouchButton &operator=(CTouchButton &&Other) noexcept;
176
178
181
183 int m_BackgroundCorners; // only used with EButtonShape::RECT
184
185 std::vector<CButtonVisibility> m_vVisibilities;
186 std::unique_ptr<CTouchButtonBehavior> m_pBehavior;
187
189 std::chrono::nanoseconds m_VisibilityStartTime;
190
191 void UpdatePointers();
194
195 vec2 ClampTouchPosition(vec2 TouchPosition) const;
196 bool IsInside(vec2 TouchPosition) const;
197 void UpdateVisibility();
198 bool IsVisible() const;
199 void Render() const;
200 void WriteToConfiguration(CJsonWriter *pWriter);
201 };
202
204 {
205 public:
208
209 bool m_Active; // variables below must only be used when active
213 std::chrono::nanoseconds m_ActivationStartTime;
214
215 virtual ~CTouchButtonBehavior() = default;
216 virtual void Init(CTouchButton *pTouchButton);
217
218 void Reset();
219 void SetActive(const IInput::CTouchFingerState &FingerState);
220 void SetInactive();
221 bool IsActive() const;
222 bool IsActive(const IInput::CTouchFinger &Finger) const;
223
224 virtual CButtonLabel GetLabel() const = 0;
225 virtual void OnActivate() {}
226 virtual void OnDeactivate() {}
227 virtual void OnUpdate() {}
228 virtual void WriteToConfiguration(CJsonWriter *pWriter) = 0;
229 };
230
237 {
238 public:
239 static constexpr const char *const BEHAVIOR_TYPE = "predefined";
240
242 m_pId(pId) {}
243
248 void WriteToConfiguration(CJsonWriter *pWriter) override;
249
250 private:
251 const char *m_pId;
252 };
253
255 {
256 public:
257 static constexpr const char *const BEHAVIOR_ID = "ingame-menu";
258
261
262 CButtonLabel GetLabel() const override;
263 void OnDeactivate() override;
264 };
265
267 {
268 public:
269 static constexpr const char *const BEHAVIOR_ID = "extra-menu";
270
272
273 CButtonLabel GetLabel() const override;
274 void OnDeactivate() override;
275 void WriteToConfiguration(CJsonWriter *pWriter) override;
276
277 private:
279 char m_aLabel[16];
280 };
281
283 {
284 public:
285 static constexpr const char *const BEHAVIOR_ID = "emoticon";
286
289
290 CButtonLabel GetLabel() const override;
291 void OnDeactivate() override;
292 };
293
295 {
296 public:
297 static constexpr const char *const BEHAVIOR_ID = "spectate";
298
301
302 CButtonLabel GetLabel() const override;
303 void OnDeactivate() override;
304 };
305
307 {
308 public:
309 static constexpr const char *const BEHAVIOR_ID = "swap-action";
310
313
314 CButtonLabel GetLabel() const override;
315 void OnActivate() override;
316 void OnDeactivate() override;
317
318 private:
320 };
321
323 {
324 public:
325 static constexpr const char *const BEHAVIOR_ID = "use-action";
326
329
330 CButtonLabel GetLabel() const override;
331 void OnActivate() override;
332 void OnDeactivate() override;
333
334 private:
336 };
337
339 {
340 public:
343
344 CButtonLabel GetLabel() const override;
345 void OnActivate() override;
346 void OnDeactivate() override;
347 void OnUpdate() override;
348 int ActiveAction() const { return m_ActiveAction; }
349 virtual int SelectedAction() const = 0;
350
351 private:
353 };
354
356 {
357 public:
358 static constexpr const char *const BEHAVIOR_ID = "joystick-action";
359
362
363 void Init(CTouchButton *pTouchButton) override;
364 int SelectedAction() const override;
365 };
366
368 {
369 public:
370 static constexpr const char *const BEHAVIOR_ID = "joystick-aim";
371
374
375 int SelectedAction() const override;
376 };
377
379 {
380 public:
381 static constexpr const char *const BEHAVIOR_ID = "joystick-fire";
382
385
386 int SelectedAction() const override;
387 };
388
390 {
391 public:
392 static constexpr const char *const BEHAVIOR_ID = "joystick-hook";
393
396
397 int SelectedAction() const override;
398 };
399
404 {
405 public:
406 static constexpr const char *const BEHAVIOR_TYPE = "bind";
407
408 CBindTouchButtonBehavior(const char *pLabel, CButtonLabel::EType LabelType, const char *pCommand) :
409 m_Label(pLabel),
410 m_LabelType(LabelType),
411 m_Command(pCommand) {}
412
413 CButtonLabel GetLabel() const override;
414 void OnActivate() override;
415 void OnDeactivate() override;
416 void OnUpdate() override;
417 void WriteToConfiguration(CJsonWriter *pWriter) override;
418
419 private:
420 std::string m_Label;
422 std::string m_Command;
423
424 bool m_Repeating = false;
425 std::chrono::nanoseconds m_LastUpdateTime;
426 std::chrono::nanoseconds m_AccumulatedRepeatingTime;
427 };
428
433 {
434 public:
435 static constexpr const char *const BEHAVIOR_TYPE = "bind-toggle";
436
438 {
439 public:
440 std::string m_Label;
442 std::string m_Command;
443
444 CCommand(const char *pLabel, CButtonLabel::EType LabelType, const char *pCommand) :
445 m_Label(pLabel),
446 m_LabelType(LabelType),
447 m_Command(pCommand) {}
448 };
449
450 CBindToggleTouchButtonBehavior(std::vector<CCommand> &&vCommands) :
451 m_vCommands(std::move(vCommands)) {}
452
453 CButtonLabel GetLabel() const override;
454 void OnActivate() override;
455 void WriteToConfiguration(CJsonWriter *pWriter) override;
456
457 private:
458 std::vector<CCommand> m_vCommands;
460 };
461
468
475
481 std::vector<CTouchButton> m_vTouchButtons;
482
487
492
498
500 {
501 public:
502 bool m_Active = false;
504 };
505
510
517
521 bool m_EditingActive = false;
522
526 bool m_EditingChanges = false;
527
529 int NextActiveAction(int Action) const;
530 int NextDirectTouchAction() const;
531 void UpdateButtons(const std::vector<IInput::CTouchFingerState> &vTouchFingerStates);
532 void ResetButtons();
533 void RenderButtons();
535
536 bool ParseConfiguration(const void *pFileData, unsigned FileLength);
537 std::optional<EDirectTouchIngameMode> ParseDirectTouchIngameMode(const json_value *pModeValue);
538 std::optional<EDirectTouchSpectateMode> ParseDirectTouchSpectateMode(const json_value *pModeValue);
539 std::optional<CTouchButton> ParseButton(const json_value *pButtonObject);
540 std::unique_ptr<CTouchButtonBehavior> ParseBehavior(const json_value *pBehaviorObject);
541 std::unique_ptr<CPredefinedTouchButtonBehavior> ParsePredefinedBehavior(const json_value *pBehaviorObject);
542 std::unique_ptr<CExtraMenuTouchButtonBehavior> ParseExtraMenuBehavior(const json_value *pBehaviorObject);
543 std::unique_ptr<CBindTouchButtonBehavior> ParseBindBehavior(const json_value *pBehaviorObject);
544 std::unique_ptr<CBindToggleTouchButtonBehavior> ParseBindToggleBehavior(const json_value *pBehaviorObject);
545 void WriteConfiguration(CJsonWriter *pWriter);
546};
547
548#endif
Definition: component.h:20
Definition: jsonwriter.h:15
Definition: touch_controls.h:500
IInput::CTouchFinger m_Finger
Definition: touch_controls.h:503
bool m_Active
Definition: touch_controls.h:502
std::string m_Label
Definition: touch_controls.h:440
CButtonLabel::EType m_LabelType
Definition: touch_controls.h:441
CCommand(const char *pLabel, CButtonLabel::EType LabelType, const char *pCommand)
Definition: touch_controls.h:444
std::string m_Command
Definition: touch_controls.h:442
Definition: touch_controls.h:433
CBindToggleTouchButtonBehavior(std::vector< CCommand > &&vCommands)
Definition: touch_controls.h:450
CButtonLabel GetLabel() const override
Definition: touch_controls.cpp:668
std::vector< CCommand > m_vCommands
Definition: touch_controls.h:458
static constexpr const char *const BEHAVIOR_TYPE
Definition: touch_controls.h:435
void OnActivate() override
Definition: touch_controls.cpp:674
void WriteToConfiguration(CJsonWriter *pWriter) override
Definition: touch_controls.cpp:680
size_t m_ActiveCommandIndex
Definition: touch_controls.h:459
Definition: touch_controls.h:404
CBindTouchButtonBehavior(const char *pLabel, CButtonLabel::EType LabelType, const char *pCommand)
Definition: touch_controls.h:408
std::chrono::nanoseconds m_AccumulatedRepeatingTime
Definition: touch_controls.h:426
void OnActivate() override
Definition: touch_controls.cpp:620
CButtonLabel::EType m_LabelType
Definition: touch_controls.h:421
std::chrono::nanoseconds m_LastUpdateTime
Definition: touch_controls.h:425
std::string m_Command
Definition: touch_controls.h:422
void OnUpdate() override
Definition: touch_controls.cpp:631
CButtonLabel GetLabel() const override
Definition: touch_controls.cpp:615
void WriteToConfiguration(CJsonWriter *pWriter) override
Definition: touch_controls.cpp:652
std::string m_Label
Definition: touch_controls.h:420
static constexpr const char *const BEHAVIOR_TYPE
Definition: touch_controls.h:406
void OnDeactivate() override
Definition: touch_controls.cpp:626
bool m_Repeating
Definition: touch_controls.h:424
Definition: touch_controls.h:127
EType m_Type
Definition: touch_controls.h:150
const char * m_pLabel
Definition: touch_controls.h:151
EType
Definition: touch_controls.h:130
Definition: touch_controls.h:110
std::function< bool()> m_Function
Definition: touch_controls.h:113
const char * m_pId
Definition: touch_controls.h:112
Definition: touch_controls.h:100
CButtonVisibility(EButtonVisibility Type, bool Parity)
Definition: touch_controls.h:105
EButtonVisibility m_Type
Definition: touch_controls.h:102
bool m_Parity
Definition: touch_controls.h:103
Definition: touch_controls.h:283
CEmoticonTouchButtonBehavior()
Definition: touch_controls.h:287
CButtonLabel GetLabel() const override
Definition: touch_controls.cpp:448
void OnDeactivate() override
Definition: touch_controls.cpp:453
static constexpr const char *const BEHAVIOR_ID
Definition: touch_controls.h:285
Definition: touch_controls.h:267
void WriteToConfiguration(CJsonWriter *pWriter) override
Definition: touch_controls.cpp:439
static constexpr const char *const BEHAVIOR_ID
Definition: touch_controls.h:269
int m_Number
Definition: touch_controls.h:278
CExtraMenuTouchButtonBehavior(int Number)
Definition: touch_controls.cpp:401
CButtonLabel GetLabel() const override
Definition: touch_controls.cpp:415
void OnDeactivate() override
Definition: touch_controls.cpp:427
char m_aLabel[16]
Definition: touch_controls.h:279
Definition: touch_controls.h:255
void OnDeactivate() override
Definition: touch_controls.cpp:393
static constexpr const char *const BEHAVIOR_ID
Definition: touch_controls.h:257
CButtonLabel GetLabel() const override
Definition: touch_controls.cpp:388
CIngameMenuTouchButtonBehavior()
Definition: touch_controls.h:259
CJoystickActionTouchButtonBehavior()
Definition: touch_controls.h:360
void Init(CTouchButton *pTouchButton) override
Definition: touch_controls.cpp:585
static constexpr const char *const BEHAVIOR_ID
Definition: touch_controls.h:358
int SelectedAction() const override
Definition: touch_controls.cpp:591
Definition: touch_controls.h:368
int SelectedAction() const override
Definition: touch_controls.cpp:597
CJoystickAimTouchButtonBehavior()
Definition: touch_controls.h:372
static constexpr const char *const BEHAVIOR_ID
Definition: touch_controls.h:370
Definition: touch_controls.h:379
int SelectedAction() const override
Definition: touch_controls.cpp:603
static constexpr const char *const BEHAVIOR_ID
Definition: touch_controls.h:381
CJoystickFireTouchButtonBehavior()
Definition: touch_controls.h:383
Definition: touch_controls.h:390
int SelectedAction() const override
Definition: touch_controls.cpp:609
static constexpr const char *const BEHAVIOR_ID
Definition: touch_controls.h:392
CJoystickHookTouchButtonBehavior()
Definition: touch_controls.h:394
Definition: touch_controls.h:339
CJoystickTouchButtonBehavior(const char *pId)
Definition: touch_controls.h:341
int ActiveAction() const
Definition: touch_controls.h:348
void OnActivate() override
Definition: touch_controls.cpp:541
void OnDeactivate() override
Definition: touch_controls.cpp:551
int m_ActiveAction
Definition: touch_controls.h:352
void OnUpdate() override
Definition: touch_controls.cpp:560
CButtonLabel GetLabel() const override
Definition: touch_controls.cpp:532
Definition: touch_controls.h:237
void WriteToConfiguration(CJsonWriter *pWriter) override
Definition: touch_controls.cpp:378
static constexpr const char *const BEHAVIOR_TYPE
Definition: touch_controls.h:239
const char * m_pId
Definition: touch_controls.h:251
CPredefinedTouchButtonBehavior(const char *pId)
Definition: touch_controls.h:241
Definition: touch_controls.h:295
static constexpr const char *const BEHAVIOR_ID
Definition: touch_controls.h:297
void OnDeactivate() override
Definition: touch_controls.cpp:464
CSpectateTouchButtonBehavior()
Definition: touch_controls.h:299
CButtonLabel GetLabel() const override
Definition: touch_controls.cpp:459
Definition: touch_controls.h:307
void OnDeactivate() override
Definition: touch_controls.cpp:500
static constexpr const char *const BEHAVIOR_ID
Definition: touch_controls.h:309
void OnActivate() override
Definition: touch_controls.cpp:486
int m_ActiveAction
Definition: touch_controls.h:319
CButtonLabel GetLabel() const override
Definition: touch_controls.cpp:472
CSwapActionTouchButtonBehavior()
Definition: touch_controls.h:311
Definition: touch_controls.h:204
virtual CButtonLabel GetLabel() const =0
bool m_Active
Definition: touch_controls.h:209
virtual void OnDeactivate()
Definition: touch_controls.h:226
virtual void Init(CTouchButton *pTouchButton)
Definition: touch_controls.cpp:321
std::chrono::nanoseconds m_ActivationStartTime
Definition: touch_controls.h:213
virtual void WriteToConfiguration(CJsonWriter *pWriter)=0
IInput::CTouchFinger m_Finger
Definition: touch_controls.h:210
vec2 m_ActivePosition
Definition: touch_controls.h:211
bool IsActive() const
Definition: touch_controls.cpp:368
vec2 m_AccumulatedDelta
Definition: touch_controls.h:212
CTouchButton * m_pTouchButton
Definition: touch_controls.h:206
void SetInactive()
Definition: touch_controls.cpp:359
void SetActive(const IInput::CTouchFingerState &FingerState)
Definition: touch_controls.cpp:332
void Reset()
Definition: touch_controls.cpp:327
CTouchControls * m_pTouchControls
Definition: touch_controls.h:207
virtual void OnUpdate()
Definition: touch_controls.h:227
virtual void OnActivate()
Definition: touch_controls.h:225
Definition: touch_controls.h:168
EButtonShape m_Shape
Definition: touch_controls.h:182
bool IsVisible() const
Definition: touch_controls.cpp:232
CUnitRect m_UnitRect
Definition: touch_controls.h:179
std::unique_ptr< CTouchButtonBehavior > m_pBehavior
Definition: touch_controls.h:186
void UpdateBackgroundCorners()
Definition: touch_controls.cpp:110
void UpdateScreenFromUnitRect()
Definition: touch_controls.cpp:86
std::vector< CButtonVisibility > m_vVisibilities
Definition: touch_controls.h:185
vec2 ClampTouchPosition(vec2 TouchPosition) const
Definition: touch_controls.cpp:177
bool m_VisibilityCached
Definition: touch_controls.h:188
bool IsInside(vec2 TouchPosition) const
Definition: touch_controls.cpp:206
CTouchControls * m_pTouchControls
Definition: touch_controls.h:177
CTouchButton & operator=(const CTouchButton &Other)=delete
void Render() const
Definition: touch_controls.cpp:238
CUIRect m_ScreenRect
Definition: touch_controls.h:180
std::chrono::nanoseconds m_VisibilityStartTime
Definition: touch_controls.h:189
int m_BackgroundCorners
Definition: touch_controls.h:183
void WriteToConfiguration(CJsonWriter *pWriter)
Definition: touch_controls.cpp:286
CTouchButton(CTouchControls *pTouchControls)
Definition: touch_controls.cpp:52
void UpdateVisibility()
Definition: touch_controls.cpp:220
void UpdatePointers()
Definition: touch_controls.cpp:81
CTouchButton(const CTouchButton &Other)=delete
Definition: touch_controls.h:157
int m_Y
Definition: touch_controls.h:160
int m_X
Definition: touch_controls.h:159
int m_H
Definition: touch_controls.h:162
int m_W
Definition: touch_controls.h:161
Definition: touch_controls.h:323
int m_ActiveAction
Definition: touch_controls.h:335
CUseActionTouchButtonBehavior()
Definition: touch_controls.h:327
void OnDeactivate() override
Definition: touch_controls.cpp:525
static constexpr const char *const BEHAVIOR_ID
Definition: touch_controls.h:325
void OnActivate() override
Definition: touch_controls.cpp:519
CButtonLabel GetLabel() const override
Definition: touch_controls.cpp:510
Definition: touch_controls.h:22
void UpdateButtons(const std::vector< IInput::CTouchFingerState > &vTouchFingerStates)
Definition: touch_controls.cpp:915
void OnWindowResize() override
Definition: touch_controls.cpp:722
void RenderButtons()
Definition: touch_controls.cpp:1096
void OnReset() override
Definition: touch_controls.cpp:716
std::optional< EDirectTouchIngameMode > ParseDirectTouchIngameMode(const json_value *pModeValue)
Definition: touch_controls.cpp:1189
void WriteConfiguration(CJsonWriter *pWriter)
Definition: touch_controls.cpp:1549
int m_DirectTouchLastAction
Definition: touch_controls.h:497
int NextActiveAction(int Action) const
Definition: touch_controls.cpp:865
void SaveConfigurationToClipboard()
Definition: touch_controls.cpp:805
int m_ActionSelected
Definition: touch_controls.h:491
void SetEditingActive(bool EditingActive)
Definition: touch_controls.h:65
void OnRender() override
Definition: touch_controls.cpp:751
int NextDirectTouchAction() const
Definition: touch_controls.cpp:879
EButtonShape
Definition: touch_controls.h:74
static constexpr const char *const SHAPE_NAMES[(int) EButtonShape::NUM_SHAPES]
Definition: touch_controls.h:80
bool m_aExtraMenuActive[(int) EButtonVisibility::EXTRA_MENU_5 -(int) EButtonVisibility::EXTRA_MENU_1+1]
Definition: touch_controls.h:486
bool IsEditingActive() const
Definition: touch_controls.h:64
int Sizeof() const override
Definition: touch_controls.h:40
EDirectTouchSpectateMode DirectTouchSpectate() const
Definition: touch_controls.h:58
bool LoadConfigurationFromClipboard()
Definition: touch_controls.cpp:785
std::optional< EDirectTouchSpectateMode > ParseDirectTouchSpectateMode(const json_value *pModeValue)
Definition: touch_controls.cpp:1219
std::optional< CTouchButton > ParseButton(const json_value *pButtonObject)
Definition: touch_controls.cpp:1249
std::unique_ptr< CBindTouchButtonBehavior > ParseBindBehavior(const json_value *pBehaviorObject)
Definition: touch_controls.cpp:1449
bool m_EditingActive
Definition: touch_controls.h:521
vec2 CalculateScreenSize() const
Definition: touch_controls.cpp:1109
std::unique_ptr< CBindToggleTouchButtonBehavior > ParseBindToggleBehavior(const json_value *pBehaviorObject)
Definition: touch_controls.cpp:1490
CActionState m_aDirectTouchActionStates[NUM_ACTIONS]
Definition: touch_controls.h:509
static constexpr const char *const DIRECT_TOUCH_SPECTATE_MODE_NAMES[(int) EDirectTouchSpectateMode::NUM_STATES]
Definition: touch_controls.h:71
std::vector< CTouchButton > m_vTouchButtons
Definition: touch_controls.h:481
bool LoadConfigurationFromFile(int StorageType)
Definition: touch_controls.cpp:770
void OnInit() override
Definition: touch_controls.cpp:707
void SetDirectTouchSpectate(EDirectTouchSpectateMode DirectTouchSpectate)
Definition: touch_controls.h:59
void SetEditingChanges(bool EditingChanges)
Definition: touch_controls.h:67
std::unique_ptr< CExtraMenuTouchButtonBehavior > ParseExtraMenuBehavior(const json_value *pBehaviorObject)
Definition: touch_controls.cpp:1432
EDirectTouchIngameMode
Definition: touch_controls.h:25
EDirectTouchIngameMode DirectTouchIngame() const
Definition: touch_controls.h:52
bool HasEditingChanges() const
Definition: touch_controls.h:66
std::unique_ptr< CPredefinedTouchButtonBehavior > ParsePredefinedBehavior(const json_value *pBehaviorObject)
Definition: touch_controls.cpp:1393
void SetDirectTouchIngame(EDirectTouchIngameMode DirectTouchIngame)
Definition: touch_controls.h:53
bool ParseConfiguration(const void *pFileData, unsigned FileLength)
Definition: touch_controls.cpp:1116
@ ACTION_AIM
Definition: touch_controls.h:120
@ ACTION_HOOK
Definition: touch_controls.h:122
@ NUM_ACTIONS
Definition: touch_controls.h:123
@ ACTION_FIRE
Definition: touch_controls.h:121
void ResetButtons()
Definition: touch_controls.cpp:1084
bool OnTouchState(const std::vector< IInput::CTouchFingerState > &vTouchFingerStates) override
Definition: touch_controls.cpp:731
CButtonVisibilityData m_aVisibilityFunctions[(int) EButtonVisibility::NUM_VISIBILITIES]
Definition: touch_controls.h:116
static constexpr const char *const LABEL_TYPE_NAMES[(int) CButtonLabel::EType::NUM_TYPES]
Definition: touch_controls.h:154
std::unique_ptr< CTouchButtonBehavior > ParseBehavior(const json_value *pBehaviorObject)
Definition: touch_controls.cpp:1358
EDirectTouchIngameMode m_DirectTouchIngame
Definition: touch_controls.h:467
bool SaveConfigurationToFile()
Definition: touch_controls.cpp:791
bool m_EditingChanges
Definition: touch_controls.h:526
EButtonVisibility
Definition: touch_controls.h:83
EDirectTouchSpectateMode
Definition: touch_controls.h:34
CJoystickActionTouchButtonBehavior * m_pPrimaryJoystickTouchButtonBehavior
Definition: touch_controls.h:516
void InitVisibilityFunctions()
Definition: touch_controls.cpp:813
static constexpr const char *const DIRECT_TOUCH_INGAME_MODE_NAMES[(int) EDirectTouchIngameMode::NUM_STATES]
Definition: touch_controls.h:70
EDirectTouchSpectateMode m_DirectTouchSpectate
Definition: touch_controls.h:474
Definition: ui_rect.h:11
Definition: input.h:136
Definition: input.h:122
struct _json_value json_value
Definition: serverbrowser.h:17