@Solar_Flare Ah, well, basically if you have a plugin that has nested structs :
Spoiler: Plugin Parameters - Nested Structs
Code:
* @param headerPluginOptions
* @text Plugin Options
* @type text
* @default ------------------------------------
*
* @param testStruct__array
* @text Struct Test
* @desc
* @parent headerPluginOptions
* @type struct<structLevelA>[]
*
* @param testNumber__number
* @text Test Number
* @desc
* @parent headerPluginOptions
* @type number
* @default 125
*
* @param testString__string
* @text Test String
* @desc
* @parent headerPluginOptions
* @type text
*
* @param testBool__boolean
* @text Test Boolean
* @desc
* @parent headerPluginOptions
* @type boolean
*
* @param headerPluginProperties
* @text Plugin Data
* @type text
* @default ------------------------------------
*
* @param gid
* @text Global Identifier
* @desc Global identification tag for internal use only. Do not change.
* @parent headerPluginProperties
* @default ossra-zO9wKkOE7HpTupE
*
*/
// +===================================================| Structs |
// | [Plugin] Structs
// +====================================================================================+
/*~struct~structLevelA:
* @param structTestA__array
* @text Struct Test A
* @desc
* @type struct<structLevelB>[]
*
* @param testNumber__number
* @text Test Number
* @desc
* @type number
* @default 125
*
* @param testString__string
* @text Test String
* @desc
* @type text
*
* @param testBool__boolean
* @text Test Boolean
* @desc
* @type boolean
*/
/*~struct~structLevelB:
* @param structTestB__array
* @text Struct Test B
* @desc
* @type struct<structLevelC>[]
*
* @param testNumber__number
* @text Test Number
* @desc
* @type number
* @default 125
*
* @param testString__string
* @text Test String
* @desc
* @type text
*
* @param testBool__boolean
* @text Test Boolean
* @desc
* @type boolean
*/
/*~struct~structLevelC:
* @param structTestC__array
* @text Struct Test C
* @desc
* @type struct<structLevelD>[]
*
* @param testNumber__number
* @text Test Number
* @desc
* @type number
* @default 125
*
* @param testString__string
* @text Test String
* @desc
* @type text
*
* @param testBool__boolean
* @text Test Boolean
* @desc
* @type boolean
*/
/*~struct~structLevelD:
* @param structTestD__array
* @text Struct Test D
* @desc
* @type struct<structLevelE>[]
*
* @param testNumber__number
* @text Test Number
* @desc
* @type number
* @default 125
*
* @param testString__string
* @text Test String
* @desc
* @type text
*
* @param testBool__boolean
* @text Test Boolean
* @desc
* @type boolean
*/
/*~struct~structLevelE:
* @param structTestE__array
* @text Struct Test E
* @desc
* @type struct<structLevelF>[]
*
* @param testNumber__number
* @text Test Number
* @desc
* @type number
* @default 125
*
* @param testString__string
* @text Test String
* @desc
* @type text
*
* @param testBool__boolean
* @text Test Boolean
* @desc
* @type boolean
*/
/*~struct~structLevelF:
* @param testNumber__number
* @text Test Number
* @desc
* @type number
* @default 125
*
* @param testString__string
* @text Test String
* @desc
* @type text
*
* @param testBool__boolean
* @text Test Boolean
* @desc
* @type boolean
*/
// +====================================================================================+
You have to perform a deep parse on all of the values. And since I am performing a deep parse on all of the values anyway, I may as well integrate the default values of each property at the same time. So, I created the function in the first post to do that. Parse all values, and if the value of a property is not present, place the default value there so I do not have to do so later on.
You can specify a default value of a struct in the plugin, of course. But once you start to nest structs, the value is rather lengthy and looks quite ugly. Plus, if the user somehow clears that default value, I want a fall-back value within the plugin itself.