crobi 10 年之前
父節點
當前提交
ab5d2eb1ac

+ 11
- 0
resources/scripts/copy-icons.bat 查看文件

@@ -0,0 +1,11 @@
1
+@cd ..
2
+@cd ..
3
+@echo ------------------------------------------------------
4
+@echo This copies all .svg files from all subdirectories
5
+@echo of ./resources to ./generator/icons
6
+@echo ------------------------------------------------------
7
+@pause
8
+copy .\resources\game-icons.net\*.svg .\generator\icons
9
+copy .\resources\custom-icons\*.svg .\generator\icons
10
+copy .\resources\class-icons\*.svg .\generator\icons
11
+@pause

+ 9
- 0
resources/scripts/extract-game-icons.bat 查看文件

@@ -0,0 +1,9 @@
1
+@cd ..
2
+@cd ..
3
+@echo ------------------------------------------------------
4
+@echo This moves all files from all subfolders of 
5
+@echo ./resources/game-icons.net to the root of that folder
6
+@echo ------------------------------------------------------
7
+@pause
8
+node ./resources/scripts/extract.js ../game-icons.net
9
+@pause

resources/tools/extract.js → resources/scripts/extract.js 查看文件


+ 9
- 0
resources/scripts/list-game-icons.bat 查看文件

@@ -0,0 +1,9 @@
1
+@cd ..
2
+@cd ..
3
+@echo ------------------------------------------------------
4
+@echo This lists all files in ./resources/game-icons.net
5
+@echo and saves the list as game-icons.net.txt
6
+@echo ------------------------------------------------------
7
+@pause
8
+node ./resources/scripts/list.js ../game-icons.net ../scripts/game-icons.net.txt
9
+@pause

resources/tools/list.js → resources/scripts/list.js 查看文件

@@ -9,6 +9,12 @@ if (process.argv[2]) {
9 9
 }
10 10
 console.log("Working in " + workingdir);
11 11
 
12
+var outputname = "files.txt";
13
+if (process.argv[3]) {
14
+    outputname = process.argv[3];
15
+}
16
+console.log("Working in " + workingdir);
17
+
12 18
 var options = {};
13 19
 var walker = walk.walk(workingdir, options);
14 20
 
