Lyliya / RocketStats

BakkesMod plugin for session information (MMR, Win, Loss, Streak, eg.) in game and in OBS
https://bakkesplugins.com/plugins/view/30
MIT License
29 stars 9 forks source link

Only call ShowPlugin() onLoad() if is_in_menu is true #26

Closed 2008Choco closed 4 days ago

2008Choco commented 2 years ago

Currently when RocketStats is loaded (which generally occurs automatically when BakkesMod has been injected), the RS menu is toggled on by default. It is currently assumed that RS will always be loaded when the game starts and the menu is therefore displayed, however this is not always the case, such as when BakkesMod is injected while the player is in freeplay or training. The menu stays displayed until the player enters and exits the RocketLeague pause menu.

This PR adds an additional check for is_in_menu before toggling on the menu when the plugin loads so that it is not displayed while in freeplay (or otherwise hidden states).

image

Admittedly, I do not have much experience at all with BakkesMod plugins and am uncertain how to go about setting up a development environment and build this project, let alone test it locally. I'm unsure if this patch even functions as desired. I made these changes based purely on a brief code assessment. If this is not the solution, I apologize and hope to at least bring attention to the issue at hand

Arubinu commented 2 years ago

Hello, thank you for this PR.

I don't think this is the solution, because in this case the plugin won't load at all after the Freeplay session.

I try to delve into this problem, but I let others have their opinion.

To explain to you despite everything, BakkesMod does not often allow you to have information if you do not go through the Hooks. Suddenly loading it is difficult to deduce certain things.

2008Choco commented 2 years ago

To explain to you despite everything, BakkesMod does not often allow you to have information if you do not go through the Hooks. Suddenly loading it is difficult to deduce certain things.

So perhaps instead a call to TogglePlugin("onLoad", ToggleFlags_Hide) after the ShowPlugin() call? Or is loading done much later after onLoad()?