Add something akin to an item_focused(index : int)
signal for individual items in an ItemList
node
#10025
Labels
item_focused(index : int)
signal for individual items in an ItemList
node
#10025
Describe the project you are working on
A 2D sim game with quest log and inventory systems
Describe the problem or limitation you are having in your project
Using
ItemList
for quest logs and inventories doesn't allow for as nice polish as I'd like. I want to add sound effects when an item is focused over (but not selected) via mouse or gamepad controls.Describe the feature / enhancement and how it helps to overcome the problem or limitation
ItemList
class would have it's own signal, which gets emitted when an item is "focused". "Focus" should work as you'd expect on both gamepad and mouse + keyboard.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
my_item_list.item_focused.connect(func(index : int) -> void: my_sound.play())
If this enhancement will not be used often, can it be worked around with a few lines of script?
To the best of my ability, no. The closest useful thing I could find that would help solve this issue is maybe doing crazy stuff with
my_item_list.get_item_at_position(my_pos)
inside a_process
call, and it would be troublesome getting it to work with both mouse and gamepad. You could instantiate newButton
under a verticalScrollContainer
, but then you lose out on the search functionality ofItemList
.Is there a reason why this should be core and not an add-on in the asset library?
This greatly improves the
ItemList
experience right out of the box. It is a nice node since it comes with searching.The text was updated successfully, but these errors were encountered: