Skip to content

How to "Destroy" Window? #13

Open
Open

Description

@TsiamDev

I simply did:

local lastVisibleUI = UI.isUIVisible
UI:close()
UI = nil
UI = MyCreateNewUI() -- A user defined function that creates a new UI window
UI.isUIVisible = lastVisibleUI

But I am not sure whether this approach creates memory leaks.

It certainly creates some overhead since it creates/destroys the window repeatedly, but it is just one window so it is not noticeable I guess.

Please let me know if there is a better way of doing this.

Activity

  1. MrBounty commented on Sep 23, 2024

    @MrBounty
    Owner

    I'm not sure for this, it's been a while since I played with PZ code.

    I think you will need to check the UI manager of PZ, there is a function to destroy an UI but I don't remember it. This mod is not really to create and delete a lot of UI. Just to get some simple stuff for small mods or rapid testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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