expressobits / inventory-system

Modular inventory system for godot 4 with nodes, compatible with multiplayer, separate logic from the UI, Using items as separate resources.
MIT License
459 stars 31 forks source link

make UI usable without mouse (+gamepad support) #53

Closed Lodugh closed 1 year ago

Lodugh commented 1 year ago

All the changes happen inside the plugin as I think it is just as low level as mouse controls and would be very hard to just do them externally in the demo. One thing that comes with it, but could be moved to an optional global setting, is that the dragged items always snap to hovered slots. However I personally do not dislike that. In the demo there is just a few settings in the slot_ui.tscn(focus mode and signal connections): https://github.com/expressobits/inventory-system-demos/commit/356cc36d46adca39cfc295e67849b72c7ff52429 I can make a pull request there if this gets implemented here. I hope you are okay with the way I did it but I would still be open to a different approach.

scriptsengineer commented 1 year ago

I found it really interesting, but ended up running into some problems about this PR 1 - Your code I assume that all inventory must be a predefined grid and maybe this is your code's dilemma, we can have an inventory that is just a list opened by the user. Note: I intend at some point to implement a GridInventory that should be a simple extension of the current inventory including information from grid x y, precisely to remedy this issue #35

2 - I believe that UI should not be part of the core, but something to be implemented by the user, maybe this lib just contains the primordial part of UI.

3 - There would still be an elegant solution to be made without using PR, which would be to extend the class with its functionality.

That said, I will not include the PR at the moment, but I will open it up for you to send this addition to the demo repo (As an additional demo), so I can accept this feature precisely to add an option for the end user to understand even more about the inventory system .

From the maturation of the idea in the demo repository we can move something to the actual addon.

Lodugh commented 1 year ago

1 - Uh, well I surely don't know the whole code so I guess I missed that. A Gridinventory sounds like a good idea.

2 - With core do you mean the add-on itself? Because it also has an folder called "core" which I didnt touch.

3 - I sadly cant think of any way. But why should standard Godot UI controls be less of a part of the core than mouse controls? At least for me it seems like the same level. Then maybe even mouse controls should be somewhat more separate?

For it to be able to go into the demo repository it would have to be outside of the addon right? Should I make a version that extends the addons scripts with my changes?

scriptsengineer commented 1 year ago

3 - I sadly cant think of any way. But why should standard Godot UI controls be less of a part of the core than mouse controls? At least for me it seems like the same level. Then maybe even mouse controls should be somewhat more separate?

For it to be able to go into the demo repository it would have to be outside of the addon right? Should I make a version that extends the addons scripts with my changes?

The biggest problem is that I saw that UI is something of an example, we can have different types of inputs.

Different UIs tend to modify the way input will be done and we can still interact with inventories without UI (3D interactions dragging an item)

That said, to improve the understanding of those who want to contribute, I moved the UI scripts to the demo repository.

scriptsengineer commented 1 year ago

2 - With core do you mean the add-on itself? Because it also has an folder called "core" which I didnt touch.

Yes, I'm sorry wanted to say about addon.

Lodugh commented 1 year ago

That said, to improve the understanding of those who want to contribute, I moved the UI scripts to the demo repository.

That sounds good. Then does anything speak against making a pull request with these changes in the demo repository? I only changed the UI scripts and in the demo only Gridinventories are used at the moment so it should work without a problem.

scriptsengineer commented 1 year ago

That said, to improve the understanding of those who want to contribute, I moved the UI scripts to the demo repository.

That sounds good. Then does anything speak against making a pull request with these changes in the demo repository? I only changed the UI scripts and in the demo only Gridinventories are used at the moment so it should work without a problem.

Yes it can be sent to the demo, it even works as a good example of different inputs.

scriptsengineer commented 10 months ago

In 0.9.0 Version, added option to active this feature image option can be activated even with the game running.

scriptsengineer commented 10 months ago

In version 0.9.0 ui scripts and scenes moved to addon again, but simplified assets used.