Sourcecode in SkinMgr/objectFunctions.js:
1: function dumpToZip(z, fullExport, exportLog) {
2: if (!exportLog)
3: var exportLog = new java.util.Hashtable(200);
4: var key;
5: // first loop over all skins managed by this skinmanager
6: for (var i=0;i<this.size();i++) {
7: var proto = this.get(i);
8: for (var j=0;j<proto.size();j++) {
9: var s = proto.get(j);
10: key = s.proto + s.name;
11: if (s.skin && !exportLog.containsKey(key)) {
12: var buf = new java.lang.String(s.skin).getBytes();
13: z.addData(buf, "skins/" + s.proto + "/" + s.name + ".skin");
14: // add the exported skin to the exportLog
15: exportLog.put(key, true)
16: }
17: }
18: }
19: // if fullExport is enabled also dump the parent's skins
20: // and finally all skins of app.skinfiles that weren't
21: // exported already
22: if (fullExport) {
23: if (this._parent.parent)
24: this._parent.parent.skins.dumpToZip(z, fullExport, exportLog);
25: else {
26: // loop over application prototypes and add those skins
27: // that aren't exported already to the zip file
28: var protos = app.__app__.getPrototypes();
29: var it = protos.iterator();
30: var key, protoName, source;
31: while (it.hasNext()) {
32: protoName = it.next().getName();
33: var protoSkins = app.skinfiles[protoName];
34: for (var skinName in protoSkins) {
35: source = protoSkins[skinName];
36: key = protoName + skinName;
37: if (source && !exportLog.containsKey(key)) {
38: var buf = new java.lang.String(source).getBytes();
39: z.addData(buf, "skins/" + protoName + "/" + skinName + ".skin");
40: exportLog.put(key, true);
41: }
42: }
43: }
44: }
45: }
46: return exportLog;
47: }
|