forked from fishpondstudio/IndustryIdle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathachievement.js
More file actions
23 lines (19 loc) · 770 Bytes
/
Copy pathachievement.js
File metadata and controls
23 lines (19 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const { readdirSync, readFileSync, existsSync } = require("fs");
const { execSync, spawn } = require("child_process");
const path = require("path");
const STEAM_ACHIEVEMENTS = JSON.parse(readFileSync("./steam-achievements.json", { encoding: "utf8" }));
const dir = "achievements/";
const result = readdirSync(dir);
result.forEach((p) => {
if (p.endsWith(".png") && !p.endsWith("_.png")) {
const target = path.join(dir, p.replace(".png", "_.png"));
if (!existsSync(target)) {
execSync(`magick ${path.join(dir, p)} -colorspace Gray ${target}`);
}
}
});
const achievements = {};
STEAM_ACHIEVEMENTS.achievements.forEach((item) => {
achievements[item.api_name] = [item.icon, item.icon_gray];
});
console.log(achievements);