@@ -3,8 +3,7 @@ function getDefaultExportFromCjs(x) {
3
3
return x && x . __esModule && Object . prototype . hasOwnProperty . call ( x , "default" ) ? x [ "default" ] : x ;
4
4
}
5
5
function getAugmentedNamespace ( n ) {
6
- if ( n . __esModule )
7
- return n ;
6
+ if ( n . __esModule ) return n ;
8
7
var f = n . default ;
9
8
if ( typeof f == "function" ) {
10
9
var a = function a2 ( ) {
@@ -14,8 +13,7 @@ function getAugmentedNamespace(n) {
14
13
return f . apply ( this , arguments ) ;
15
14
} ;
16
15
a . prototype = f . prototype ;
17
- } else
18
- a = { } ;
16
+ } else a = { } ;
19
17
Object . defineProperty ( a , "__esModule" , { value : true } ) ;
20
18
Object . keys ( n ) . forEach ( function ( k ) {
21
19
var d = Object . getOwnPropertyDescriptor ( n , k ) ;
@@ -183,14 +181,10 @@ const require$$1 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1
183
181
case "IMPORT_MESSAGE_TO_EVENT" :
184
182
case "メッセージをイベントにインポート" :
185
183
addMessage ( "import message to event. \n/ メッセージをイベントにインポートします。" ) ;
186
- if ( args [ 0 ] )
187
- Laurus . Text2Frame . FileFolder = args [ 0 ] ;
188
- if ( args [ 1 ] )
189
- Laurus . Text2Frame . FileName = args [ 1 ] ;
190
- if ( args [ 2 ] )
191
- Laurus . Text2Frame . MapID = args [ 2 ] ;
192
- if ( args [ 3 ] )
193
- Laurus . Text2Frame . EventID = args [ 3 ] ;
184
+ if ( args [ 0 ] ) Laurus . Text2Frame . FileFolder = args [ 0 ] ;
185
+ if ( args [ 1 ] ) Laurus . Text2Frame . FileName = args [ 1 ] ;
186
+ if ( args [ 2 ] ) Laurus . Text2Frame . MapID = args [ 2 ] ;
187
+ if ( args [ 3 ] ) Laurus . Text2Frame . EventID = args [ 3 ] ;
194
188
if ( args [ 4 ] && ( args [ 4 ] . toLowerCase ( ) === "true" || args [ 4 ] . toLowerCase ( ) === "false" ) ) {
195
189
Laurus . Text2Frame . IsOverwrite = args [ 4 ] . toLowerCase ( ) === "true" ;
196
190
addWarning ( "【警告】5番目の引数に上書き判定を設定することは非推奨に" ) ;
@@ -199,8 +193,7 @@ const require$$1 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1
199
193
} else if ( args [ 4 ] ) {
200
194
Laurus . Text2Frame . PageID = args [ 4 ] ;
201
195
}
202
- if ( args [ 5 ] && args [ 5 ] . toLowerCase ( ) === "true" )
203
- Laurus . Text2Frame . IsOverwrite = true ;
196
+ if ( args [ 5 ] && args [ 5 ] . toLowerCase ( ) === "true" ) Laurus . Text2Frame . IsOverwrite = true ;
204
197
if ( args [ 0 ] || args [ 1 ] ) {
205
198
const { PATH_SEP , BASE_PATH } = getDirParams ( ) ;
206
199
Laurus . Text2Frame . TextPath = `${ BASE_PATH } ${ PATH_SEP } ${ Laurus . Text2Frame . FileFolder } ${ PATH_SEP } ${ Laurus . Text2Frame . FileName } ` ;
@@ -362,6 +355,60 @@ const require$$1 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1
362
355
plugin_command . parameters [ 0 ] = text ;
363
356
return plugin_command ;
364
357
} ;
358
+ const replacer = function ( key , value ) {
359
+ if ( typeof value === "object" && value !== null ) {
360
+ return value ;
361
+ }
362
+ return String ( value ) ;
363
+ } ;
364
+ const parseMzArg = function ( args_string ) {
365
+ const args2 = [ ] ;
366
+ let buffer = "" ;
367
+ let braceLevel = 0 ;
368
+ for ( const char of args_string ) {
369
+ if ( char === "," && braceLevel === 0 ) {
370
+ args2 . push ( buffer . trim ( ) ) ;
371
+ buffer = "" ;
372
+ } else {
373
+ buffer += char ;
374
+ if ( char === "[" || char === "{" ) {
375
+ braceLevel ++ ;
376
+ } else if ( char === "]" || char === "}" ) {
377
+ braceLevel -- ;
378
+ }
379
+ }
380
+ }
381
+ if ( buffer ) {
382
+ args2 . push ( buffer . trim ( ) ) ;
383
+ }
384
+ return args2 ;
385
+ } ;
386
+ const parseNestedJSON = function ( jsonString ) {
387
+ let jsonObject ;
388
+ try {
389
+ jsonObject = JSON . parse ( jsonString ) ;
390
+ } catch ( error ) {
391
+ return jsonString ;
392
+ }
393
+ for ( const key in jsonObject ) {
394
+ if ( typeof jsonObject [ key ] === "string" ) {
395
+ try {
396
+ jsonObject [ key ] = parseNestedJSON ( jsonObject [ key ] ) ;
397
+ } catch ( error ) {
398
+ continue ;
399
+ }
400
+ }
401
+ }
402
+ return jsonObject ;
403
+ } ;
404
+ const stringifyNestedJSON = function ( jsonObject ) {
405
+ for ( const key in jsonObject ) {
406
+ if ( typeof jsonObject [ key ] === "object" && jsonObject [ key ] !== null ) {
407
+ jsonObject [ key ] = stringifyNestedJSON ( jsonObject [ key ] ) ;
408
+ }
409
+ }
410
+ return JSON . stringify ( jsonObject , replacer ) ;
411
+ } ;
365
412
const getPluginCommandEventMZ = function ( plugin_name , plugin_command , disp_plugin_command , args2 ) {
366
413
const plugin_args = { } ;
367
414
const plugin_command_mz = {
@@ -380,7 +427,13 @@ const require$$1 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1
380
427
if ( matched ) {
381
428
const arg_name = matched [ 1 ] || "" ;
382
429
const values = matched [ 2 ] . slice ( 1 , - 1 ) . split ( "][" ) || [ ] ;
383
- plugin_args [ arg_name ] = values [ 0 ] || "" ;
430
+ if ( [ "struct_arg" , "bool_array_arg" , "number_array_arg" ] . includes ( arg_name ) ) {
431
+ const json_obj = parseNestedJSON ( values [ 0 ] ) ;
432
+ plugin_args [ arg_name ] = stringifyNestedJSON ( json_obj ) ;
433
+ } else {
434
+ plugin_args [ arg_name ] = values [ 0 ] || "" ;
435
+ plugin_args [ arg_name ] = plugin_args [ arg_name ] . replace ( / \\ n / g, "\n" ) . replace ( / \\ t / g, " " ) . replace ( / \\ \\ / g, "\\" ) ;
436
+ }
384
437
}
385
438
}
386
439
return plugin_command_mz ;
@@ -391,7 +444,13 @@ const require$$1 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1
391
444
if ( matched ) {
392
445
let arg_name = matched [ 1 ] || "" ;
393
446
const values = matched [ 2 ] . slice ( 1 , - 1 ) . split ( "][" ) || [ ] ;
394
- const value = values [ 0 ] || "" ;
447
+ let value = values [ 0 ] || "" ;
448
+ if ( [ "struct_arg" , "bool_array_arg" , "number_array_arg" ] . includes ( arg_name ) ) {
449
+ const json_obj = parseNestedJSON ( values [ 0 ] ) ;
450
+ value = stringifyNestedJSON ( json_obj ) ;
451
+ } else {
452
+ value = value . replace ( / \\ n / g, " " ) . replace ( / \\ t / g, " " ) . replace ( / \\ \\ / g, " " ) ;
453
+ }
395
454
if ( values [ 1 ] ) {
396
455
arg_name = values [ 1 ] ;
397
456
}
@@ -1452,15 +1511,13 @@ const require$$1 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1
1452
1511
const getIfWeaponParameters = function ( weaponId , params ) {
1453
1512
weaponId = Math . max ( Number ( weaponId ) || 1 , 1 ) ;
1454
1513
let include_equipment = false ;
1455
- if ( params [ 0 ] )
1456
- include_equipment = true ;
1514
+ if ( params [ 0 ] ) include_equipment = true ;
1457
1515
return [ 9 , weaponId , include_equipment ] ;
1458
1516
} ;
1459
1517
const getIfArmorParameters = function ( armorId , params ) {
1460
1518
armorId = Math . max ( Number ( armorId ) || 1 , 1 ) ;
1461
1519
let include_equipment = false ;
1462
- if ( params [ 0 ] )
1463
- include_equipment = true ;
1520
+ if ( params [ 0 ] ) include_equipment = true ;
1464
1521
return [ 10 , armorId , include_equipment ] ;
1465
1522
} ;
1466
1523
const getIfButtonParameters = function ( params ) {
@@ -2106,22 +2163,16 @@ const require$$1 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1
2106
2163
const LOOP_CODE = 112 ;
2107
2164
const stack = events . reduce ( ( s , e ) => {
2108
2165
const code = e . code ;
2109
- if ( code === IF_CODE )
2110
- s . push ( IF_CODE ) ;
2111
- else if ( code === ELSE_CODE )
2112
- s . push ( ELSE_CODE ) ;
2113
- else if ( code === BOTTOM_CODE )
2114
- s . pop ( ) ;
2166
+ if ( code === IF_CODE ) s . push ( IF_CODE ) ;
2167
+ else if ( code === ELSE_CODE ) s . push ( ELSE_CODE ) ;
2168
+ else if ( code === BOTTOM_CODE ) s . pop ( ) ;
2115
2169
return s ;
2116
2170
} , [ ] ) ;
2117
2171
const bottom = stack . reduce ( ( b , code ) => {
2118
2172
b . push ( getCommandBottomEvent ( ) ) ;
2119
- if ( code === IF_CODE )
2120
- b . push ( getEnd ( ) ) ;
2121
- else if ( code === ELSE_CODE )
2122
- b . push ( getEnd ( ) ) ;
2123
- else if ( code === LOOP_CODE )
2124
- b . push ( getRepeatAbove ( ) ) ;
2173
+ if ( code === IF_CODE ) b . push ( getEnd ( ) ) ;
2174
+ else if ( code === ELSE_CODE ) b . push ( getEnd ( ) ) ;
2175
+ else if ( code === LOOP_CODE ) b . push ( getRepeatAbove ( ) ) ;
2125
2176
return b ;
2126
2177
} , [ ] ) ;
2127
2178
return events . concat ( bottom ) ;
@@ -2305,7 +2356,7 @@ const require$$1 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1
2305
2356
return [ getPluginCommandEvent ( plugin_command [ 1 ] ) ] ;
2306
2357
}
2307
2358
if ( plugin_command_mz ) {
2308
- const params = plugin_command_mz [ 1 ] . split ( "," ) . map ( ( s ) => s . trim ( ) ) ;
2359
+ const params = parseMzArg ( plugin_command_mz [ 1 ] ) ;
2309
2360
const event_command_list3 = [ ] ;
2310
2361
if ( params . length > 2 ) {
2311
2362
const arg_plugin_name = params [ 0 ] ;
@@ -3639,8 +3690,7 @@ const require$$1 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1
3639
3690
const params = transfer_player [ 1 ] . split ( "," ) . map ( ( s ) => s . trim ( ) . toLowerCase ( ) ) ;
3640
3691
const regex = / ( .* ?) \[ ( \d + ) ] \[ ( \d + ) ] \[ ( \d + ) ] / ;
3641
3692
const matches = params [ 0 ] . match ( regex ) ;
3642
- if ( ! matches )
3643
- throw new Error ( "Syntax error. / 文法エラーです。:" + params [ 0 ] ) ;
3693
+ if ( ! matches ) throw new Error ( "Syntax error. / 文法エラーです。:" + params [ 0 ] ) ;
3644
3694
const location = getLocationValue ( matches [ 1 ] ) ;
3645
3695
const mapId = parseInt ( matches [ 2 ] ) ;
3646
3696
const mapX = parseInt ( matches [ 3 ] ) ;
@@ -3654,8 +3704,7 @@ const require$$1 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1
3654
3704
const vehicle = getVehicleValue ( params [ 0 ] ) ;
3655
3705
const regex = / ( .* ?) \[ ( \d + ) ] \[ ( \d + ) ] \[ ( \d + ) ] / ;
3656
3706
const matches = params [ 1 ] . match ( regex ) ;
3657
- if ( ! matches )
3658
- throw new Error ( "Syntax error. / 文法エラーです。:" + params [ 1 ] ) ;
3707
+ if ( ! matches ) throw new Error ( "Syntax error. / 文法エラーです。:" + params [ 1 ] ) ;
3659
3708
const location = getLocationValue ( matches [ 1 ] ) ;
3660
3709
const mapId = parseInt ( matches [ 2 ] ) ;
3661
3710
const mapX = parseInt ( matches [ 3 ] ) ;
@@ -3667,8 +3716,7 @@ const require$$1 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1
3667
3716
const event = getCharacterValue ( params [ 0 ] ) ;
3668
3717
const regex = / ( .* ?) \[ ( .* ?) ] ( \[ ( \d + ) ] ) ? ( \[ ( \d + ) ] ) ? / ;
3669
3718
const matches = params [ 1 ] . match ( regex ) ;
3670
- if ( ! matches )
3671
- throw new Error ( "Syntax error. / 文法エラーです。:" + params [ 1 ] ) ;
3719
+ if ( ! matches ) throw new Error ( "Syntax error. / 文法エラーです。:" + params [ 1 ] ) ;
3672
3720
const location = getLocationValue ( matches [ 1 ] ) ;
3673
3721
let mapX = 0 ;
3674
3722
let mapY = 0 ;
@@ -4117,8 +4165,7 @@ const require$$1 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1
4117
4165
const infoType = getLocationInfoTypeValue ( params [ 1 ] ) ;
4118
4166
const regex = / ^ ( .* ?) \[ ( .* ?) ] ( \[ ( \d + ) ] ) ? / ;
4119
4167
const matches = params [ 2 ] . match ( regex ) ;
4120
- if ( ! matches )
4121
- throw new Error ( "Syntax error. / 文法エラーです。:" + params [ 2 ] ) ;
4168
+ if ( ! matches ) throw new Error ( "Syntax error. / 文法エラーです。:" + params [ 2 ] ) ;
4122
4169
const { locationType, locationX, locationY } = getLocationEvent ( matches [ 1 ] , matches [ 2 ] , matches [ 4 ] ) ;
4123
4170
return [ getGetLocationInfo ( variableId , infoType , locationType , locationX , locationY ) ] ;
4124
4171
}
0 commit comments