Godot Version
4.2
Question
How do i get the item position in the list ?
currently the only option avaible in the signal
var itemLlist1;
itemLlist1.multi_selected.connect(self.itemLlist1_selected);
func itemLlist1_selected(index, selected):
print( str(index) + str(" ") + str(selected) );
itemListNum = index;
itemselected = selected;
func btn_Up_pressed():
#print( itemLlist1.get_selected_items ( ) )
#var itemsON = itemLlist1.get_selected_items();
var itemListSize = itemLlist1.get_item_count();
var itemListSelectedItems = itemLlist1.get_selected_items();
print(itemListSize)
print(itemListSelectedItems)
#itemLlist1.move_item(itemListNum, itemListNum-1);
itemLlist1.move_item(0, 1);
for n in itemListSelectedItems:
#itemLlist1.move_item(2, 4);
pass;
pass;
But his function only gets new values when clicked on it with mouse button ?
In other words i can only fetch item index and item selected after the mouse button has bee pressed.
this makes the item move up then down becauser iutem 0 is noew item 1
how can someone make somethging like this ?
itemLlist1.item(index) = itemLlist1.item(index)-1 ?