-
March 10th, 2019, 20:18 #1
Minor Bug in CoreRPG - code not executing properly
Though this is in the CoreRPG, it propagates to the overlying rulesets; I found it while working with 5E.
When the DM (host instance) adds a new group (a.k.a. category) to a data recordset in one of the libraries there is code that tries to set focus to the new group in the list box. The attempt to set focus is failing.
The offending code is in the handleCategoryAdd() function in rulesets/CoreRPG/campaign/masterindex_window.lua, highlighted here in red:
Code:function handleCategoryAdd() local aMappings = LibraryData.getMappings(sInternalRecordType); local sNew = DB.addChildCategory(aMappings[1]); list_category.applySort(true); for _,w in ipairs(list_category.getWindows()) do if w.category.getValue() == sNew then w.category_label.setFocus(); break; end end end
Untitled.png
I find it interesting that the applySort() seems to work fine. But the for loop to find the newly created "Group 1" fails. I placed a Debug.console() in the for loop to look at the index value, the operand (w), and the value of sNew. For some reason the subwindow "Group 1" of the list is never iterated.Current Projects:
Always...
Community Contributions:
Extensions: Bardic Inspiration, Druid Wild Shapes, Local Dice Tower, Library Field Filters
Tutorial Blog Series: "A Neophyte Tackles (coding) the FG Extension".
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks