|
VR-Engage
2.2
|
The DtDriverMenuLogic processes menu actions related to vehicle control and forwards them to the DtDriverControlLogic component. It specifically handles the "DriverMovementGroup" menu action, sending appropriate joystick messages with timing to simulate button presses.
This component works in conjunction with the DtDriverControlLogic component, which it locates during post-initialization.
#include <driverMenuLogic.h>
Public Member Functions | |
| DtDriverMenuLogic () | |
| virtual | ~DtDriverMenuLogic () override |
| virtual bool | initialize (DtPlayerStation *player, DtInitTable &config) override |
| virtual bool | postInitialize () override |
| virtual void | tick (double dt) override |
| virtual void | shutdown () override |
| virtual const char * | type () const override |
| virtual DtVreMessageResult | handleMenuMessage (makVre::DtVreMessage *msg) |
Public Member Functions inherited from makVre::DtPlayerComponent | |
| DtPlayerComponent () | |
| virtual | ~DtPlayerComponent () |
| virtual void | setName (const std::string &name) |
| virtual const std::string & | name () |
| virtual DtPlayerStation & | player () |
| virtual DtAttributeHandle & | playerAttributeStore () |
| virtual const DtAttributeHandle & | playerAttributeStore () const |
Protected Attributes | |
| DtDriverControlLogic * | myCarControlLogic |
Protected Attributes inherited from makVre::DtPlayerComponent | |
| std::string | myName |
| DtInitTable | myConfig |
| DtPlayerStation * | myPlayer |
| makVrv::DtDe * | myDe |
| DtEntityResolver * | myResolver |
| DtAttributeCallbackManager | myAttributeCallbacks |
Additional Inherited Members | |
Protected Member Functions inherited from makVre::DtPlayerComponent | |
| virtual void | initializeStateAttributes () |
| makVre::DtDriverMenuLogic::DtDriverMenuLogic | ( | ) |
Constructor for DtDriverMenuLogic.
Initializes the component with the name "DtDriverMenuLogic".
|
overridevirtual |
Virtual destructor for DtDriverMenuLogic.
|
overridevirtual |
Initializes the component with configuration from Lua.
Sets up a message handler for the MenuActionMessage type.
| player | Pointer to the player station this component belongs to |
| config | Configuration table containing initialization parameters |
Reimplemented from makVre::DtPlayerComponent.
References makVre::DtPlayerComponent::player().
|
overridevirtual |
Performs post-initialization setup.
Locates the DtDriverControlLogic component that will be used to execute vehicle control actions triggered through the menu system.
Reimplemented from makVre::DtPlayerComponent.
|
overridevirtual |
Updates the component state (empty implementation)
This method is called each frame but currently has no implementation.
| dt | Delta time in seconds since the last tick |
Implements makVre::DtPlayerComponent.
|
overridevirtual |
Shuts down the component.
Removes the MenuActionMessage handler.
Reimplemented from makVre::DtPlayerComponent.
|
overridevirtual |
Returns the component type identifier.
Implements makVre::DtPlayerComponent.
|
virtual |
Handles menu action messages.
Processes the "DriverMovementGroup" menu action by forwarding the action's parameter to the DtDriverControlLogic as a joystick message. It sends two messages: one with value 1 immediately, and another with value 0 after a short delay (0.1 seconds), simulating a button press and release.
| msg | The message to process |
|
protected |
Pointer to the driver control logic component.
This component is located during post-initialization and is used to execute vehicle control actions triggered through the menu system.