-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3fbb656
commit 1206df5
Showing
87 changed files
with
251 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
.DS_Store | ||
dist | ||
dist-ssr | ||
coverage | ||
*.local | ||
|
||
/cypress/videos/ | ||
/cypress/screenshots/ | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
*.tsbuildinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
// 读取JSON文件 | ||
const jsonPath = 'E:\\HuiTask\\更好的原神\\2.资料\\图标处理\\Material.json'; | ||
const jsonData = JSON.parse(fs.readFileSync(jsonPath, 'utf8')); | ||
|
||
// 设置源文件夹和目标文件夹 | ||
const sourceDir = 'E:\\HuiTask\\更好的原神\\2.资料\\图标处理\\ItemIcon-tiny'; | ||
const targetDir = 'E:\\HuiTask\\更好的原神\\2.资料\\图标处理\\newPng'; | ||
|
||
// 确保目标文件夹存在 | ||
if (!fs.existsSync(targetDir)) { | ||
fs.mkdirSync(targetDir, { recursive: true }); | ||
} | ||
|
||
// 读取源文件夹中的所有文件 | ||
fs.readdirSync(sourceDir).forEach(file => { | ||
const fileName = path.parse(file).name; // 获取文件名(不含扩展名) | ||
|
||
// 在JSON数据中查找匹配项 | ||
const matchedItem = jsonData.find(item => item.Icon === fileName); | ||
|
||
if (matchedItem) { | ||
const sourcePath = path.join(sourceDir, file); | ||
const targetPath = path.join(targetDir, `${matchedItem.Name}.png`); | ||
|
||
// 复制并重命名文件 | ||
fs.copyFileSync(sourcePath, targetPath); | ||
console.log(`已复制并重命名: ${file} -> ${matchedItem.Name}.png`); | ||
} | ||
}); | ||
|
||
console.log('处理完成'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
// 定义路径 | ||
const pathingDir = 'D:\\HuiPrograming\\Projects\\CSharp\\MiHoYo\\bettergi-scripts-list\\repo\\pathing'; | ||
const pngDir = 'E:\\HuiTask\\更好的原神\\2.资料\\图标处理\\newPng'; | ||
const outputDir = 'E:\\HuiTask\\更好的原神\\2.资料\\图标处理\\matchedPng'; | ||
|
||
// 确保输出目录存在 | ||
if (!fs.existsSync(outputDir)) { | ||
fs.mkdirSync(outputDir); | ||
} | ||
|
||
// 读取 pathing 目录下的所有文件夹名称 | ||
fs.readdir(pathingDir, { withFileTypes: true }, (err, entries) => { | ||
if (err) { | ||
console.error('读取 pathing 目录时出错:', err); | ||
return; | ||
} | ||
|
||
// 过滤出目录 | ||
const directories = entries.filter(entry => entry.isDirectory()).map(dir => dir.name); | ||
|
||
// 遍历目录名称 | ||
directories.forEach(dirName => { | ||
const pngPath = path.join(pngDir, `${dirName}.png`); | ||
const outputPath = path.join(outputDir, `${dirName}.png`); | ||
|
||
// 检查对应的 PNG 文件是否存在 | ||
if (fs.existsSync(pngPath)) { | ||
// 复制文件 | ||
fs.copyFile(pngPath, outputPath, err => { | ||
if (err) { | ||
console.error(`复制 ${dirName}.png 时出错:`, err); | ||
} else { | ||
console.log(`成功复制 ${dirName}.png 到 matchedPng 文件夹`); | ||
} | ||
}); | ||
} else { | ||
console.log(`未找到对应的 PNG 文件: ${dirName}.png`); | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const { exec } = require('child_process'); | ||
|
||
// 定义路径 | ||
const sourcePath = 'D:\\HuiPrograming\\Projects\\CSharp\\MiHoYo\\bettergi-scripts-list\\repo\\pathing'; | ||
const iconSourcePath = 'E:\\HuiTask\\更好的原神\\2.资料\\图标处理\\matchedIco'; | ||
const desktopIniPath = 'E:\\HuiTask\\更好的原神\\2.资料\\图标处理\\desktop.ini'; | ||
|
||
// 读取源目录 | ||
fs.readdir(sourcePath, { withFileTypes: true }, (err, entries) => { | ||
if (err) { | ||
console.error('读取源目录时出错:', err); | ||
return; | ||
} | ||
|
||
// 遍历每个目录 | ||
entries.filter(entry => entry.isDirectory()).forEach(dir => { | ||
const dirPath = path.join(sourcePath, dir.name); | ||
const iconSourceFile = path.join(iconSourcePath, `${dir.name}.ico`); | ||
const iconDestFile = path.join(dirPath, 'icon.ico'); | ||
const desktopIniDestFile = path.join(dirPath, 'desktop.ini'); | ||
|
||
// 检查图标源文件是否存在 | ||
if (!fs.existsSync(iconSourceFile)) { | ||
console.log(`警告:${dir.name} 的图标文件不存在,跳过所有操作`); | ||
return; // 跳过当前目录的所有后续操作 | ||
} | ||
|
||
// 复制图标文件 | ||
fs.copyFile(iconSourceFile, iconDestFile, (err) => { | ||
if (err) { | ||
console.error(`复制图标文件到 ${dir.name} 时出错:`, err); | ||
return; // 如果复制图标失败,跳过后续操作 | ||
} | ||
console.log(`成功复制图标文件到 ${dir.name}`); | ||
|
||
// 复制desktop.ini文件 | ||
fs.copyFile(desktopIniPath, desktopIniDestFile, (err) => { | ||
if (err) { | ||
console.error(`复制desktop.ini到 ${dir.name} 时出错:`, err); | ||
return; // 如果复制desktop.ini失败,跳过后续操作 | ||
} | ||
console.log(`成功复制desktop.ini到 ${dir.name}`); | ||
|
||
// 执行cmd命令 | ||
exec(`attrib +R "${dirPath}"`, (err, stdout, stderr) => { | ||
if (err) { | ||
console.error(`执行attrib命令时出错 ${dir.name}:`, err); | ||
return; | ||
} | ||
console.log(`成功为 ${dir.name} 设置只读属性`); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[.ShellClassInfo] | ||
IconResource=icon.ico |
Binary file not shown.