mirror of
https://github.com/xuthus83/LittlePaimon.git
synced 2024-12-16 13:40:53 +08:00
🐛 修复材料地图
,增加材料数单次上限
This commit is contained in:
parent
f875cf8611
commit
14a4fceb29
@ -159,6 +159,8 @@ async def _(event: MessageEvent, map_: str = Arg('map'), names=Arg('names')):
|
|||||||
if not freq_limiter.check(f'材料地图_{event.group_id if isinstance(event, GroupMessageEvent) else event.user_id}'):
|
if not freq_limiter.check(f'材料地图_{event.group_id if isinstance(event, GroupMessageEvent) else event.user_id}'):
|
||||||
await material_map_full.finish(f'材料地图查询冷却中,剩余{freq_limiter.left(f"材料地图_{event.group_id if isinstance(event, GroupMessageEvent) else event.user_id}")}秒', at_sender=True)
|
await material_map_full.finish(f'材料地图查询冷却中,剩余{freq_limiter.left(f"材料地图_{event.group_id if isinstance(event, GroupMessageEvent) else event.user_id}")}秒', at_sender=True)
|
||||||
freq_limiter.start(f'材料地图_{event.group_id if isinstance(event, GroupMessageEvent) else event.user_id}', 15)
|
freq_limiter.start(f'材料地图_{event.group_id if isinstance(event, GroupMessageEvent) else event.user_id}', 15)
|
||||||
|
if len(names) > 3:
|
||||||
|
names = names[:3]
|
||||||
await material_map_full.send(MessageBuild.Text(f'开始查找{"、".join(names)}的资源点,请稍候...'))
|
await material_map_full.send(MessageBuild.Text(f'开始查找{"、".join(names)}的资源点,请稍候...'))
|
||||||
result = await get_full_map(names, map_)
|
result = await get_full_map(names, map_)
|
||||||
await material_map_full.finish(result, at_sender=True)
|
await material_map_full.finish(result, at_sender=True)
|
||||||
|
@ -78,7 +78,7 @@ async def draw_map(name: str, map_: str):
|
|||||||
models.XYPoint(x1_temp, y1_temp),
|
models.XYPoint(x1_temp, y1_temp),
|
||||||
models.XYPoint(x2_temp, y2_temp),
|
models.XYPoint(x2_temp, y2_temp),
|
||||||
points)]
|
points)]
|
||||||
map_img = await load_image(RESOURCE_BASE_PATH / 'genshin_map' / 'results' / f'{map_id.name}.png')
|
map_img = (await load_image(RESOURCE_BASE_PATH / 'genshin_map' / 'results' / f'{map_id.name}.png')).copy()
|
||||||
lt_point = group_point[0][0]
|
lt_point = group_point[0][0]
|
||||||
rb_point = group_point[0][1]
|
rb_point = group_point[0][1]
|
||||||
map_img = map_img.crop((int(lt_point.x), int(lt_point.y), int(rb_point.x), int(rb_point.y)))
|
map_img = map_img.crop((int(lt_point.x), int(lt_point.y), int(rb_point.x), int(rb_point.y)))
|
||||||
@ -134,7 +134,7 @@ async def get_full_map(names: List[str], map_: str):
|
|||||||
resources_not.append(resource.name)
|
resources_not.append(resource.name)
|
||||||
if not resources_points:
|
if not resources_points:
|
||||||
return MessageBuild.Text(f'{map_}未查找到材料{"、".join(names)},请尝试其他地图')
|
return MessageBuild.Text(f'{map_}未查找到材料{"、".join(names)},请尝试其他地图')
|
||||||
map_img = await load_image(RESOURCE_BASE_PATH / 'genshin_map' / 'results' / f'{map_id.name}.png')
|
map_img = (await load_image(RESOURCE_BASE_PATH / 'genshin_map' / 'results' / f'{map_id.name}.png')).copy()
|
||||||
box_icon = await load_image(RESOURCE_BASE_PATH / 'genshin_map' / 'point_box.png')
|
box_icon = await load_image(RESOURCE_BASE_PATH / 'genshin_map' / 'point_box.png')
|
||||||
i = 0
|
i = 0
|
||||||
max_point = XYPoint(x=0, y=0)
|
max_point = XYPoint(x=0, y=0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user