boyestrous / elite-vr-cockpit

A SteamVR Overlay providing a virtual throttle and joystick and holographic buttons for ship functions, with custom integration into Elite Dangerous
Other
18 stars 1 forks source link

Headlook problem with mode changes #13

Closed boyestrous closed 1 year ago

boyestrous commented 1 year ago

I turned off Headlook Mode temporarily and noticed that the overlay won't load the joystick/throttle/holographic buttons when the game starts.

How to recreate

Change the Headlook mode in the in-game bindings. It looks like 5 lines inside the Custom.4.0.binds file changed:

        <UIFocusMode Value="Bindings_FocusModeToggle" /> #value used to be Bindings_FocusModeHold

        <LeftPanelFocusOptions Value="FocusOption_Nothing" />       # value used to be blank
    <CommsPanelFocusOptions Value="FocusOption_Nothing" /> # value used to be blank
    <RolePanelFocusOptions Value="FocusOption_Nothing" />      # value used to be blank
    <RightPanelFocusOptions Value="FocusOption_Nothing" />     # value used to be blank

Additional Details

In the debugger, I noticed that the GuiFocus value was blank when the game loaded, which appeared to be preventing the ModeAnchors from activating correctly.

I was able to get the MainShip cockpit to appear by simulating an EDGuiFocus Event with a value of "NoFocus".

I didn't test whether the MainShip would re-appear after returning from GalaxyMap or FSS Mode...

Potential Solutions

I think this may be fixable by simply setting a default value for the GUIFocus if it is blank or missing. The Status file from my most recent session literally didn't have a key for the GuiFocus value (see below). My assumption is that the GuiFocus values don't start populating in the Status file until the first time it's relevant (like activating a Panel or going to GalaxyMap).

# Status.json example
{
    "timestamp": "2023-08-09T17:19:48Z",
    "event": "Status",
    "Flags": 0
}

Another thing to consider: We should probably add a Holographic button that is bound to changing the selected Panel, so players can leave Headlook mode off if they choose. Or maybe 4 different buttons to activate each one of the panels (if the bindings allow for it).