41
User Tools / Re: Percussion splitter
Last post by yukulele -tested with 0,1, 2 & 3 grouping parameter
, yukulele, could you please try this (beta) version? Thanks.I guess yukulele has version 2.8 beta 1 and Flurmy has version 2.751
Quite different! Why?
In the new beta, the |Text:*| property and User object properties are now stored as strings (replaces the nwcOptText object).
In the current general release, text properties use a nwcOptText class for storage. This is a heavy operation that requires an additional allocated table just to store the encoded string.
In this same release, user object properties are all stored as raw, encoded strings. This creates a complicated approach to handling the text properties.
In the new beta, all of these text properties are maintained as simple decoded strings. All simple strings are passed through an encoding filter before writing them back into a nwctxt file stream, which strives to make scripting changes to these properties much simpler.
It does create an issue for current tools.
As it currently stands, changes will be required in tool code when accessing these text properties. Perhaps the easiest way to handle this is by two utility functions:Code: [Select · Download]local function GetTextProp(item,lbl)
local t = item.Opts[lbl]
return (t and t.Text) and t.Text or t
endCode: [Select · Download]local function SetTextProp(item,lbl,txt)
item:Provide(lbl,'')
if item.Opts[lbl].Text then
item.Opts[lbl].Text = txt
else
item.Opts[lbl] = txt
end
end
) that a small change about this was made in the lua libraries in NWC 2.8 Beta 1 (the one I'm using).Quite different! Why?
But I don't know why the behaviour is different on my side.
{
["Name"] = perc.,
["Group"] = Standard,
} {
["Group"] = { ["Text"] = Standard, },
["LabelAbbr"] = "abbr",
["Label"] = { ["Text"] = label, },
["Name"] = { ["Text"] = perc, },
}local Name = Item.Opts.Name.Text or Item.Opts.Name
local PercStaffNumber = string.match(Name, PercStaffName.."(%d+)")