Etterna 0.74.4
Loading...
Searching...
No Matches
ControllerStateDisplay.h
1/* ControllerStateDisplay - Show the button state of a controller. */
2
3#ifndef ControllerStateDisplay_H
4#define ControllerStateDisplay_H
5
6#include "Etterna/Actor/Base/ActorFrame.h"
7#include "Etterna/Actor/Base/AutoActor.h"
8#include "GameInput.h"
9#include "PlayerNumber.h"
10#include "RageUtil/Misc/RageInput.h"
11
12enum ControllerStateButton
13{
14 ControllerStateButton_UpLeft,
15 ControllerStateButton_UpRight,
16 ControllerStateButton_Center,
17 ControllerStateButton_DownLeft,
18 ControllerStateButton_DownRight,
19 NUM_ControllerStateButton
20};
21
22/*
23enum ControllerDanceButton
24{
25 ControllerDanceButton_Up,
26 ControllerDanceButton_Down,
27 ControllerDanceButton_Left,
28 ControllerDanceButton_Right,
29 ControllerPumpButton_UpLeft,
30 ControllerPumpButton_UpRight,
31 NUM_ControllerDanceButton
32};
33
34enum ControllerPumpButton
35{
36 ControllerPumpButton_UpLeft,
37 ControllerPumpButton_UpRight,
38 ControllerPumpButton_Center,
39 ControllerPumpButton_DownLeft,
40 ControllerPumpButton_DownRight,
41 NUM_ControllerPumpButton
42};
43
44enum ControllerKB7Button
45{
46 ControllerKB7Button_Key1,
47 ControllerKB7Button_Key2,
48 ControllerKB7Button_Key3,
49 ControllerKB7Button_Key4,
50 ControllerKB7Button_Key5,
51 ControllerKB7Button_Key6,
52 ControllerKB7Button_Key7,
53 NUM_ControllerKB7Button
54};
55*/
56
58{
59 public:
61 void LoadMultiPlayer(const std::string& sType, MultiPlayer mp);
62 void LoadGameController(const std::string& sType, GameController gc);
63 void Update(float fDelta) override;
64 [[nodiscard]] bool IsLoaded() const { return m_bIsLoaded; }
65
66 [[nodiscard]] ControllerStateDisplay* Copy() const override;
67
68 // Lua
69 void PushSelf(lua_State* L) override;
70
71 protected:
72 void LoadInternal(const std::string& sType,
73 MultiPlayer mp,
74 GameController gc);
75 MultiPlayer m_mp;
76
77 bool m_bIsLoaded;
78 AutoActor m_sprFrame;
79 struct Button
80 {
81 Button()
82 {
83 di.MakeInvalid();
84 gi.MakeInvalid();
85 }
86
87 AutoActor spr;
88 DeviceInput di;
89 GameInput gi;
90 };
91 Button m_Buttons[NUM_ControllerStateButton];
92
93 InputDeviceState m_idsLast;
94};
95
96#endif
A container for other Actors.
Definition ActorFrame.h:8
A smart pointer for Actor.
Definition AutoActor.h:13
Definition ControllerStateDisplay.h:58
Definition ControllerStateDisplay.h:80
Definition RageInputDevice.h:390
An input event specific to an InputScheme defined by a logical controller and button.
Definition GameInput.h:191