mirror of
https://github.com/KimigaiiWuyi/GenshinUID.git
synced 2025-05-08 04:55:51 +08:00
🐛 修复命座图标错误和芙宁娜命座效果对调 (#671)
This commit is contained in:
parent
346dbe7aa4
commit
b79694dc11
@ -10,6 +10,7 @@ from PIL import Image, ImageDraw, ImageChops
|
||||
from .mono.Character import Character
|
||||
from ..genshinuid_config.gs_config import gsconfig
|
||||
from .etc.MAP_PATH import COLOR_MAP, avatarName2SkillAdd
|
||||
from ..utils.map.GS_MAP_PATH import CharId2TalentIcon_data
|
||||
from .etc.etc import TEXT_PATH, strLenth, get_artifacts_value
|
||||
from ..utils.image.image_tools import (
|
||||
CustomizeImage,
|
||||
@ -56,9 +57,13 @@ async def get_char_card_base(char: Character) -> Image.Image:
|
||||
if talent_num + 1 <= len(card_prop['talentList']):
|
||||
talent = card_prop['talentList'][talent_num]
|
||||
try:
|
||||
talent_img = Image.open(
|
||||
ICON_PATH / '{}.png'.format(talent['talentIcon'])
|
||||
)
|
||||
if char.char_id in CharId2TalentIcon_data:
|
||||
icon_name = CharId2TalentIcon_data[char.char_id][
|
||||
talent_num
|
||||
]
|
||||
else:
|
||||
icon_name = talent['talentIcon']
|
||||
talent_img = Image.open(ICON_PATH / f'{icon_name}.png')
|
||||
except Exception:
|
||||
talent_img = Image.open(
|
||||
ICON_PATH / 'UI_Talent_S_Kazuha_02.png'
|
||||
|
@ -903,11 +903,11 @@
|
||||
},
|
||||
"fight_talent": {
|
||||
"1": "",
|
||||
"2": "A:addDmg+30%hp",
|
||||
"2": "hp+140",
|
||||
"3": "",
|
||||
"4": "",
|
||||
"5": "",
|
||||
"6": "hp+140"
|
||||
"6": "A:addDmg+18%hp"
|
||||
},
|
||||
"group_skill": {
|
||||
"50": "",
|
||||
|
@ -19,6 +19,7 @@ from gsuid_core.utils.api.hakush.request import ( # noqa: E402
|
||||
)
|
||||
|
||||
from GenshinUID.utils.map.GS_MAP_PATH import ( # noqa: E402
|
||||
CharId2TalentIcon_fileName,
|
||||
mysData_fileName,
|
||||
charList_fileName,
|
||||
enName2Id_fileName,
|
||||
@ -559,11 +560,32 @@ async def save_all_char_data():
|
||||
json.dump(rdata, f, ensure_ascii=False)
|
||||
|
||||
|
||||
async def save_char_talent_num():
|
||||
print('正在执行save_char_talent_num')
|
||||
with open(MAP_PATH / charList_fileName, 'r', encoding='UTF-8') as f:
|
||||
charList = json.load(f)
|
||||
|
||||
result = {}
|
||||
for i in charList:
|
||||
with open(CHAR_PATH / f'{i}.json', 'r', encoding='UTF-8') as f:
|
||||
data = json.load(f)
|
||||
try:
|
||||
result[i] = [i['icon'] for i in data['constellation'].values()]
|
||||
except: # noqa: E722
|
||||
print(i)
|
||||
|
||||
with open(
|
||||
MAP_PATH / CharId2TalentIcon_fileName, 'w', encoding='UTF-8'
|
||||
) as f:
|
||||
json.dump(result, f, ensure_ascii=False)
|
||||
|
||||
|
||||
async def main():
|
||||
# await download_new_file()
|
||||
'''
|
||||
await download_new_file()
|
||||
await restore_mysData()
|
||||
await restore_hakush_data()
|
||||
# await monster2map()
|
||||
await monster2map()
|
||||
global raw_data
|
||||
try:
|
||||
with open(DATA_PATH / 'TextMapCHS.json', 'r', encoding='UTF-8') as f:
|
||||
@ -581,6 +603,8 @@ async def main():
|
||||
await avatarId2SkillGroupList()
|
||||
await save_all_weapon_data()
|
||||
await save_all_char_data()
|
||||
'''
|
||||
await save_char_talent_num()
|
||||
|
||||
|
||||
asyncio.run(main())
|
||||
|
@ -2,6 +2,7 @@ from pathlib import Path
|
||||
from typing import Dict, List, TypedDict
|
||||
|
||||
from msgspec import json as msgjson
|
||||
from gsuid_core.logger import logger
|
||||
|
||||
from ...version import Genshin_version
|
||||
|
||||
@ -24,6 +25,7 @@ avatarName2Weapon_fileName = f'avatarName2Weapon_mapping_{version}.json'
|
||||
monster2entry_fileName = f'monster2entry_mapping_{version}.json'
|
||||
avatarId2SkillList_fileName = f'avatarId2SkillList_mapping_{version}.json'
|
||||
weaponId2Name_fileName = f'weaponId2Name_mapping_{version}.json'
|
||||
CharId2TalentIcon_fileName = f'CharId2TalentIcon_mapping_{version}.json'
|
||||
mysData_fileName = f'mysData_{version}.json'
|
||||
|
||||
EXMonster_fileName = 'ExtraMonster.json'
|
||||
@ -36,79 +38,89 @@ class TS(TypedDict):
|
||||
Icon: Dict[str, str]
|
||||
|
||||
|
||||
with open(MAP / charList_fileName, 'r', encoding='UTF-8') as f:
|
||||
charList = msgjson.decode(f.read(), type=Dict)
|
||||
try:
|
||||
with open(MAP / charList_fileName, 'r', encoding='UTF-8') as f:
|
||||
charList = msgjson.decode(f.read(), type=Dict)
|
||||
|
||||
with open(MAP / weaponList_fileName, 'r', encoding='UTF-8') as f:
|
||||
weaponList = msgjson.decode(f.read(), type=Dict)
|
||||
with open(MAP / weaponList_fileName, 'r', encoding='UTF-8') as f:
|
||||
weaponList = msgjson.decode(f.read(), type=Dict)
|
||||
|
||||
with open(MAP / avatarId2Name_fileName, 'r', encoding='UTF-8') as f:
|
||||
avatarId2Name = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
with open(MAP / avatarId2Name_fileName, 'r', encoding='UTF-8') as f:
|
||||
avatarId2Name = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
|
||||
with open(MAP / icon2Name_fileName, 'r', encoding='UTF-8') as f:
|
||||
icon2Name = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
with open(MAP / icon2Name_fileName, 'r', encoding='UTF-8') as f:
|
||||
icon2Name = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
|
||||
with open(MAP / artifact2attr_fileName, 'r', encoding='UTF-8') as f:
|
||||
artifact2attr = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
with open(MAP / artifact2attr_fileName, 'r', encoding='UTF-8') as f:
|
||||
artifact2attr = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
|
||||
with open(MAP / icon2Name_fileName, 'r', encoding='UTF-8') as f:
|
||||
icon2Name = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
with open(MAP / icon2Name_fileName, 'r', encoding='UTF-8') as f:
|
||||
icon2Name = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
|
||||
with open(MAP / name2Icon_fileName, 'r', encoding='UTF-8') as f:
|
||||
name2Icon = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
with open(MAP / name2Icon_fileName, 'r', encoding='UTF-8') as f:
|
||||
name2Icon = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
|
||||
with open(MAP / 'propId2Name_mapping.json', 'r', encoding='UTF-8') as f:
|
||||
propId2Name = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
with open(MAP / 'propId2Name_mapping.json', 'r', encoding='UTF-8') as f:
|
||||
propId2Name = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
|
||||
with open(MAP / 'Id2propId_mapping.json', 'r', encoding='UTF-8') as f:
|
||||
Id2PropId = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
with open(MAP / 'Id2propId_mapping.json', 'r', encoding='UTF-8') as f:
|
||||
Id2PropId = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
|
||||
with open(MAP / weaponHash2Name_fileName, 'r', encoding='UTF-8') as f:
|
||||
weaponHash2Name = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
with open(MAP / weaponHash2Name_fileName, 'r', encoding='UTF-8') as f:
|
||||
weaponHash2Name = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
|
||||
with open(MAP / weaponHash2Type_fileName, 'r', encoding='UTF-8') as f:
|
||||
weaponHash2Type = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
with open(MAP / weaponHash2Type_fileName, 'r', encoding='UTF-8') as f:
|
||||
weaponHash2Type = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
|
||||
with open(MAP / 'artifactId2Piece_mapping.json', 'r', encoding='UTF-8') as f:
|
||||
artifactId2Piece = msgjson.decode(f.read(), type=Dict[str, List[str]])
|
||||
with open(
|
||||
MAP / 'artifactId2Piece_mapping.json', 'r', encoding='UTF-8'
|
||||
) as f:
|
||||
artifactId2Piece = msgjson.decode(f.read(), type=Dict[str, List[str]])
|
||||
|
||||
with open(MAP / skillId2Name_fileName, 'r', encoding='UTF-8') as f:
|
||||
skillId2Name = msgjson.decode(f.read(), type=TS)
|
||||
with open(MAP / skillId2Name_fileName, 'r', encoding='UTF-8') as f:
|
||||
skillId2Name = msgjson.decode(f.read(), type=TS)
|
||||
|
||||
with open(MAP / talentId2Name_fileName, 'r', encoding='UTF-8') as f:
|
||||
talentId2Name = msgjson.decode(f.read(), type=TS)
|
||||
with open(MAP / talentId2Name_fileName, 'r', encoding='UTF-8') as f:
|
||||
talentId2Name = msgjson.decode(f.read(), type=TS)
|
||||
|
||||
with open(MAP / avatarName2Element_fileName, 'r', encoding='UTF-8') as f:
|
||||
avatarName2Element = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
with open(MAP / avatarName2Element_fileName, 'r', encoding='UTF-8') as f:
|
||||
avatarName2Element = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
|
||||
with open(MAP / avatarName2Weapon_fileName, 'r', encoding='UTF-8') as f:
|
||||
avatarName2Weapon = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
with open(MAP / avatarName2Weapon_fileName, 'r', encoding='UTF-8') as f:
|
||||
avatarName2Weapon = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
|
||||
with open(MAP / 'char_alias.json', 'r', encoding='UTF-8') as f:
|
||||
alias_data = msgjson.decode(f.read(), type=Dict[str, List[str]])
|
||||
with open(MAP / 'char_alias.json', 'r', encoding='UTF-8') as f:
|
||||
alias_data = msgjson.decode(f.read(), type=Dict[str, List[str]])
|
||||
|
||||
with open(MAP / avatarId2Star_fileName, 'r', encoding='utf8') as f:
|
||||
avatarId2Star_data = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
with open(MAP / avatarId2Star_fileName, 'r', encoding='utf8') as f:
|
||||
avatarId2Star_data = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
|
||||
with open(MAP / avatarId2Star_fileName, 'r', encoding='utf8') as f:
|
||||
avatarId2Star_data = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
with open(MAP / avatarId2Star_fileName, 'r', encoding='utf8') as f:
|
||||
avatarId2Star_data = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
|
||||
with open(MAP / enName2Id_fileName, 'r', encoding='utf8') as f:
|
||||
enName_to_avatarId_data = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
with open(MAP / enName2Id_fileName, 'r', encoding='utf8') as f:
|
||||
enName_to_avatarId_data = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
|
||||
with open(MAP / EXMonster_fileName, 'r', encoding='utf8') as f:
|
||||
ex_monster_data = msgjson.decode(f.read(), type=Dict[str, Dict])
|
||||
with open(MAP / EXMonster_fileName, 'r', encoding='utf8') as f:
|
||||
ex_monster_data = msgjson.decode(f.read(), type=Dict[str, Dict])
|
||||
|
||||
with open(MAP / monster2entry_fileName, 'r', encoding='utf8') as f:
|
||||
monster2entry_data = msgjson.decode(f.read(), type=Dict[str, Dict])
|
||||
with open(MAP / monster2entry_fileName, 'r', encoding='utf8') as f:
|
||||
monster2entry_data = msgjson.decode(f.read(), type=Dict[str, Dict])
|
||||
|
||||
with open(MAP / avatarId2SkillList_fileName, 'r', encoding='utf8') as f:
|
||||
avatarId2SkillList_data = msgjson.decode(
|
||||
f.read(), type=Dict[str, Dict[str, str]]
|
||||
)
|
||||
with open(MAP / avatarId2SkillList_fileName, 'r', encoding='utf8') as f:
|
||||
avatarId2SkillList_data = msgjson.decode(
|
||||
f.read(), type=Dict[str, Dict[str, str]]
|
||||
)
|
||||
|
||||
with open(MAP / weaponId2Name_fileName, 'r', encoding='utf8') as f:
|
||||
weaponId2Name_data = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
with open(MAP / weaponId2Name_fileName, 'r', encoding='utf8') as f:
|
||||
weaponId2Name_data = msgjson.decode(f.read(), type=Dict[str, str])
|
||||
|
||||
with open(MAP / mysData_fileName, 'r', encoding='utf8') as f:
|
||||
mysData = msgjson.decode(f.read(), type=Dict)
|
||||
with open(MAP / mysData_fileName, 'r', encoding='utf8') as f:
|
||||
mysData = msgjson.decode(f.read(), type=Dict)
|
||||
|
||||
with open(MAP / CharId2TalentIcon_fileName, 'r', encoding='utf8') as f:
|
||||
CharId2TalentIcon_data = msgjson.decode(
|
||||
f.read(), type=Dict[str, List[str]]
|
||||
)
|
||||
except FileNotFoundError:
|
||||
logger.error('[GenshinUID] 未找到对应版本的映射文件')
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user