Not necessarily. My notes skin (heavily modified Enigma) procedurally generates the meters it needs within the Lua code. If I decide I want more tabs, I change the total and if the meters don't exist then Lua creates them. When my skin is "empty", there's only 2 meters. First run with 3 tabs and now the skin has 11 meters. I don't delete anything when I reduce the count though, the unused meters just sit there.SilverAzide wrote:The trick is to create your skin with all the meters you need in advance.
When using the !WriteKeyValue bang, if the key doesn't exist it's created. So you can create the key name with a counter and increment it within the code. This is one portion of my loop for one of the meters that's created from scratch (Note#.Label.Outside).
Code: Select all
local meter = _prefix..'Note'..i..'.Label.'
SKIN:Bang('!WriteKeyValue', meter..'Outside', 'Meter', 'Image')
SKIN:Bang('!WriteKeyValue', meter..'Outside', 'MeterStyle', 'Styles.LabelUnselectedOutside')
SKIN:Bang('!WriteKeyValue', meter..'Outside', 'X', '(['.._prefix..'Label:X]-(#*CurrentNote*#-'..i..'+1)*#*LabelShift*#-2+(['.._prefix..'Note'..i..'.State] = 2 ? (['.._prefix..'Label.Top:W]+11) : 0))')
SKIN:Bang('!WriteKeyValue', meter..'Outside', 'Y', '(['.._prefix..'Label.Top:Y]+6)')
SKIN:Bang('!WriteKeyValue', meter..'Outside', 'DynamicVariables', '1')
SKIN:GetMeter(meter..'Outside'):Show()