Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

DtrBarEntry not re-acquirable after removing it #1862

Open
Haselnussbomber opened this issue Jun 28, 2024 · 0 comments
Open

DtrBarEntry not re-acquirable after removing it #1862

Haselnussbomber opened this issue Jun 28, 2024 · 0 comments
Labels
api 10 regression bug Something isn't working core Dalamud core

Comments

@Haselnussbomber
Copy link
Contributor

Haselnussbomber commented Jun 28, 2024

My plugin consists of modules. I can enable and disable them specifically.
When this DTR module gets enabled, it adds a FPS DtrEntry.
After I disable and enable it again, then it won't show up anymore.

private IDtrBarEntry? DtrFPS;

public void OnEnable()
{
    DtrFPS = DtrBar.Get("FPS");

    Framework.Update += OnFrameworkUpdate;
}

public void OnDisable()
{
    Framework.Update -= OnFrameworkUpdate;

    DtrFPS?.Remove();
    DtrFPS = null;
}

I think this is because when I call Remove, it sets ShouldBeRemoved to true at https://github.com/goatcorp/Dalamud/blob/a042ec9a/Dalamud/Game/Gui/Dtr/DtrBarEntry.cs#L184 and then gets removed by the DtrBar service at https://github.com/goatcorp/Dalamud/blob/a042ec9a/Dalamud/Game/Gui/Dtr/DtrBar.cs#L123-L130, but it doesn't get removed from the Dictionary in the plugin-scoped DtrBar service at https://github.com/goatcorp/Dalamud/blob/a042ec9a/Dalamud/Game/Gui/Dtr/DtrBar.cs#L504.

A possible solution could be to iterate over all plugin-scoped DtrBar services and calling (a new, internal) Remove to just remove it from the Dictionary, without calling Remove on the DtrBarEntry again.

@goaaats goaaats added bug Something isn't working core Dalamud core api 10 regression labels Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api 10 regression bug Something isn't working core Dalamud core
Projects
None yet
Development

No branches or pull requests

2 participants