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

GuiStateElement synced across multiple players #33

Open
LaserSlime opened this issue May 11, 2021 · 2 comments
Open

GuiStateElement synced across multiple players #33

LaserSlime opened this issue May 11, 2021 · 2 comments

Comments

@LaserSlime
Copy link
Contributor

If I open the same gui for multiple players at once and one of them clicks a GuiStateElement, the Element is changed for the other players too. If I understand this api correctly, the goal is to have one InventoryGui instance that you open for all players. If you need to change something dynamically, you use DynamicGuiElements. If I have to create a new InventoryGui for every player, then why is there a DynamicGuiElement?

@Phoenix616
Copy link
Owner

Well the library wasn't really designed with such usage in mind (one instance was meant to be self-contained and always provide the same information no matter who viewed it, a new instance was meant to be created per player) so providing different information to different players was an afterthought and that can be done now by using the DynamicGuiElement.

So it's already possible to do what you want: Use a DynamicGuiElement and return the appropriate GuiStateElement per player so I'm unsure if the GuiStateElement really would need to change/be expanded to support that natively as that would just add more overhead.

@LaserSlime
Copy link
Contributor Author

That sounds rather complicated. I think creating a new InventoryGui every time would be better.

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