-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
86 lines (86 loc) · 3.06 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
define(["model/cjs-loader", "model/manifest-loader", "view/cjs_npc_demo"], function (cjsloader, manifestloader, cjs_npc_demo) {
loadCJS = function (a) {
var b = $.Deferred();
return cjsloader.once("complete", function () {
b.resolve()
}),
cjsloader.loadFiles(a),
b
};
loadManifest = function (a) {
var b = $.Deferred()
, c = _.flatten(_.map(a, function (a) {
return cjsloader.manifest(a)
}))
if(is_mc && mc_wpn) // set wpn
{
// mc only fix
let melee = AnimeData[1][0]["cjs"][0].includes("_me_");
for(let e of c)
{
if(melee)
{
if(e.id == "weapon_l") e.src = Game.imgUri + "/sp/cjs/" + mc_wpn + "_1.png"
else if(e.id == "weapon_r") e.src = Game.imgUri + "/sp/cjs/" + mc_wpn + "_2.png"
}
else
{
if(e.id == "weapon") e.src = Game.imgUri + "/sp/cjs/" + mc_wpn + ".png"
}
}
}
// end
return (function () {}),
manifestloader.once("complete", function () {
b.resolve()
}),
manifestloader.loadManifest(c, !0),
b
};
cjsRender = function (a) {
a.cjsRender()
};
prepareCjs = function () {
var a = this
a.cjsViewList = new Array();
var c = []
_.each(action_index, function (b, e) {
b.special=Array.from(b.special);
var f = new cjs_npc_demo({
fps: 30,
cjsList: b.cjs,
cjsEffectList: b.effect,
cjsMortalList: b.special,
cjsPosList: b.cjs_pos,
cjsMortalPosList: b.special_pos,
motionList: b.action_label_list,
canvasSelector: ".cjs-npc-demo-" + e,
canvasIndex: e,
});
a.cjsViewList[e] = f,
c = c.concat(f.getLoadFiles())
}),
c = _.uniq(c),
this.loadCJS(c).then(function () {
return a.loadManifest(c)
}).done(function () {
_.each(a.cjsViewList, function (b, e) {
a.cjsRender(b)
l = b.getActionList();
custom_choices[e] = l.slice(0);
if (e > 0) {
b.pause()
}
else
{
var actionlist = '<option value="default">Demo</option>'
for (action in l) {
actionlist = actionlist.concat('<option value=' + l[action] + '>' + b.translateAction(l[action]) + '</option>');
}
document.getElementById("act-selection").innerHTML = actionlist;
}
})
})
}
prepareCjs()
})