PDA

View Full Version : Sorting powers



peterb
October 3rd, 2024, 14:39
I'm trying to implement sorting for powers. I've implemented a onInit function in record_char_powers.xml, windowlist powers, like so:



function onInit()
if super and super.onInit then
super.onInit()
end
applySort();
return true;
end


and I also added a "applySort" function call to onDrop, but nothing happens, so either I must do something more or do it in another way. Any pointers would be appreciated.

superteddy57
October 3rd, 2024, 14:46
The windowlist itself will need either a <sortby> tag or a onSortCompare(w1, w2) function within the windowlist control itself. applySort() just forces it to run through either option I provided earlier.

peterb
October 3rd, 2024, 17:26
Thanks, that did solve the issue. I now got powers sorted by their names.