I have recently been tinkering around with expanding the vanilla cheat menu, and I seem to be having a very weird behavior. I'll try to explain what I am trying to do:
Basically, I am trying to create a list that displays all the resrefs and names of all the creatures in the game. So far it's been easy enough; I've written a very simple WeiDU script that populates a M_ lua file with all the relevant information... but for some odd reason I'm hitting a wall with the actual list implementation. It seems that the in-game list is displaying the elements of the table out of order, even when the table is already sorted in the M_ lua file. I'm probably doing something stupid here, but I've been staring at this for an hour or two now, and just can't find the (what should be very simple) error.
I've attached my override folder so you guys can look at the code, (the files are for BG2EE). The problematic list starts at line 237 of UI.MENU. You can view the list in-game by hitting ctrl+space, and pressing the "Browse Creatures" button in the cheat menu. I expect the resrefs to be displayed alphabetically, as that is the order they are presented in the M_ChtMen.lua file, but alas they seem to be in a completely random order. I've rigged the clicking of a row to output the resref of the row in the feedback area, and for some odd reason THIS provides the correct feedback, while the list itself is wrong.
Any help would be greatly appreciated!