PDA

View Full Version : Paging Items list



Minty23185Fresh
December 26th, 2021, 18:15
Hi Zacchaeus and Lord Entrails; <--- He really means Moon Wizard (moderator)

The new Master Index routines need some rework, I think.
Here are the steps to repeat the problem:


(1) I started a [U]new 5E Campaign, without any extensions
(2) I activated the 5E SRD Data module
(3) I opened the Items recordset and copied the Amulet, then renamed the copy to "Amulet, Mine". Note that it doesn't belong to any Group so it is "Uncategorized".
50576

[using indicated panels in screenshot 2]
(4) Using the recordset Page selector
(5) I navigated to page 3 of the Items recordset
(6) using the Group drop down, I selected the "Uncategorized" Group
(7) In panel 7 of Screenshot 2, note that the Page selector is incorrect. First, there is only one item in the Uncategorized so the Page selector should not be displayed. And second, the Page selector's displayed data is non sensical.
50577

(If I click First Page or Previous Page, the Page selector corrects itself and disappears, but it shouldn't be displayed in the first place.)

Moderator: Move to House of Healing

Zacchaeus
December 26th, 2021, 18:55
I can reproduce this.

Minty23185Fresh
December 27th, 2021, 00:11
Hi Zacchaeus and Lord Entrails; <--- He really means Moon Wizard (moderator)

True enough, but I must show our moderators, the first line of defense, proper respect. ;)

Moon Wizard
December 27th, 2021, 18:26
Thanks. I'll have a fix in the next weekly update.

Regards,
JPG

Minty23185Fresh
December 31st, 2021, 19:59
Thanks. I'll have a fix in the next weekly update.

Thank you Moon Wizard, the promised fix looks great.

I'm going to be a bit presumptuous and follow this up...

In the ruleset script, as of Dec 28th, 2021, there is a construct that appears to me to be something against what might be considered best practice.
A local variable in a for loop has the same name as a function parameter.

The function is in file CoreRPG\campaign\scripts\masterindex_window.lua

The function definition isFilteredRecord(v) is located at line 726.

The offending for loop is at line 741:
for _,v in ipairs(vValues) do

I know that there is nothing wrong with this, lua executes just fine with this peculiarity, but to my mind it's not a particularly great coding practice to follow. (Just my opinion. :o )