Voxellancer  0.3
A game about voxels in space
 All Classes Functions Pages
inputconfigurator.h
1 #pragma once
2 
3 #include <vector>
4 
5 #include "input/inputmapping.h"
6 #include "property/property.h"
7 
8 
9 class ActionKeyMapping;
11 
12 class HUD;
13 
15 public:
16  InputConfigurator(std::vector<ActionKeyMapping*>* actions, SecondaryInputValues *secondaryInputValues, Property<float>* deadzone, HUD* hud);
17 
18  void startConfiguration(InputClass inputClass);
19  bool isConfiguring();
20  void update();
21 
22  void setActions(std::vector<ActionKeyMapping*>* actions);
23 
24  void setSecondaryInputValues(SecondaryInputValues* values);
25 
26  void setLastInput(InputClass inputClass, InputMapping lastInput);
27 
28  const InputMapping& lastInput(InputClass inputClass);
29 
30 
31 private:
32  std::vector<ActionKeyMapping*>* m_actions;
33  SecondaryInputValues* m_secondaryInputValues;
34  std::vector<float> m_idleValues;
35 
36  HUD* m_hud;
37 
38  Property<float>* prop_deadzoneGamepad;
39 
40  InputMapping lastPrimaryInput;
41  InputMapping lastSecondaryInput;
42 
43  int m_secondaryConfigurationState;
44  int m_primaryConfigurationState;
45 
46  bool m_beginningKeyConfiguration = true;
47  bool m_displayedInstructions = false;
48 
49  bool setActionInputMapping(InputClass inputClass, ActionKeyMapping* action);
50  bool isLastInputValid(InputClass inputClass);
51 
52  bool isKeyPressed(InputClass inputClass);
53  void setupControls(InputClass inputClass);
54  void updateConfiguration(InputClass inputClass);
55 
56  int configurationState(InputClass inputClass);
57  void incrementConfigurationState(InputClass inputClass);
58  void setConfigurationState(int state, InputClass inputClass);
59 
60  void writeConfig();
61 
62 };
Definition: inputmapping.h:16
Definition: actionkeymapping.h:31
Definition: hud.h:34
Definition: actionkeymapping.h:9
Definition: inputconfigurator.h:14