Steps to reproduce:
- Display a list with items
Code: Select all
/c game.player.gui.center.add{type="list-box", name="list", items={"a", "b", "c"}}
- Print the selected item index
Code: Select all
/c game.print(game.player.gui.center["list"].selected_index)
Code: Select all
/c game.player.gui.center["list"].remove_item(3)
- Clear the list
Code: Select all
/c game.player.gui.center["list"].clear_items()
- Fill the list again
Code: Select all
/c game.player.gui.center["list"].add_item("d"); game.player.gui.center["list"].add_item("e"); game.player.gui.center["list"].add_item("f")
This also happen when you insert an item before the selected item : the highlighted item is not the one the selected index is pointing to.