Comments (6)
From what I understand you have an inventory, that has items put in it via your plugin. This inventory with items then gets shown to a player/players. This player/these players are then supposed to move those items into a different configuration. When you call Gui#update
you would like to have those items that may have been moved to retain their moved position? Is that correct?
The main purpose of Gui#update
is to update the Gui that is shown when a plugin makes a change to it. E.g. I show a gui to a player via my plugin, then I change something in this gui via my plugin and to then show the changes, I call Gui#update
so the player sees the changes the plugin has made. If my understanding of your situation is correct, I don't quite see how we could manage that situation. If we change it so the items don't get moved, then you lose some of the intent of the Gui#update
method, since now if your plugin wanted to move an item, you can't display that change to a player, since the framework wouldn't move items. If we keep it like it works now, then when moving an item via a plugin and updating it, the movement is properly displayed, however when a player has moved an item, that one would be moved back as well.
When only considering a StaticPane, the framework could theoretically sort of consider how the movement was done and then adjust to that. Was the movement done by a player: don't update it; was the movement done by a plugin: do update it. However, this gets complicated when taking into account different panes. For example, with an OutlinePane, when you move an item that was in the back of the list of items to the front, all the other items would move as well. What if one of those other items was moved by a player, should this one then move or not? What about items that are in multiple places at once (which can be achieved by adding the same item to a pane multiple times, or with an OutlinePane turning on repeat), which item was actually moved? What if you move two of the same item, but one via a plugin and one as a user? What if the movement of one item, causes a movement of the same item in a different position? What if one item overtook the position of the same item? And then I haven't even considered resizing panes; items overflowing off the inventory; movement caused by pane property updates; movement from the top inventory to the bottom and vice versa and probably a lot of other stuff.
I myself can't think of a way in which such behavior could be handled elegantly. If you or anyone else has an idea on how to do this, I'd love to hear it, but if that's not the case, I won't be implementing this. (If I understood your request wrong, please correct me by the way.)
from if.
Yes, I am using IF for GUIShop, and I am revamping the in-game configuration utility. Before, users were required to load the items into a chest and make edits there, however there is a ton of command execution involved so I decided to attempt to change it to use IF. Essentially when they open their shop in editor mode, They are able to remove items and set their prices, lores, etc or even just remove them entirely. This allows users to edit the shop quickly and effortlessly without having YML knowlege.
I have been spending all day trying to implement a way to get this to work, but I am unable to get the PaginatedPane to take on updates.
The Main problem I am having right now involves PaginatedPanes. Some shops can have multiple pages, so when users edit page 1, when they press the arrow to go to page 2, I need the changes the made in page 1 to stay, and not reset back to their initial declaration state. This has proven to be very difficult
from if.
It would be beneficial if I could somehow access each page's instance, so I can re-apply my setItem method and make updates there. In order to do that, I would need to be able to get each pane individually which would require a
getPane(PageNumber) method
Perhaps this could work?
from if.
A method like that could definitely be implemented, although it probably needs to be called getPanes
instead of getPane
, since there may be multiple panes on one page.
from if.
Thank you so much, that would be amazing.
from if.
Version 0.5.13 has his method added.
from if.
Related Issues (20)
- IllegalArgumentException: Coordinates must be in-bounds HOT 8
- GuiItem.copy do not respects previously manually provided plugin instance HOT 1
- IllegalArgumentException on Inventory creation when defining IF as library in plugin.yml instead of shading
- Support Folia
- Inventory GUIS don't sync the player inventory (1.19.4/1.20) HOT 1
- Crafting table Gui Not Getting Populated in (IF: 0.10.10 - 0.10.11) - (MC: 1.20 - 1.20.1) HOT 1
- MerchantGui not working on 1.20.1
- Hide pagination back on the first page and next on the last page HOT 1
- Calling Player#setItemOnCursor in Gui#setOnClose does not work HOT 1
- Raw index to coordinates HOT 3
- OutlinePane inside PaginatedPane doesn't register click event HOT 2
- Support Components from Adventure API HOT 1
- AnvilGui improvements HOT 4
- Profile name must not be null when trying to use Label Fonts HOT 4
- ToggleButtons dont work unless their coordinates are 0, 0 HOT 1
- Allow IF to be put in libraries block HOT 1
- Anvil GUI not working in MC 1.20.1 on v0.10.12 HOT 2
- AnvilGUI Not Working On 1.20.2 HOT 2
- Player leaving gui clears the gui for other player HOT 2
- 1.20.3/1.20.4 Support HOT 1
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 if.