|
wavelength 1.0.0
|
Listener of the controllers that recognises the cheat sequences of the long-cheats section. More...
#include <cheatsmanager.h>


Classes | |
| struct | LongCheat |
| A sequence of presses that runs a script command. More... | |
| struct | ComboCheat |
| A press made while a combination is held that runs a script command. More... | |
Public Types | |
| enum | Combo { kComboLeft = 0 , kComboRight = 1 , kComboCount = 2 } |
| Combinations that select a table of mComboCheats. More... | |
Public Member Functions | |
| ~CheatsManager () override=default | |
| Destroy the object. | |
| CheatsManager () | |
| Construct a manager with no cheat. | |
| void | RunAction (DataArray *pAction, int nPad) |
| Run a cheat's script command, first storing the controller in its controller entry. | |
| bool | HandleButton (JoypadInputMsg *pMsg) |
| Add a press to the history and run every cheat it completes. | |
| bool | DispatchPriv (Message *pMsg) override |
| Handle controller button messages. | |
| CheatsManager () | |
| Create a manager with no cheats. | |
| virtual | ~CheatsManager () |
| Destroy the cheats. | |
| virtual bool | DispatchPriv (Message *msg) |
| Handle a button message. | |
| void | ExecuteCheat (DataArray *command, int pad) |
| Run a cheat's command, first setting its controller entry to the controller. | |
| bool | OnButtonDown (JoypadButtonMsg *msg) |
| Run the cheats a button change completes. | |
| Public Member Functions inherited from MsgSink | |
| void * | operator new (size_t nSize) |
| Allocate a sink from the pool heaps under the tag "MsgSink". | |
| void | operator delete (void *pBlock) |
| Return a sink to the pool heaps. | |
| virtual | ~MsgSink () |
| virtual bool | Dispatch (Message *pMsg) |
| Accept a message. | |
| void * | operator new (size_t size) |
| Allocate from the main heap under the name MsgSink. | |
| void | operator delete (void *mem) |
| Return memory to its heap. | |
| virtual | ~MsgSink () |
| Destroy the sink. | |
| virtual bool | Dispatch (Message *msg) |
| Handle a message. | |
Static Public Member Functions | |
| static int | IsCheatEntered () |
| Report whether a cheat that marks the game was entered. | |
| static void | Init () |
| Create the one instance, listen to the controllers, load the long-cheats section, and register the test script command. | |
| static void | Terminate () |
| Stop listening to the controllers and delete the one instance. | |
Public Attributes | |
| std::vector< QuickCheat > | mQuickCheats [2] |
| std::deque< int > | mButtons |
| float | mLastTime |
| bool | mFlags |
Static Public Attributes | |
| static constexpr int | kMaxHistory = 16 |
| Presses mHistory retains. | |
| static constexpr int | kMaxCheatButtons = 16 |
| Buttons one long cheat may have. | |
Listener of the controllers that recognises the cheat sequences of the long-cheats section.
Runs script commands entered on a controller.
The RTTI records the class as deriving from MsgSink. The object is 0x6c bytes and its vtable is at 0x003d6e48. Init() creates the one instance.
The RTTI records the class as deriving from MsgSink. The object is 0x58 bytes. A quick cheat runs when its button is pressed while the left or right modifier combination is held. A long cheat runs when the last buttons pressed, each within 750 milliseconds of the one before, match its sequence.
| enum CheatsManager::Combo |
|
overridedefault |
Destroy the object.
| CheatsManager::CheatsManager | ( | ) |
Construct a manager with no cheat.
| CheatsManager::CheatsManager | ( | ) |
Create a manager with no cheats.
|
virtual |
Destroy the cheats.
Their commands are not released.
| void CheatsManager::RunAction | ( | DataArray * | pAction, |
| int | nPad ) |
Run a cheat's script command, first storing the controller in its controller entry.
| pAction | The command. |
| nPad | The controller that entered the cheat. |
| bool CheatsManager::HandleButton | ( | JoypadInputMsg * | pMsg | ) |
Add a press to the history and run every cheat it completes.
A press more than 750 milliseconds after the previous one starts a new history. A long cheat matches when its presses open the history, and the history is then cleared.
| pMsg | The press or release. |
|
overridevirtual |
Handle controller button messages.
| pMsg | The message. |
Implements MsgSink.
|
static |
Report whether a cheat that marks the game was entered.
|
static |
Create the one instance, listen to the controllers, load the long-cheats section, and register the test script command.
|
static |
Stop listening to the controllers and delete the one instance.
|
virtual |
Handle a button message.
| msg | The message. |
Implements MsgSink.
| void CheatsManager::ExecuteCheat | ( | DataArray * | command, |
| int | pad ) |
Run a cheat's command, first setting its controller entry to the controller.
| command | The command. |
| pad | The controller. |
| bool CheatsManager::OnButtonDown | ( | JoypadButtonMsg * | msg | ) |
Run the cheats a button change completes.
| msg | The button change. |
|
staticconstexpr |
Presses mHistory retains.
|
staticconstexpr |
Buttons one long cheat may have.
| std::vector<QuickCheat> CheatsManager::mQuickCheats[2] |
The quick cheats of the left and right modifiers.
| std::deque<int> CheatsManager::mButtons |
The last buttons pressed, oldest first.
| float CheatsManager::mLastTime |
When the last button was pressed, in ms.
| bool CheatsManager::mFlags |
The flags of the long cheats that ran.