@@ -29,11 +35,11 @@ walker.on("end", function () {
29 35
 
30 36
     files.sort();
31 37
     var endOfLine = require('os').EOL;
32
-    fs.writeFile(path.resolve(workingdir, "files.txt"), files.join(endOfLine), function (err) {
38
+    fs.writeFile(path.resolve(workingdir, outputname), files.join(endOfLine), function (err) {
33 39
         if (err) {
34 40
             console.log(err);
35 41
         } else {
36
-            console.log("File list saved as files.txt.");
42
+            console.log("File list saved as " + outputname);
37 43
         }
38 44
     });
39 45
 });

make.bat → resources/scripts/make.bat 查看文件

@@ -1,3 +1,6 @@
1
+@cd ..
2
+@cd ..
3
+
1 4
 @ECHO building card.js
2 5
 @CALL node node_modules/typescript/bin/tsc generator/js/card.ts -t ES6 -sourcemap -d --out generator/js/card.js
3 6
 

+ 4
- 0
resources/scripts/run.bat 查看文件

@@ -0,0 +1,4 @@
1
+@cd ..
2
+@cd ..
3
+start node node_modules/http-server/bin/http-server ./generator
4
+"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" http://localhost:8080/generate.html

+ 0
- 203
resources/tools/colors.js 查看文件

@@ -1,203 +0,0 @@
1
-var css_color_names = [
2
-    "Black",
3
-    "Navy",
4
-    "DarkBlue",
5
-    "MediumBlue",
6
-    "Blue",
7
-    "DarkGreen",
8
-    "Green",
9
-    "Teal",
10
-    "DarkCyan",
11
-    "DeepSkyBlue",
12
-    "DarkTurquoise",
13
-    "MediumSpringGreen",
14
-    "Lime",
15
-    "SpringGreen",
16
-    "Aqua",
17
-    "Cyan",
18
-    "MidnightBlue",
19
-    "DodgerBlue",
20
-    "LightSeaGreen",
21
-    "ForestGreen",
22
-    "SeaGreen",
23
-    "DarkSlateGray",
24
-    "LimeGreen",
25
-    "MediumSeaGreen",
26
-    "Turquoise",
27
-    "RoyalBlue",
28
-    "SteelBlue",
29
-    "DarkSlateBlue",
30
-    "MediumTurquoise",
31
-    "Indigo",
32
-    "DarkOliveGreen",
33
-    "CadetBlue",
34
-    "CornflowerBlue",
35
-    "MediumAquaMarine",
36
-    "DimGray",
37
-    "SlateBlue",
38
-    "OliveDrab",
39
-    "SlateGray",
40
-    "LightSlateGray",
41
-    "MediumSlateBlue",
42
-    "LawnGreen",
43
-    "Chartreuse",
44
-    "Aquamarine",
45
-    "Maroon",
46
-    "Purple",
47
-    "Olive",
48
-    "Gray",
49
-    "SkyBlue",
50
-    "LightSkyBlue",
51
-    "BlueViolet",
52
-    "DarkRed",
53
-    "DarkMagenta",
54
-    "SaddleBrown",
55
-    "DarkSeaGreen",
56
-    "LightGreen",
57
-    "MediumPurple",
58
-    "DarkViolet",
59
-    "PaleGreen",
60
-    "DarkOrchid",
61
-    "YellowGreen",
62
-    "Sienna",
63
-    "Brown",
64
-    "DarkGray",
65
-    "LightBlue",
66
-    "GreenYellow",
67
-    "PaleTurquoise",
68
-    "LightSteelBlue",
69
-    "PowderBlue",
70
-    "FireBrick",
71
-    "DarkGoldenRod",
72
-    "MediumOrchid",
73
-    "RosyBrown",
74
-    "DarkKhaki",
75
-    "Silver",
76
-    "MediumVioletRed",
77
-    "IndianRed",
78
-    "Peru",
79
-    "Chocolate",
80
-    "Tan",
81
-    "LightGray",
82
-    "Thistle",
83
-    "Orchid",
84
-    "GoldenRod",
85
-    "PaleVioletRed",
86
-    "Crimson",
87
-    "Gainsboro",
88
-    "Plum",
89
-    "BurlyWood",
90
-    "LightCyan",
91
-    "Lavender",
92
-    "DarkSalmon",
93
-    "Violet",
94
-    "PaleGoldenRod",
95
-    "LightCoral",
96
-    "Khaki",
97
-    "AliceBlue",
98
-    "HoneyDew",
99
-    "Azure",
100
-    "SandyBrown",
101
-    "Wheat",
102
-    "Beige",
103
-    "WhiteSmoke",
104
-    "MintCream",
105
-    "GhostWhite",
106
-    "Salmon",
107
-    "AntiqueWhite",
108
-    "Linen",
109
-    "LightGoldenRodYellow",
110
-    "OldLace",
111
-    "Red",
112
-    "Fuchsia",
113
-    "Magenta",
114
-    "DeepPink",
115
-    "OrangeRed",
116
-    "Tomato",
117
-    "HotPink",
118
-    "Coral",
119
-    "DarkOrange",
120
-    "LightSalmon",
121
-    "Orange",
122
-    "LightPink",
123
-    "Pink",
124
-    "Gold",
125
-    "PeachPuff",
126
-    "NavajoWhite",
127
-    "Moccasin",
128
-    "Bisque",
129
-    "MistyRose",
130
-    "BlanchedAlmond",
131
-    "PapayaWhip",
132
-    "LavenderBlush",
133
-    "SeaShell",
134
-    "Cornsilk",
135
-    "LemonChiffon",
136
-    "FloralWhite",
137
-    "Snow",
138
-    "Yellow",
139
-    "LightYellow",
140
-    "Ivory",
141
-    "White"
142
-];
143
-
144
-var css_color_template = [
145
-    "/* @ */",
146
-    ".color-@ {",
147
-    "    background-color: #;",
148
-    "    border-color: #;",
149
-    "}",
150
-    ".color-@ .ruler {",
151
-    "    background-color: #;",
152
-    "}",
153
-    ".color-@ h3{",
154
-    "    border-color: #;",
155
-    "    color: #;",
156
-    "}",
157
-    ".color-@ .card-back {",
158
-    "    background: radial-gradient(ellipse at center, white 20%, # 120%);",
159
-    "}",
160
-    ".color-@ .back-icon {",
161
-    "    background-color: #;",
162
-    "}",
163
-    ""
164
-];
165
-
166
-var css_custom_colors = [
167
-    "arcane #bb3d2f",
168
-    "cleric #ae7b00",
169
-    "rogue #802161",
170
-    "weapon dimgray",
171
-    "armor dimgray",
172
-    "gear dimgray",
173
-];
174
-
175
-function css_color_str(name, color) {
176
-    return css_color_template.map(function (value) {
177
-        return value.replace("@", name).replace("#", color);
178
-    }).join("\n");
179
-}
180
-
181
-function css_add_color(str) {
182
-    var node = document.createElement('style');
183
-    document.body.appendChild(node);
184
-    node.innerHTML = str;
185
-}
186
-
187
-function css_add_colors(arr) {
188
-    var result = arr.map(function (value) {
189
-        var parts = value.split(" ");
190
-        var color_name = parts[0].toLowerCase();
191
-        var color_value = parts[1] || color_name;
192
-        return css_color_str(color_name, color_value);
193
-    });
194
-
195
-    result.forEach(function (value) {
196
-        css_add_color(value);
197
-    });
198
-
199
-    console.log(result.join("\n"));
200
-}
201
-
202
-css_add_colors(css_color_names);
203
-css_add_colors(css_custom_colors);

+ 0
- 4
resources/tools/extract-game-icons.bat 查看文件

@@ -1,4 +0,0 @@
1
-cd ..
2
-cd ..
3
-node ./resources/tools/extract.js ../game-icons.net
4
-pause

+ 0
- 1342
resources/tools/icons-list.txt
文件差異過大導致無法顯示
查看文件


+ 0
- 1
resources/tools/list-files.bat 查看文件

@@ -1 +0,0 @@
1
-dir /a-h /b > filelist.txt

+ 0
- 4
resources/tools/list-game-icons.bat 查看文件

@@ -1,4 +0,0 @@
1
-cd ..
2
-cd ..
3
-node ./resources/tools/list.js ../game-icons.net
4
-pause

+ 0
- 3
resources/tools/make-transparent.bat 查看文件

@@ -1,3 +0,0 @@
1
-rem Changes black to transparent in all images in the current folder
2
-mogrify -alpha copy -fx #fff *.png
3
-pause

Loading…
取消
儲存