Skip to content

Commit

Permalink
add character icons
Browse files Browse the repository at this point in the history
  • Loading branch information
guyutongxue committed Jun 18, 2024
1 parent 3ab7969 commit d1f99cf
Show file tree
Hide file tree
Showing 104 changed files with 131 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ staticData:-...->api:;
> 编译前设置 `AssetStudio.CLI/App.config``allowDuplicates``True`
```
.\AssetStudio.CLI.exe --silent "D:\Genshin Impact Game\YuanShen_Data\StreamingAssets\AssetBundles\blocks" "D:\gi-assets" --types Texture2D --game GI --names "^UI_Gcg_(Buff|Cardface|Debuff)|^Skill_|^MonsterSkill_"
.\AssetStudio.CLI.exe --silent "D:\Genshin Impact Game\YuanShen_Data\StreamingAssets\AssetBundles\blocks" "D:\gi-assets" --types Texture2D --game GI --names "^UI_Gcg_(Buff|Cardface|Debuff|Char_AvatarIcon)|^Skill_|^MonsterSkill_"
```
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_ALbedo.webp
Binary file not shown.
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Amber.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Ayaka.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Ayato.webp
Binary file not shown.
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Barbara.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Beidou.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Bennett.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Candace.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Cyno.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Dehya.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Diluc.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Diona.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Dori.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Eula.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Faruzan.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Feiyan.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Fischl.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Furina.webp
Binary file not shown.
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Ganyu.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Gorou.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Hutao.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Itto.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Kaeya.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Kaveh.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Kazuha.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Keqing.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Klee.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Kokomi.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Layla.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Linette.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Liney.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Lisa.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Momoka.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Mona.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Nahida.webp
Binary file not shown.
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Nilou.webp
Binary file not shown.
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Noel.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Qin.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Qiqi.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Razor.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Sara.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Sayu.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Shenhe.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Shinobu.webp
Binary file not shown.
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Sucrose.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Tohma.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Venti.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Xiao.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Xingqiu.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Xinyan.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Yae.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Yaoyao.webp
Binary file not shown.
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Yoimiya.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Yunjin.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_AvatarIcon_Zhongli.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_MonsterIcon_Apep.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_MonsterIcon_Dahaka.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_MonsterIcon_Dvalin.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_MonsterIcon_Fatuus.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_MonsterIcon_Ningyo.webp
Binary file not shown.
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_MonsterIcon_Ptahur.webp
Binary file not shown.
Binary file added public/assets/UI_Gcg_Char_MonsterIcon_Raijin.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
36 changes: 28 additions & 8 deletions src/node/generate_images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import { readdir } from "node:fs/promises";
import path from "node:path";
import { statSync } from "node:fs";
import { imageDir, outputDir } from "./config";
import { characters, entities, actionCards, keywords } from "@gi-tcg/static-data";
import {
characters,
entities,
actionCards,
keywords,
} from "@gi-tcg/static-data";

