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

How to "Destroy" Window? #13

Open
TsiamDev opened this issue Mar 14, 2024 · 1 comment
Open

How to "Destroy" Window? #13

TsiamDev opened this issue Mar 14, 2024 · 1 comment

Comments

@TsiamDev
Copy link

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.

@MrBounty
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants