mirror of
https://github.com/KimigaiiWuyi/GenshinUID.git
synced 2025-05-08 13:06:00 +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:
|
if _cost_pic is None:
|
||||||
cost_pic = get_unknown_png()
|
cost_pic = get_unknown_png()
|
||||||
else:
|
else:
|
||||||
cost_pic = _cost_pic.resize((64, 64))
|
cost_pic = _cost_pic.convert('RGBA').resize((64, 64))
|
||||||
|
|
||||||
if not cost_pos and material['materialtype'] == '武器突破素材':
|
if not cost_pos and material['materialtype'] == '武器突破素材':
|
||||||
pos = material['dropdomain']
|
pos = material['dropdomain']
|
||||||
|
@ -19,8 +19,10 @@ async def _get_assets(
|
|||||||
return Image.open(path)
|
return Image.open(path)
|
||||||
if type == 'AMBR':
|
if type == 'AMBR':
|
||||||
URL = AMBR_UI
|
URL = AMBR_UI
|
||||||
|
EURL = ENKA_UI
|
||||||
else:
|
else:
|
||||||
URL = ENKA_UI
|
URL = ENKA_UI
|
||||||
|
EURL = AMBR_UI
|
||||||
async with ClientSession() as sess:
|
async with ClientSession() as sess:
|
||||||
async with sess.get(URL.format(name)) as res:
|
async with sess.get(URL.format(name)) as res:
|
||||||
if res.status == 200:
|
if res.status == 200:
|
||||||
@ -29,7 +31,14 @@ async def _get_assets(
|
|||||||
await f.write(content)
|
await f.write(content)
|
||||||
return Image.open(BytesIO(content))
|
return Image.open(BytesIO(content))
|
||||||
else:
|
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]:
|
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