const {
positionals: [input],
Expand Down Expand Up @@ -74,19 +79,25 @@ const replaceNameMap: Record<string, string> = {
};

const skills = characters.flatMap((ch) => ch.skills);
const allData = [...characters, ...actionCards, ...skills, ...entities, ...keywords];
const allData = [
...characters,
...actionCards,
...skills,
...entities,
...keywords,
];

// 召唤物、角色牌、行动牌
for (const obj of allData) {
let filename: string;
if ("cardFace" in obj && obj.cardFace) {
filename = obj.cardFace
filename = obj.cardFace;
} else if ("icon" in obj && obj.icon) {
filename = obj.icon;
} else if ("buffIcon" in obj && obj.buffIcon) {
filename = obj.buffIcon;
} else if ("buffIconHash" in obj && obj.buffIconHash) {
filename = "UI_Gcg_Buff_Common_Special"
filename = "UI_Gcg_Buff_Common_Special";
} else {
continue;
}
Expand All @@ -105,9 +116,12 @@ for (const obj of allData) {

const buffIconList: string[] = [];

// 将所有状态图标加入处理集合
// 将所有状态图标、角色图标加入处理集合
for (const statusImageName of Object.keys(allImagePaths).filter(
(key) => key.startsWith("UI_Gcg_Buff") || key.startsWith("UI_Gcg_Debuff"),
(key) =>
key.startsWith("UI_Gcg_Buff") ||
key.startsWith("UI_Gcg_Debuff") ||
key.startsWith("UI_Gcg_Char"),
)) {
buffIconList.push(statusImageName);
imagesToProcess.add(statusImageName);
Expand All @@ -121,5 +135,11 @@ for (const name of imagesToProcess) {
console.log(`Generated image for ${name}`);
}

await Bun.write(`${outputDir}/imageNames.json`, JSON.stringify(result, void 0, 2));
await Bun.write(`${outputDir}/buffIconList.json`, JSON.stringify(buffIconList, void 0, 2));
await Bun.write(
`${outputDir}/imageNames.json`,
JSON.stringify(result, void 0, 2),
);
await Bun.write(
`${outputDir}/buffIconList.json`,
JSON.stringify(buffIconList, void 0, 2),
);
2 changes: 2 additions & 0 deletions src/node/generate_thumbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ for (const filename of filenames) {
}
} else if (filename.startsWith("UI_Gcg_CardFace")) {
image.resize(80, null);
} else if (filename.startsWith("UI_Gcg_Char")) {
image.resize(30, null);
} else {
image.resize(null, 20);
}
Expand Down
100 changes: 100 additions & 0 deletions src/output/buffIconList.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,106 @@
"UI_Gcg_Buff_Yoimiya_E",
"UI_Gcg_Buff_Yunjin_E",
"UI_Gcg_Buff_Zhongli_E",
"UI_Gcg_Char_AvatarIcon_ALbedo",
"UI_Gcg_Char_AvatarIcon_Alhatham",
"UI_Gcg_Char_AvatarIcon_Amber",
"UI_Gcg_Char_AvatarIcon_Ayaka",
"UI_Gcg_Char_AvatarIcon_Ayato",
"UI_Gcg_Char_AvatarIcon_Baizhuer",
"UI_Gcg_Char_AvatarIcon_Barbara",
"UI_Gcg_Char_AvatarIcon_Beidou",
"UI_Gcg_Char_AvatarIcon_Bennett",
"UI_Gcg_Char_AvatarIcon_Candace",
"UI_Gcg_Char_AvatarIcon_Charlotte",
"UI_Gcg_Char_AvatarIcon_Chongyun",
"UI_Gcg_Char_AvatarIcon_Collei",
"UI_Gcg_Char_AvatarIcon_Cyno",
"UI_Gcg_Char_AvatarIcon_Dehya",
"UI_Gcg_Char_AvatarIcon_Diluc",
"UI_Gcg_Char_AvatarIcon_Diona",
"UI_Gcg_Char_AvatarIcon_Dori",
"UI_Gcg_Char_AvatarIcon_Eula",
"UI_Gcg_Char_AvatarIcon_Faruzan",
"UI_Gcg_Char_AvatarIcon_Feiyan",
"UI_Gcg_Char_AvatarIcon_Fischl",
"UI_Gcg_Char_AvatarIcon_Furina",
"UI_Gcg_Char_AvatarIcon_FurinaOusia",
"UI_Gcg_Char_AvatarIcon_Ganyu",
"UI_Gcg_Char_AvatarIcon_Gorou",
"UI_Gcg_Char_AvatarIcon_Hutao",
"UI_Gcg_Char_AvatarIcon_Itto",
"UI_Gcg_Char_AvatarIcon_Kaeya",
"UI_Gcg_Char_AvatarIcon_Kaveh",
"UI_Gcg_Char_AvatarIcon_Kazuha",
"UI_Gcg_Char_AvatarIcon_Keqing",
"UI_Gcg_Char_AvatarIcon_Klee",
"UI_Gcg_Char_AvatarIcon_Kokomi",
"UI_Gcg_Char_AvatarIcon_Layla",
"UI_Gcg_Char_AvatarIcon_Linette",
"UI_Gcg_Char_AvatarIcon_Liney",
"UI_Gcg_Char_AvatarIcon_Lisa",
"UI_Gcg_Char_AvatarIcon_Momoka",
"UI_Gcg_Char_AvatarIcon_Mona",
"UI_Gcg_Char_AvatarIcon_Nahida",
"UI_Gcg_Char_AvatarIcon_Neuvillette",
"UI_Gcg_Char_AvatarIcon_Nilou",
"UI_Gcg_Char_AvatarIcon_Ningguang",
"UI_Gcg_Char_AvatarIcon_Noel",
"UI_Gcg_Char_AvatarIcon_Qin",
"UI_Gcg_Char_AvatarIcon_Qiqi",
"UI_Gcg_Char_AvatarIcon_Razor",
"UI_Gcg_Char_AvatarIcon_Sara",
"UI_Gcg_Char_AvatarIcon_Sayu",
"UI_Gcg_Char_AvatarIcon_Shenhe",
"UI_Gcg_Char_AvatarIcon_Shinobu",
"UI_Gcg_Char_AvatarIcon_Shougun",
"UI_Gcg_Char_AvatarIcon_Sucrose",
"UI_Gcg_Char_AvatarIcon_Tartaglia",
"UI_Gcg_Char_AvatarIcon_Tighnari",
"UI_Gcg_Char_AvatarIcon_Tohma",
"UI_Gcg_Char_AvatarIcon_Venti",
"UI_Gcg_Char_AvatarIcon_Wanderer",
"UI_Gcg_Char_AvatarIcon_Wriothesley",
"UI_Gcg_Char_AvatarIcon_Xiangling",
"UI_Gcg_Char_AvatarIcon_Xiao",
"UI_Gcg_Char_AvatarIcon_Xingqiu",
"UI_Gcg_Char_AvatarIcon_Xinyan",
"UI_Gcg_Char_AvatarIcon_Yae",
"UI_Gcg_Char_AvatarIcon_Yaoyao",
"UI_Gcg_Char_AvatarIcon_Yelan",
"UI_Gcg_Char_AvatarIcon_Yoimiya",
"UI_Gcg_Char_AvatarIcon_Yunjin",
"UI_Gcg_Char_AvatarIcon_Zhongli",
"UI_Gcg_Char_MonsterIcon_Apep",
"UI_Gcg_Char_MonsterIcon_Bruterock",
"UI_Gcg_Char_MonsterIcon_ChrysopeleaSacred",
"UI_Gcg_Char_MonsterIcon_Dahaka",
"UI_Gcg_Char_MonsterIcon_DahakaElec",
"UI_Gcg_Char_MonsterIcon_DahakaFire",
"UI_Gcg_Char_MonsterIcon_DahakaIce",
"UI_Gcg_Char_MonsterIcon_DahakaWater",
"UI_Gcg_Char_MonsterIcon_Dvalin",
"UI_Gcg_Char_MonsterIcon_EffigyElectric",
"UI_Gcg_Char_MonsterIcon_EffigyIce",
"UI_Gcg_Char_MonsterIcon_EremiteOracle",
"UI_Gcg_Char_MonsterIcon_Fatuus",
"UI_Gcg_Char_MonsterIcon_FatuusMageIce",
"UI_Gcg_Char_MonsterIcon_FatuusSummoner",
"UI_Gcg_Char_MonsterIcon_Fungusgrass",
"UI_Gcg_Char_MonsterIcon_HermitCrabPrimo",
"UI_Gcg_Char_MonsterIcon_InvokerDeaconFire",
"UI_Gcg_Char_MonsterIcon_InvokerHeraldWater",
"UI_Gcg_Char_MonsterIcon_LaSignora",
"UI_Gcg_Char_MonsterIcon_LaSignoraHarbinger",
"UI_Gcg_Char_MonsterIcon_Maidenwater",
"UI_Gcg_Char_MonsterIcon_Ningyo",
"UI_Gcg_Char_MonsterIcon_Oceanid",
"UI_Gcg_Char_MonsterIcon_Ptahur",
"UI_Gcg_Char_MonsterIcon_Raijin",
"UI_Gcg_Char_MonsterIcon_ScorpionSacred",
"UI_Gcg_Char_MonsterIcon_SeaHorsePrimo",
"UI_Gcg_Char_MonsterIcon_SkirmisherWater",
"UI_Gcg_Char_MonsterIcon_SkirmisherWind",
"UI_Gcg_Debuff_Common_CostSkill",
"UI_Gcg_Debuff_Common_CostSwitch",
"UI_Gcg_Debuff_Common_Element_Elec",
Expand Down

0 comments on commit d1f99cf

Please sign in to comment.