Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Move Delay Frames to Configurable Option in Brawlback Pane of Config #53

Open
WhiteTPoison opened this issue Feb 25, 2024 · 5 comments
Open
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@WhiteTPoison
Copy link
Member

WhiteTPoison commented Feb 25, 2024

There is currently a constant in brawlback-common/BrawlbackConstants.h that defines the amount of delay. I need this to be moved to an option configurable in the Brawlback config menu. The UI element is already there, I just need it to actually impact the amount of delay in the match. Default should be changed to 1.

Note: There is a separate issue for setting this in the game, do not worry about that. This is simply for hooking up the UI element to replace the constant.

@WhiteTPoison WhiteTPoison added enhancement New feature or request help wanted Extra attention is needed labels Feb 25, 2024
@WhiteTPoison WhiteTPoison moved this to Todo in Brawlback Board Feb 25, 2024
@blasphemetheus
Copy link

https://github.com/Brawlback-Team/dolphin/blob/master/Source/Core/DolphinQt/Settings/BrawlbackPane.cpp line 91, the object in question is &BrawlbackPane:SaveSettings, which is line 133.

It uses an SConfig to hold state of the settings, a good alternative example of which is on https://github.com/Brawlback-Team/dolphin/blob/master/Source/Core/DolphinQt/Settings/GeneralPane.cpp line 341.

BrawlbackConstants.h is imported by two files in dolphin,

#include "brawlback-common/BrawlbackConstants.h"
(BrawlbackUtility) and
<ClInclude Include="Core\Brawlback\include\brawlback-common\BrawlbackConstants.h" />
(an xml file that i'm not sure about the details of)

Looks like what's needed is the FRAME_DELAY constant from BrawlbackConstants.h which is used by

frameDiffCheck = frameDiff > FRAME_DELAY;
(TimeSync.cpp) and
for (int i = GAME_START_FRAME; i < FRAME_DELAY; i++)
(EXIBrawlback.cpp) to be replaced with a reference to that setting from dolphin. Hold up I'll try and find an example of this elsewhere in the code

@blasphemetheus
Copy link

blasphemetheus commented Jun 28, 2024

Delay Frames in BrawlbackPane appears to default to 2 as well, instead of 1, not sure why. Thought it might be an off by 1 error (0 to 1, so 1 to 2) but I see no evidence of that in the BrawlbackPane.cpp
image

@blasphemetheus
Copy link

blasphemetheus commented Jun 28, 2024

I think what I'm getting from ConfigManager.h is that referenceds to the frame delay are accessed like so

const SConfig& settings = SConfig::GetInstance();
int frame_delay = settings.m_delayFrames;

and need to remember to change the default m_delayFrames in ConfigManager.h, but I think that's it

@blasphemetheus
Copy link

#58 PR

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
Status: Todo
Development

No branches or pull requests

2 participants