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

[feature]: Drag and Drop for inventories #68

Open
DSeeLP opened this issue May 27, 2021 · 3 comments
Open

[feature]: Drag and Drop for inventories #68

DSeeLP opened this issue May 27, 2021 · 3 comments
Labels
enhancement New feature or request inventory Something related to the inventory/widget system

Comments

@DSeeLP
Copy link
Contributor

DSeeLP commented May 27, 2021

Is your feature request related to a problem? Please describe
With the current implementation its hard to build things that use drag and drop like a filebrowser. Because you have to manually save the last clicked itemstack.

Describe the solution you'd like
Add a method to get the last itemstack that was on the cursor.

@PXAV PXAV added enhancement New feature or request inventory Something related to the inventory/widget system labels May 27, 2021
@PXAV
Copy link
Member

PXAV commented May 27, 2021

Could you please provide some more detail? What would a proper drag-and-drop implementation look like for you?

@DSeeLP
Copy link
Contributor Author

DSeeLP commented May 28, 2021

In the KelpClickEvent you can provide a DragAndDrop object which contains an action (drag or drop), the KelpItem which can be null and if dropped the target KelpItem which is simply the item clicked. This should be included so you only need to pass the DragAndDrop object to a method

@DSeeLP
Copy link
Contributor Author

DSeeLP commented May 28, 2021

The only downside of something like this is you need to cache on every InventoryClickEvent the content of the cursor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request inventory Something related to the inventory/widget system
Projects
None yet
Development

No branches or pull requests

2 participants