Skip to content

Commit 3e2d1db

Browse files
committed
标准化命名
1 parent 1594103 commit 3e2d1db

File tree

64 files changed

+23
-7
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+23
-7
lines changed

build/icon/1.filter.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// 这个脚本每次原神更新使用一次
2+
13
const fs = require('fs');
24
const path = require('path');
35

@@ -18,16 +20,20 @@ if (!fs.existsSync(targetDir)) {
1820
fs.readdirSync(sourceDir).forEach(file => {
1921
const fileName = path.parse(file).name; // 获取文件名(不含扩展名)
2022

21-
// 在JSON数据中查找匹配项
22-
const matchedItem = jsonData.find(item => item.Icon === fileName);
23+
// 查找所有匹配项
24+
const matchedItems = jsonData.filter(item => item.Icon === fileName);
2325

24-
if (matchedItem) {
26+
if (matchedItems.length > 0) {
2527
const sourcePath = path.join(sourceDir, file);
26-
const targetPath = path.join(targetDir, `${matchedItem.Name}.png`);
2728

28-
// 复制并重命名文件
29-
fs.copyFileSync(sourcePath, targetPath);
30-
console.log(`已复制并重命名: ${file} -> ${matchedItem.Name}.png`);
29+
// 为每个匹配项创建文件
30+
matchedItems.forEach(matchedItem => {
31+
const targetPath = path.join(targetDir, `${matchedItem.Name}.png`);
32+
33+
// 复制并重命名文件
34+
fs.copyFileSync(sourcePath, targetPath);
35+
console.log(`已复制并重命名: ${file} -> ${matchedItem.Name}.png`);
36+
});
3137
}
3238
});
3339

build/icon/2.match.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// 这个脚本,有新的脚本目录就要使用
2+
13
const fs = require('fs');
24
const path = require('path');
35

build/icon/3.icon.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// 用于给每个脚本目录添加icon
2+
13
const fs = require('fs');
24
const path = require('path');
35
const { exec } = require('child_process');

build/icon/4.new_transfer.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// 只找新的png文件,然后复制到diffPng目录
2+
13
const fs = require('fs');
24
const path = require('path');
35

repo/pathing/水晶块/desktop.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[.ShellClassInfo]
2+
IconResource=icon.ico

repo/pathing/水晶块/icon.ico

28.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)