|
VR-Engage
2.2
|
DtAppLauncherComponent allows the system to launch external applications when a player engages in a role. It provides capabilities to configure application paths, working directories, command-line arguments, as well as control the window positioning, sizing, and lifecycle management of the launched application.
#include <appLauncherComponent.h>
Public Slots | |
| void | handleProcessStarted () |
| void | handleProcessFailed (QProcess::ProcessError error) |
| void | handleProcessFinished (int exitCode, QProcess::ExitStatus exitStatus) |
Public Member Functions | |
| DtAppLauncherComponent () | |
| virtual | ~DtAppLauncherComponent () override |
| virtual bool | initialize (DtPlayerStation *station, DtInitTable &config) override |
| virtual void | tick (double dt) override |
| virtual bool | repositionAndResizeWindow () |
| virtual void | shutdown () override |
| virtual const char * | type () const override |
Public Member Functions inherited from makVre::DtPlayerComponent | |
| DtPlayerComponent () | |
| virtual | ~DtPlayerComponent () |
| virtual bool | postInitialize () |
| virtual void | setName (const std::string &name) |
| virtual const std::string & | name () |
| virtual DtPlayerStation & | player () |
| virtual DtAttributeHandle & | playerAttributeStore () |
| virtual const DtAttributeHandle & | playerAttributeStore () const |
Protected Member Functions | |
| virtual void | onCurrentStateChanged (std::string state) |
Protected Member Functions inherited from makVre::DtPlayerComponent | |
| virtual void | initializeStateAttributes () |
Protected Attributes | |
| bool | myShutdownOnDisengage |
| QProcess * | myProcess |
| bool | myWindowPositioned |
| int | myHeight |
| int | myWidth |
| int | myPositionX |
| int | myPositionY |
| std::string | myWindowTitle |
| float | myBackOnTopDelay |
Protected Attributes inherited from makVre::DtPlayerComponent | |
| std::string | myName |
| DtInitTable | myConfig |
| DtPlayerStation * | myPlayer |
| makVrv::DtDe * | myDe |
| DtEntityResolver * | myResolver |
| DtAttributeCallbackManager | myAttributeCallbacks |
| makVre::DtAppLauncherComponent::DtAppLauncherComponent | ( | ) |
Constructor for DtAppLauncherComponent.
Initializes component properties with default values.
|
overridevirtual |
Virtual destructor for DtAppLauncherComponent.
Ensures proper cleanup of resources when the component is destroyed.
|
overridevirtual |
Initializes the component with configuration from Lua.
Sets up the component based on provided configuration, including application path, working directory, command-line arguments, window geometry, and behavior settings. Launches the configured application and sets up signal connections for process events.
| station | Pointer to the player station this component belongs to |
| config | Configuration table containing initialization parameters |
Reimplemented from makVre::DtPlayerComponent.
|
overridevirtual |
Updates the component state.
Called each frame to handle component logic. Manages window positioning and ensures the VR Engage window returns to foreground after a configured delay.
| dt | Delta time in seconds since the last tick |
Implements makVre::DtPlayerComponent.
|
virtual |
Repositions and resizes the launched application window.
Attempts to find the window by title and applies the configured position and size.
|
overridevirtual |
Shuts down the component.
Removes attribute callbacks and terminates the launched process if configured to do so when disengaging.
Reimplemented from makVre::DtPlayerComponent.
|
overridevirtual |
Returns the component type identifier.
Implements makVre::DtPlayerComponent.
|
slot |
Slot called when the launched process has started.
Logs a success message when the external process starts successfully.
|
slot |
Slot called when the launched process fails to start.
Logs a warning when the external process fails to start.
| error | The process error that occurred |
|
slot |
Slot called when the launched process finishes execution.
Cleans up resources and removes the process reference from the attribute store.
| exitCode | The exit code returned by the process |
| exitStatus | The exit status of the process |
|
protectedvirtual |
Called when the current application-level state changes.
Handles state transitions, particularly when entering the ENGAGED state.
| state | The new application state |
|
protected |
Flag indicating whether to shut down the launched application when disengaging.
|
protected |
Pointer to the QProcess object representing the launched application.
|
protected |
Flag indicating whether the window has been positioned.
|
protected |
Desired height for the launched application window in pixels.
|
protected |
Desired width for the launched application window in pixels.
|
protected |
Desired X position for the launched application window.
|
protected |
Desired Y position for the launched application window.
|
protected |
Window title of the launched application used for finding the window handle.
|
protected |
Delay in seconds before bringing the VR Engage window back to the foreground.