mirror of
https://github.com/KimigaiiWuyi/GenshinUID.git
synced 2025-05-07 20:45:49 +08:00
🐛 修复武器介绍雾切
(#592)
This commit is contained in:
parent
5884ddbe4c
commit
b771e5916f
@ -195,7 +195,7 @@ async def draw_weapons_wiki_img(data: Weapon, stats: WeaponStats):
|
||||
if _cost_pic is None:
|
||||
cost_pic = get_unknown_png()
|
||||
else:
|
||||
cost_pic = _cost_pic.resize((64, 64))
|
||||
cost_pic = _cost_pic.convert('RGBA').resize((64, 64))
|
||||
|
||||
if not cost_pos and material['materialtype'] == '武器突破素材':
|
||||
pos = material['dropdomain']
|
||||
|
@ -19,8 +19,10 @@ async def _get_assets(
|
||||
return Image.open(path)
|
||||
if type == 'AMBR':
|
||||
URL = AMBR_UI
|
||||
EURL = ENKA_UI
|
||||
else:
|
||||
URL = ENKA_UI
|
||||
EURL = AMBR_UI
|
||||
async with ClientSession() as sess:
|
||||
async with sess.get(URL.format(name)) as res:
|
||||
if res.status == 200:
|
||||
@ -29,7 +31,14 @@ async def _get_assets(
|
||||
await f.write(content)
|
||||
return Image.open(BytesIO(content))
|
||||
else:
|
||||
return None
|
||||
async with sess.get(EURL.format(name)) as res:
|
||||
if res.status == 200:
|
||||
content = await res.read()
|
||||
async with aiofiles.open(path, 'wb') as f:
|
||||
await f.write(content)
|
||||
return Image.open(BytesIO(content))
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
async def get_assets_from_enka(name: str) -> Optional[Image.Image]:
|
||||
|
BIN
GenshinUID/utils/image/texture2d/unknown.png
Normal file
BIN
GenshinUID/utils/image/texture2d/unknown.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 691 B |
Loading…
x
Reference in New Issue
Block a user