Comments (2)
Some thoughts about this:
Currently one InventoryGui instance only really corresponds to one player having them open with the inventory being cached in a field of the object. This would probably need to be changed into a map for all players to properly handle the listeners (as they too use the cached inventory: to check if the player is actually in the GUI)
We would also need to pass the player to all methods for getting items and actions from all element types (which would end up in quite some clutter imo) or add a special case for such a per-player element. (Which I also don't think is a nice approach but already kinda used with the storage element)
A different approach could be to calculate an intermediate GUI setup for each player that opens the GUI which resolves the player elements but that too would require a special case for these elements to work...
Have to think about this a bit more, if you (or anyone else) have any thoughts on this feel free to provide them! :)
from inventorygui.
It is now (since 1.4) possible to provide a Function to DynamicGuiElement which has the viewer as the input. Also the getItem and getAction methods now take the viewer too if one wants to implement custom elements.
from inventorygui.
Related Issues (20)
- GuiStorageElement setStoreAction HOT 3
- Latest version caused bugs HOT 2
- Update Dynamic Element caused items to flickering HOT 3
- Version Compatiblity HOT 1
- Going back GUIs should redraw them to update state HOT 1
- Async ItemStack update HOT 1
- Option to show inventory with custom replacements HOT 4
- CalculatePageAmount HOT 8
- Allow item numbers to be less than 1 HOT 4
- License HOT 1
- GuiStateElement synced across multiple players HOT 2
- Change page error HOT 1
- Allow setting lore without setting display name
- Double clicking registers 3 clicks instead of 2 HOT 4
- error :( HOT 5
- getPageAmount doesn't return the correct amount of pages HOT 2
- Option to not allow the GUI to be closed HOT 3
- Left / right click check HOT 3
- Pagination elements : ItemStack amount
- Make Folia compatible and thread-safe
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from inventorygui.