@jx3box/jx3box-editor 1.4.7 → 1.4.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/data/game_font.json +522 -0
- package/package.json +3 -3
- package/service/resource.js +20 -0
- package/src/BoxResource.vue +3 -3
- package/src/GameText.vue +183 -0
- package/src/Item.vue +23 -5
- package/src/Tinymce.vue +1 -1
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
{
|
|
2
|
+
"remarks": [
|
|
3
|
+
"这个文件用于存储游戏内的字体ini",
|
|
4
|
+
"但是由于大部分场景下我们只需要字体的颜色",
|
|
5
|
+
"而且存在着很多个字体id对应同一种颜色的情况",
|
|
6
|
+
"所以用颜色作为键,值是一个数组,包含着颜色是键值的所有字体ID"
|
|
7
|
+
],
|
|
8
|
+
"#ffffff": [
|
|
9
|
+
"0",
|
|
10
|
+
"2",
|
|
11
|
+
"3",
|
|
12
|
+
"5",
|
|
13
|
+
"7",
|
|
14
|
+
"9",
|
|
15
|
+
"10",
|
|
16
|
+
"13",
|
|
17
|
+
"15",
|
|
18
|
+
"18",
|
|
19
|
+
"22",
|
|
20
|
+
"26",
|
|
21
|
+
"28",
|
|
22
|
+
"37",
|
|
23
|
+
"40",
|
|
24
|
+
"41",
|
|
25
|
+
"42",
|
|
26
|
+
"44",
|
|
27
|
+
"106",
|
|
28
|
+
"135",
|
|
29
|
+
"162",
|
|
30
|
+
"175",
|
|
31
|
+
"190",
|
|
32
|
+
"197",
|
|
33
|
+
"203",
|
|
34
|
+
"207",
|
|
35
|
+
"210",
|
|
36
|
+
"211",
|
|
37
|
+
"212",
|
|
38
|
+
"213",
|
|
39
|
+
"214",
|
|
40
|
+
"216",
|
|
41
|
+
"227",
|
|
42
|
+
"228",
|
|
43
|
+
"230",
|
|
44
|
+
"231",
|
|
45
|
+
"232",
|
|
46
|
+
"233",
|
|
47
|
+
"234",
|
|
48
|
+
"238",
|
|
49
|
+
"244",
|
|
50
|
+
"245",
|
|
51
|
+
"247",
|
|
52
|
+
"248",
|
|
53
|
+
"250",
|
|
54
|
+
"254",
|
|
55
|
+
"257",
|
|
56
|
+
"259",
|
|
57
|
+
"263",
|
|
58
|
+
"264",
|
|
59
|
+
"272",
|
|
60
|
+
"273",
|
|
61
|
+
"276",
|
|
62
|
+
"292",
|
|
63
|
+
"300",
|
|
64
|
+
"301",
|
|
65
|
+
"303",
|
|
66
|
+
"304",
|
|
67
|
+
"310",
|
|
68
|
+
"324",
|
|
69
|
+
"327",
|
|
70
|
+
"329",
|
|
71
|
+
"331",
|
|
72
|
+
"332",
|
|
73
|
+
"336",
|
|
74
|
+
"339",
|
|
75
|
+
"343",
|
|
76
|
+
"344",
|
|
77
|
+
"362",
|
|
78
|
+
"371"
|
|
79
|
+
],
|
|
80
|
+
"#000000": [
|
|
81
|
+
"1",
|
|
82
|
+
"6",
|
|
83
|
+
"29",
|
|
84
|
+
"38",
|
|
85
|
+
"43",
|
|
86
|
+
"156",
|
|
87
|
+
"160",
|
|
88
|
+
"180",
|
|
89
|
+
"191",
|
|
90
|
+
"225",
|
|
91
|
+
"260",
|
|
92
|
+
"269",
|
|
93
|
+
"288",
|
|
94
|
+
"326"
|
|
95
|
+
],
|
|
96
|
+
"#282828": [
|
|
97
|
+
"4",
|
|
98
|
+
"296",
|
|
99
|
+
"312"
|
|
100
|
+
],
|
|
101
|
+
"#ffff00": [
|
|
102
|
+
"8",
|
|
103
|
+
"11",
|
|
104
|
+
"14",
|
|
105
|
+
"16",
|
|
106
|
+
"23",
|
|
107
|
+
"27",
|
|
108
|
+
"31",
|
|
109
|
+
"48",
|
|
110
|
+
"59",
|
|
111
|
+
"65",
|
|
112
|
+
"99",
|
|
113
|
+
"100",
|
|
114
|
+
"136",
|
|
115
|
+
"163",
|
|
116
|
+
"187",
|
|
117
|
+
"188",
|
|
118
|
+
"200",
|
|
119
|
+
"201",
|
|
120
|
+
"204",
|
|
121
|
+
"236",
|
|
122
|
+
"241",
|
|
123
|
+
"258",
|
|
124
|
+
"289",
|
|
125
|
+
"306",
|
|
126
|
+
"315",
|
|
127
|
+
"328",
|
|
128
|
+
"330",
|
|
129
|
+
"334",
|
|
130
|
+
"372"
|
|
131
|
+
],
|
|
132
|
+
"#ff7e7e": [
|
|
133
|
+
"12",
|
|
134
|
+
"17",
|
|
135
|
+
"51",
|
|
136
|
+
"52",
|
|
137
|
+
"53",
|
|
138
|
+
"54",
|
|
139
|
+
"55",
|
|
140
|
+
"56",
|
|
141
|
+
"57",
|
|
142
|
+
"58",
|
|
143
|
+
"70",
|
|
144
|
+
"85",
|
|
145
|
+
"86",
|
|
146
|
+
"87",
|
|
147
|
+
"88",
|
|
148
|
+
"89",
|
|
149
|
+
"90",
|
|
150
|
+
"91",
|
|
151
|
+
"92",
|
|
152
|
+
"93",
|
|
153
|
+
"94",
|
|
154
|
+
"95",
|
|
155
|
+
"96",
|
|
156
|
+
"97",
|
|
157
|
+
"98",
|
|
158
|
+
"111",
|
|
159
|
+
"114",
|
|
160
|
+
"115",
|
|
161
|
+
"116",
|
|
162
|
+
"117",
|
|
163
|
+
"118",
|
|
164
|
+
"119",
|
|
165
|
+
"120",
|
|
166
|
+
"121",
|
|
167
|
+
"122",
|
|
168
|
+
"123",
|
|
169
|
+
"124",
|
|
170
|
+
"125",
|
|
171
|
+
"126",
|
|
172
|
+
"127",
|
|
173
|
+
"128",
|
|
174
|
+
"129",
|
|
175
|
+
"130",
|
|
176
|
+
"140",
|
|
177
|
+
"141",
|
|
178
|
+
"142",
|
|
179
|
+
"143",
|
|
180
|
+
"144",
|
|
181
|
+
"145",
|
|
182
|
+
"146",
|
|
183
|
+
"147",
|
|
184
|
+
"148",
|
|
185
|
+
"149",
|
|
186
|
+
"150",
|
|
187
|
+
"151",
|
|
188
|
+
"152",
|
|
189
|
+
"153",
|
|
190
|
+
"154",
|
|
191
|
+
"178",
|
|
192
|
+
"179",
|
|
193
|
+
"279",
|
|
194
|
+
"320",
|
|
195
|
+
"370"
|
|
196
|
+
],
|
|
197
|
+
"#a3b06a": [
|
|
198
|
+
"19",
|
|
199
|
+
"39",
|
|
200
|
+
"66"
|
|
201
|
+
],
|
|
202
|
+
"#ff0000": [
|
|
203
|
+
"20",
|
|
204
|
+
"33",
|
|
205
|
+
"71",
|
|
206
|
+
"102",
|
|
207
|
+
"137",
|
|
208
|
+
"159",
|
|
209
|
+
"166",
|
|
210
|
+
"217",
|
|
211
|
+
"219",
|
|
212
|
+
"270",
|
|
213
|
+
"308",
|
|
214
|
+
"317"
|
|
215
|
+
],
|
|
216
|
+
"#00c848": [
|
|
217
|
+
"21",
|
|
218
|
+
"36",
|
|
219
|
+
"80",
|
|
220
|
+
"105",
|
|
221
|
+
"165",
|
|
222
|
+
"167",
|
|
223
|
+
"222",
|
|
224
|
+
"226",
|
|
225
|
+
"287",
|
|
226
|
+
"316",
|
|
227
|
+
"365",
|
|
228
|
+
"369"
|
|
229
|
+
],
|
|
230
|
+
"#ff9600": [
|
|
231
|
+
"24",
|
|
232
|
+
"32",
|
|
233
|
+
"68",
|
|
234
|
+
"101",
|
|
235
|
+
"164",
|
|
236
|
+
"168",
|
|
237
|
+
"237",
|
|
238
|
+
"256",
|
|
239
|
+
"318",
|
|
240
|
+
"335",
|
|
241
|
+
"366"
|
|
242
|
+
],
|
|
243
|
+
"#adadad": [
|
|
244
|
+
"25",
|
|
245
|
+
"30",
|
|
246
|
+
"61",
|
|
247
|
+
"108",
|
|
248
|
+
"132",
|
|
249
|
+
"161",
|
|
250
|
+
"169",
|
|
251
|
+
"220",
|
|
252
|
+
"319",
|
|
253
|
+
"333"
|
|
254
|
+
],
|
|
255
|
+
"#df12c9": [
|
|
256
|
+
"34",
|
|
257
|
+
"74",
|
|
258
|
+
"103",
|
|
259
|
+
"367"
|
|
260
|
+
],
|
|
261
|
+
"#007eff": [
|
|
262
|
+
"35",
|
|
263
|
+
"77",
|
|
264
|
+
"104",
|
|
265
|
+
"285",
|
|
266
|
+
"323",
|
|
267
|
+
"368"
|
|
268
|
+
],
|
|
269
|
+
"#cfcfcf": [
|
|
270
|
+
"45",
|
|
271
|
+
"60",
|
|
272
|
+
"107",
|
|
273
|
+
"131",
|
|
274
|
+
"189",
|
|
275
|
+
"215",
|
|
276
|
+
"221",
|
|
277
|
+
"223",
|
|
278
|
+
"261",
|
|
279
|
+
"283",
|
|
280
|
+
"374"
|
|
281
|
+
],
|
|
282
|
+
"#969696": [
|
|
283
|
+
"46",
|
|
284
|
+
"62",
|
|
285
|
+
"109",
|
|
286
|
+
"133",
|
|
287
|
+
"218"
|
|
288
|
+
],
|
|
289
|
+
"#04d1b6": [
|
|
290
|
+
"47"
|
|
291
|
+
],
|
|
292
|
+
"#fff78e": [
|
|
293
|
+
"49",
|
|
294
|
+
"155"
|
|
295
|
+
],
|
|
296
|
+
"#636363": [
|
|
297
|
+
"50",
|
|
298
|
+
"63",
|
|
299
|
+
"110",
|
|
300
|
+
"134",
|
|
301
|
+
"313"
|
|
302
|
+
],
|
|
303
|
+
"#ffffbb": [
|
|
304
|
+
"64",
|
|
305
|
+
"177",
|
|
306
|
+
"182",
|
|
307
|
+
"185",
|
|
308
|
+
"239",
|
|
309
|
+
"375"
|
|
310
|
+
],
|
|
311
|
+
"#ffca7e": [
|
|
312
|
+
"67",
|
|
313
|
+
"157",
|
|
314
|
+
"266",
|
|
315
|
+
"321"
|
|
316
|
+
],
|
|
317
|
+
"#a96300": [
|
|
318
|
+
"69",
|
|
319
|
+
"158",
|
|
320
|
+
"240",
|
|
321
|
+
"307"
|
|
322
|
+
],
|
|
323
|
+
"#a90000": [
|
|
324
|
+
"72",
|
|
325
|
+
"337",
|
|
326
|
+
"338",
|
|
327
|
+
"340"
|
|
328
|
+
],
|
|
329
|
+
"#ca7eff": [
|
|
330
|
+
"73",
|
|
331
|
+
"112",
|
|
332
|
+
"195",
|
|
333
|
+
"278",
|
|
334
|
+
"305"
|
|
335
|
+
],
|
|
336
|
+
"#5e1ba0": [
|
|
337
|
+
"75",
|
|
338
|
+
"181"
|
|
339
|
+
],
|
|
340
|
+
"#7e7eff": [
|
|
341
|
+
"76",
|
|
342
|
+
"113",
|
|
343
|
+
"193"
|
|
344
|
+
],
|
|
345
|
+
"#0000a9": [
|
|
346
|
+
"78"
|
|
347
|
+
],
|
|
348
|
+
"#7ee3a3": [
|
|
349
|
+
"79",
|
|
350
|
+
"139",
|
|
351
|
+
"176",
|
|
352
|
+
"192",
|
|
353
|
+
"194",
|
|
354
|
+
"282"
|
|
355
|
+
],
|
|
356
|
+
"#00842f": [
|
|
357
|
+
"81",
|
|
358
|
+
"138"
|
|
359
|
+
],
|
|
360
|
+
"#e68c00": [
|
|
361
|
+
"82",
|
|
362
|
+
"294",
|
|
363
|
+
"295",
|
|
364
|
+
"325"
|
|
365
|
+
],
|
|
366
|
+
"#dc1e00": [
|
|
367
|
+
"83"
|
|
368
|
+
],
|
|
369
|
+
"#968c00": [
|
|
370
|
+
"84"
|
|
371
|
+
],
|
|
372
|
+
"#606000": [
|
|
373
|
+
"170"
|
|
374
|
+
],
|
|
375
|
+
"#1e366c": [
|
|
376
|
+
"171"
|
|
377
|
+
],
|
|
378
|
+
"#8b2e1c": [
|
|
379
|
+
"172",
|
|
380
|
+
"293",
|
|
381
|
+
"299"
|
|
382
|
+
],
|
|
383
|
+
"#105830": [
|
|
384
|
+
"173",
|
|
385
|
+
"309"
|
|
386
|
+
],
|
|
387
|
+
"#45544b": [
|
|
388
|
+
"174"
|
|
389
|
+
],
|
|
390
|
+
"#1e68fe": [
|
|
391
|
+
"183"
|
|
392
|
+
],
|
|
393
|
+
"#ef370c": [
|
|
394
|
+
"184",
|
|
395
|
+
"208",
|
|
396
|
+
"235"
|
|
397
|
+
],
|
|
398
|
+
"#4cdf15": [
|
|
399
|
+
"186",
|
|
400
|
+
"229"
|
|
401
|
+
],
|
|
402
|
+
"#ff0012": [
|
|
403
|
+
"196",
|
|
404
|
+
"199"
|
|
405
|
+
],
|
|
406
|
+
"#4fff6c": [
|
|
407
|
+
"198"
|
|
408
|
+
],
|
|
409
|
+
"#33f3ff": [
|
|
410
|
+
"202",
|
|
411
|
+
"205",
|
|
412
|
+
"252",
|
|
413
|
+
"253",
|
|
414
|
+
"262"
|
|
415
|
+
],
|
|
416
|
+
"#30bdd6": [
|
|
417
|
+
"206",
|
|
418
|
+
"281"
|
|
419
|
+
],
|
|
420
|
+
"undefined": [
|
|
421
|
+
"209"
|
|
422
|
+
],
|
|
423
|
+
"#fbeab7": [
|
|
424
|
+
"224",
|
|
425
|
+
"274",
|
|
426
|
+
"275",
|
|
427
|
+
"311",
|
|
428
|
+
"342"
|
|
429
|
+
],
|
|
430
|
+
"#453d2a": [
|
|
431
|
+
"242",
|
|
432
|
+
"341"
|
|
433
|
+
],
|
|
434
|
+
"#bafbdf": [
|
|
435
|
+
"243",
|
|
436
|
+
"246",
|
|
437
|
+
"249",
|
|
438
|
+
"255"
|
|
439
|
+
],
|
|
440
|
+
"#ffde00": [
|
|
441
|
+
"251",
|
|
442
|
+
"271",
|
|
443
|
+
"280"
|
|
444
|
+
],
|
|
445
|
+
"#96cedf": [
|
|
446
|
+
"265"
|
|
447
|
+
],
|
|
448
|
+
"#fab07e": [
|
|
449
|
+
"267"
|
|
450
|
+
],
|
|
451
|
+
"#e8c368": [
|
|
452
|
+
"268"
|
|
453
|
+
],
|
|
454
|
+
"#99452b": [
|
|
455
|
+
"277"
|
|
456
|
+
],
|
|
457
|
+
"#0b0b0b": [
|
|
458
|
+
"284"
|
|
459
|
+
],
|
|
460
|
+
"#df11c9": [
|
|
461
|
+
"286"
|
|
462
|
+
],
|
|
463
|
+
"#3e281b": [
|
|
464
|
+
"290",
|
|
465
|
+
"291",
|
|
466
|
+
"373"
|
|
467
|
+
],
|
|
468
|
+
"#493c23": [
|
|
469
|
+
"297",
|
|
470
|
+
"298"
|
|
471
|
+
],
|
|
472
|
+
"#46332b": [
|
|
473
|
+
"302",
|
|
474
|
+
"314",
|
|
475
|
+
"349"
|
|
476
|
+
],
|
|
477
|
+
"#92de5f": [
|
|
478
|
+
"322"
|
|
479
|
+
],
|
|
480
|
+
"#776859": [
|
|
481
|
+
"345",
|
|
482
|
+
"352"
|
|
483
|
+
],
|
|
484
|
+
"#735c3c": [
|
|
485
|
+
"346",
|
|
486
|
+
"347",
|
|
487
|
+
"355",
|
|
488
|
+
"356"
|
|
489
|
+
],
|
|
490
|
+
"#615044": [
|
|
491
|
+
"348"
|
|
492
|
+
],
|
|
493
|
+
"#513301": [
|
|
494
|
+
"350",
|
|
495
|
+
"354",
|
|
496
|
+
"357"
|
|
497
|
+
],
|
|
498
|
+
"#ece4cc": [
|
|
499
|
+
"351"
|
|
500
|
+
],
|
|
501
|
+
"#fef9e7": [
|
|
502
|
+
"353"
|
|
503
|
+
],
|
|
504
|
+
"#92bcb4": [
|
|
505
|
+
"358"
|
|
506
|
+
],
|
|
507
|
+
"#6fa497": [
|
|
508
|
+
"359"
|
|
509
|
+
],
|
|
510
|
+
"#bce5db": [
|
|
511
|
+
"360"
|
|
512
|
+
],
|
|
513
|
+
"#e3d7c7": [
|
|
514
|
+
"361"
|
|
515
|
+
],
|
|
516
|
+
"#95b9ba": [
|
|
517
|
+
"363"
|
|
518
|
+
],
|
|
519
|
+
"#a9a7a3": [
|
|
520
|
+
"364"
|
|
521
|
+
]
|
|
522
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jx3box/jx3box-editor",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.10",
|
|
4
4
|
"description": "JX3BOX Article & Editor",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"last 2 versions"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@jx3box/jx3box-common": "^7.2
|
|
35
|
-
"@jx3box/jx3box-data": "^1.
|
|
34
|
+
"@jx3box/jx3box-common": "^7.4.2",
|
|
35
|
+
"@jx3box/jx3box-data": "^1.11.1",
|
|
36
36
|
"@jx3box/jx3box-emotion": "^1.0.10",
|
|
37
37
|
"@jx3box/jx3box-macro": "^1.0.1",
|
|
38
38
|
"@jx3box/jx3box-talent": "^1.1.2",
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: X3ZvaWQ
|
|
3
|
+
* @Date: 2022-08-20 22:17:27
|
|
4
|
+
* @LastEditors: X3ZvaWQ
|
|
5
|
+
* @LastEditTime: 2022-08-20 23:54:41
|
|
6
|
+
* @Description:
|
|
7
|
+
*/
|
|
8
|
+
import { $node } from "@jx3box/jx3box-common/js/https";
|
|
9
|
+
const $ = $node();
|
|
10
|
+
|
|
11
|
+
/* import axios from 'axios'
|
|
12
|
+
const $ = axios.create({
|
|
13
|
+
baseURL: 'http://localhost:7002/',
|
|
14
|
+
}) */
|
|
15
|
+
|
|
16
|
+
function getResource(id, client = 'std') {
|
|
17
|
+
return $.get(`/resource/${client}/${id}`);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { getResource };
|
package/src/BoxResource.vue
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<el-tab-pane label="魔盒用户" name="authors">
|
|
17
17
|
<span slot="label" class="u-tab-label">
|
|
18
18
|
<i class="el-icon-s-custom" style="margin-right:5px;"></i>
|
|
19
|
-
<b
|
|
19
|
+
<b>用户</b>
|
|
20
20
|
<i class="u-lv-box">Lv2+</i>
|
|
21
21
|
</span>
|
|
22
22
|
<p v-if="total && done" class="m-resource-count">
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
</ul>
|
|
39
39
|
<el-alert v-if="!authors.length && done" title="没有找到相关条目" type="info" show-icon></el-alert>
|
|
40
40
|
</el-tab-pane>
|
|
41
|
-
<el-tab-pane label="
|
|
41
|
+
<el-tab-pane label="剑三趣图" name="emotions">
|
|
42
42
|
<span slot="label" class="u-tab-label">
|
|
43
43
|
<i class="el-icon-sugar" style="margin-right: 5px;"></i>
|
|
44
|
-
<b
|
|
44
|
+
<b>趣图</b>
|
|
45
45
|
</span>
|
|
46
46
|
<p v-if="total && done" class="m-resource-count">
|
|
47
47
|
<i class="el-icon-s-data"></i> 共找到 <b>{{ total }}</b> 条记录
|
package/src/GameText.vue
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: X3ZvaWQ
|
|
3
|
+
* @Date: 2022-08-20 20:23:57
|
|
4
|
+
* @LastEditors: X3ZvaWQ
|
|
5
|
+
* @LastEditTime: 2022-08-23 20:36:40
|
|
6
|
+
* @Description: 用于渲染游戏内Text标签的文本
|
|
7
|
+
-->
|
|
8
|
+
<template>
|
|
9
|
+
<span v-html="html"></span>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
import { extractTextContent, getLink } from "@jx3box/jx3box-common/js/utils";
|
|
14
|
+
import { getResource } from "../service/resource";
|
|
15
|
+
import { escape } from "lodash";
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
name: "GameText",
|
|
19
|
+
props: {
|
|
20
|
+
text: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: "",
|
|
23
|
+
},
|
|
24
|
+
client: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: "std",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
data: function () {
|
|
30
|
+
return {
|
|
31
|
+
html: "",
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
methods: {
|
|
35
|
+
/**
|
|
36
|
+
* 渲染某一个单独的Text标签成Span或链接
|
|
37
|
+
* @param {*} school_id
|
|
38
|
+
* @returns
|
|
39
|
+
*/
|
|
40
|
+
renderItemHtml: function (item) {
|
|
41
|
+
let content = item.text;
|
|
42
|
+
let style = ``;
|
|
43
|
+
let link = null;
|
|
44
|
+
content = content.replace(/\\n/g, "<br />").replace(/\\/g, "");
|
|
45
|
+
if ([item.r, item.g, item.b].every((v) => v != undefined && v > 0)) {
|
|
46
|
+
style = `color: rgb(${item.r}, ${item.g}, ${item.b});`;
|
|
47
|
+
} else if (item.font != undefined && item.font != 100) {
|
|
48
|
+
const fonts = require("../assets/data/game_font.json");
|
|
49
|
+
for (let color in fonts) {
|
|
50
|
+
if (fonts[color].includes(item.font)) {
|
|
51
|
+
style = `color: ${color};`;
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (item.name == "iteminfolink" && item.script) {
|
|
57
|
+
let item_type = item.script?.match(/this\.dwTabType=(\d+)/i)?.[1];
|
|
58
|
+
let item_index = item.script?.match(/this\.dwIndex=(\d+)/i)?.[1];
|
|
59
|
+
if (item_type && item_index) {
|
|
60
|
+
let item_id = `${item_type}_${item_index}`;
|
|
61
|
+
link = getLink("item", item_id);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (link) {
|
|
65
|
+
return `<a style="${style} text-decoration: none;" target="_blank" href="${link}">${content}</a>`;
|
|
66
|
+
} else {
|
|
67
|
+
return `<span style="${style}">${content}</span>`;
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
/**
|
|
71
|
+
* 将一段游戏内文本转换为Html
|
|
72
|
+
* @param {Object[]} texts 标签对象
|
|
73
|
+
*/
|
|
74
|
+
renderTextHtml: function (Text) {
|
|
75
|
+
let result = Text;
|
|
76
|
+
const matches = Text.match(/<Text>(.*?)<\/text>/gimsy);
|
|
77
|
+
if (!matches) return Text;
|
|
78
|
+
for (let match of matches) {
|
|
79
|
+
let text = extractTextContent(match);
|
|
80
|
+
let html = this.renderItemHtml(text[0]);
|
|
81
|
+
result = result.replace(match, html);
|
|
82
|
+
}
|
|
83
|
+
return result;
|
|
84
|
+
},
|
|
85
|
+
/**
|
|
86
|
+
* 获取形如<BUFF 110 1 desc>, <ENCHANT 100>的资源字段并转换
|
|
87
|
+
*/
|
|
88
|
+
renderBuffResource: function () {
|
|
89
|
+
const matches = this.html.match(/<BUFF (\d+) (\d+) (.*?)>/gim);
|
|
90
|
+
if (!matches) return;
|
|
91
|
+
let need_replaces = {};
|
|
92
|
+
//先统计需要的资源,减少请求数量
|
|
93
|
+
for (let match of matches) {
|
|
94
|
+
let [token, id, level, type] = match.match(/<BUFF (\d+) (\d+) (.*?)>/i);
|
|
95
|
+
let buff_token = `${id}_${level}`;
|
|
96
|
+
if (!need_replaces[buff_token]) {
|
|
97
|
+
need_replaces[buff_token] = [];
|
|
98
|
+
}
|
|
99
|
+
need_replaces[buff_token].push({
|
|
100
|
+
token,
|
|
101
|
+
type,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
//对每一个需要的资源发起请求
|
|
105
|
+
for (let buff_token in need_replaces) {
|
|
106
|
+
let token_item = need_replaces[buff_token];
|
|
107
|
+
getResource(`buff.${buff_token}`, this.client)
|
|
108
|
+
.then((res) => {
|
|
109
|
+
let data = res.data;
|
|
110
|
+
for (let item of token_item) {
|
|
111
|
+
item.type = item.type.toLowerCase();
|
|
112
|
+
let type_map = {
|
|
113
|
+
desc: "Desc",
|
|
114
|
+
time: "Interval",
|
|
115
|
+
};
|
|
116
|
+
let attr = type_map[item.type] || item.type;
|
|
117
|
+
let value = data[attr];
|
|
118
|
+
if (typeof value == "number" && item.type == "time") {
|
|
119
|
+
let time = value / 16;
|
|
120
|
+
if (time > 60) {
|
|
121
|
+
time = `${Math.floor(time / 60)}分钟`;
|
|
122
|
+
} else {
|
|
123
|
+
time = `${time}秒`;
|
|
124
|
+
}
|
|
125
|
+
this.html = this.html.replace(item.token, time);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
if (!value) return;
|
|
129
|
+
let _matches = value.match(/<BUFF ([0-9a-zA-Z]+)>/gi);
|
|
130
|
+
if (!_matches) this.html = this.html.replace(match, value);
|
|
131
|
+
for (let _match of _matches) {
|
|
132
|
+
let [, _attr] = _match.match(/<BUFF ([0-9a-zA-Z]+)>/i);
|
|
133
|
+
for (let i = 1; i < 15; i++) {
|
|
134
|
+
if (data[`BeginAttrib${i}`] == _attr) {
|
|
135
|
+
value = value.replace(_match, data[`BeginValue${i}A`]);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
this.html = this.html.replace(item.token, value);
|
|
140
|
+
}
|
|
141
|
+
})
|
|
142
|
+
.catch((err) => {
|
|
143
|
+
console.log(err);
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
renderEnchantResource: function () {
|
|
148
|
+
const matches = this.html.match(/<ENCHANT (\d+)>/gim);
|
|
149
|
+
for (let match of matches) {
|
|
150
|
+
let enchant_id = match.match(/<ENCHANT (\d+)>/i)[1];
|
|
151
|
+
getResource(`enchant.${enchant_id}`, this.client)
|
|
152
|
+
.then((res) => {
|
|
153
|
+
let data = res.data;
|
|
154
|
+
let time = data.Time;
|
|
155
|
+
if (time) time = `,持续${parseInt(time) / 60}分钟。`;
|
|
156
|
+
let result = `${data.AttriName}${time ? time : ""}`;
|
|
157
|
+
this.html = this.html.replace(match, result);
|
|
158
|
+
})
|
|
159
|
+
.catch((err) => {
|
|
160
|
+
this.html = this.html.replace(match, escape(match));
|
|
161
|
+
console.log(err);
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
renderResource: function () {
|
|
166
|
+
this.renderBuffResource();
|
|
167
|
+
this.renderEnchantResource();
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
watch: {
|
|
171
|
+
text: {
|
|
172
|
+
immediate: true,
|
|
173
|
+
handler: function (val) {
|
|
174
|
+
this.html = this.renderTextHtml(val);
|
|
175
|
+
this.renderResource();
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
</script>
|
|
181
|
+
|
|
182
|
+
<style>
|
|
183
|
+
</style>
|
package/src/Item.vue
CHANGED
|
@@ -175,11 +175,11 @@
|
|
|
175
175
|
<img :src="source.ImageUrl" @error.once="source.ImageUrl=null" />
|
|
176
176
|
</div>
|
|
177
177
|
<!-- 描述 -->
|
|
178
|
-
<p
|
|
178
|
+
<p
|
|
179
179
|
v-if="source.DescHtml"
|
|
180
|
-
class="u-desc u-yellow"
|
|
181
|
-
|
|
182
|
-
|
|
180
|
+
class="u-desc u-yellow">
|
|
181
|
+
<game-text :client="client" :text="source.DescHtml || source.Desc"></game-text>
|
|
182
|
+
</p>
|
|
183
183
|
<!-- 五彩石属性 -->
|
|
184
184
|
<p v-if="source.WuCaiHtml" class="u-desc" v-html="source.WuCaiHtml"></p>
|
|
185
185
|
<!-- 品质等级 -->
|
|
@@ -243,6 +243,8 @@
|
|
|
243
243
|
<script>
|
|
244
244
|
import { get_item } from "../service/item.js";
|
|
245
245
|
|
|
246
|
+
import GameText from "./GameText.vue";
|
|
247
|
+
|
|
246
248
|
import attribute_percent from "../assets/js/item/attribute_percent.js";
|
|
247
249
|
import bind from "../assets/js/item/bind.js";
|
|
248
250
|
import color from "../assets/js/item/color.js";
|
|
@@ -255,12 +257,28 @@ dayjs.extend(duration);
|
|
|
255
257
|
|
|
256
258
|
export default {
|
|
257
259
|
name: "Item",
|
|
258
|
-
props:
|
|
260
|
+
props: {
|
|
261
|
+
item: {
|
|
262
|
+
type: Object
|
|
263
|
+
},
|
|
264
|
+
item_id: {
|
|
265
|
+
type: String
|
|
266
|
+
},
|
|
267
|
+
client: {
|
|
268
|
+
type: String
|
|
269
|
+
},
|
|
270
|
+
jx3ClientType: {
|
|
271
|
+
type: Number
|
|
272
|
+
},
|
|
273
|
+
},
|
|
259
274
|
data() {
|
|
260
275
|
return {
|
|
261
276
|
source: null,
|
|
262
277
|
};
|
|
263
278
|
},
|
|
279
|
+
components: {
|
|
280
|
+
GameText
|
|
281
|
+
},
|
|
264
282
|
computed : {
|
|
265
283
|
// 兼容旧版传值
|
|
266
284
|
env_client_id : function (){
|