@@ -270,6 +270,7 @@ MatchComboIndex(text, data_array)
270
270
271
271
RippleDescriptorJsonParser(filename)
272
272
{
273
+ EMPTY_DESC := " RF@CTOR2" ; placeholer for replacing empty string
273
274
temp_dict := Map()
274
275
level := 0
275
276
sub_key1 := ""
@@ -281,8 +282,12 @@ RippleDescriptorJsonParser(filename)
281
282
; Read raindrop_desc.json file
282
283
Loop read , filename
283
284
{
285
+ raw_line := RegExReplace (
286
+ StrReplace (A_LoopReadLine , " `" `"" , " `"" EMPTY_DESC " `"" ),
287
+ " `" * `" $" , " `"" EMPTY_DESC " `""
288
+ )
284
289
; Delimiter by quotation mark, line break
285
- Loop Parse , A_LoopReadLine , " `r`n`""
290
+ Loop Parse , raw_line , " `r`n`""
286
291
{
287
292
; Remove leading & trailing space/tab/comma/colon
288
293
value_strip := Trim (A_LoopField , A_Tab A_Space " :," )
@@ -319,17 +324,18 @@ RippleDescriptorJsonParser(filename)
319
324
if (check_next_value)
320
325
{
321
326
check_next_value := false
327
+ temp_value := StrReplace (value_strip, EMPTY_DESC, "" )
322
328
if (level = 1 )
323
329
{
324
- temp_dict[sub_key1] := value_strip
330
+ temp_dict[sub_key1] := temp_value
325
331
}
326
332
else if (level = 2 )
327
333
{
328
- temp_dict[sub_key1][sub_key2] := value_strip
334
+ temp_dict[sub_key1][sub_key2] := temp_value
329
335
}
330
336
else if (level = 3 )
331
337
{
332
- temp_dict[sub_key1][sub_key2][sub_key3] := value_strip
338
+ temp_dict[sub_key1][sub_key2][sub_key3] := temp_value
333
339
}
334
340
continue
335
341
}
@@ -353,7 +359,15 @@ RippleDescriptorJsonParser(filename)
353
359
; --------------
354
360
if (level = 1 )
355
361
{
356
- sub_key1 := value_strip
362
+ ; Add 3 leading zero to "Set_*" number for retain sets order
363
+ if RegExMatch (value_strip, " Set_" )
364
+ {
365
+ sub_key1 := Format (" Set_{:03d}" , StrReplace (value_strip, " Set_" , "" ))
366
+ }
367
+ else
368
+ {
369
+ sub_key1 := value_strip
370
+ }
357
371
check_next_value := true
358
372
continue
359
373
}
0 commit comments