Skip to content

Hiding OpenPlanet UI removed PVM overlay completely #1

@Dmliel

Description

@Dmliel

the PVM plugin disapears everytime you F3 to turn openplanet hud off, and pressing F3 again doesn't show it, so you have to go back into the menu and find the overview. Is there a way to have it stay open (like Better TOTD) does?

Proposed solution in Overview.as:

void Render()
{
    if (!Setting::overview_show) return;
    if (!initialized) Init();
    if (activeTab >= tabs.Length) activeTab = 0;
    if (tabs.Length == 0) return;

    vec2 size = vec2(800, 600);
    vec2 pos = (vec2(Display::GetWidth(), Display::GetHeight()) - size) / 2;
    UI::SetNextWindowSize(int(size.x), int(size.y));
    UI::SetNextWindowPos(int(pos.x), int(pos.y));

    bool open = true; // local flag, not tied to the setting
    if (UI::Begin("PVM Overview", open))
    {
        if (!open)
        {
            Setting::overview_show = false; // user explicitly clicked X
            UI::End();
            return;
        }
        // ... rest of your tab rendering
    }
    UI::End();
}

By using a local bool open = true instead of passing Setting::overview_show directly, the window won't close itself just because Openplanet hid the UI. The setting only flips to false when the user deliberately clicks the X button.
Also make sure overview_show is a persisted [Setting] so it actually survives between sessions:

[Setting name="overview_show" category="misc"]
bool overview_show = false;

If it's already declared that way elsewhere in your codebase, you're good, the key change is just the local bool open = true trick in Render().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions