From 1fd739fde4e6b1ab3cf785d9befee24db4ba56f9 Mon Sep 17 00:00:00 2001 From: Zzaphkiel Date: Fri, 15 Nov 2024 16:03:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=20OPGG=20build=20=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E7=AC=A6=E6=96=87=E5=B1=95=E7=A4=BA=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=A8=AA=E5=90=91=E9=97=B4=E8=B7=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/lol/tools.py | 8 +++++++- app/view/opgg_build_interface.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/lol/tools.py b/app/lol/tools.py index f972f0d..4e7a516 100644 --- a/app/lol/tools.py +++ b/app/lol/tools.py @@ -1541,7 +1541,9 @@ async def autoComplete(data, selection: ChampionSelection): if not isAutoCompleted or selection.isChampionPickedCompleted: return - localPlayerCellId = data['localPlayerCellId'] + if not (localPlayerCellId := data.get('localPlayerCellId', None)): + return + for actionGroup in reversed(data['actions']): for action in actionGroup: if action['actorCellId'] != localPlayerCellId: @@ -1669,6 +1671,10 @@ async def autoBan(data, selection: ChampionSelection): candidates.extend(cfg.get(cfg.autoBanChampion)) + bans = itertools.chain(data["bans"]['myTeamBans'], + data["bans"]['theirTeamBans']) + candidates = [x for x in candidates if x not in bans] + # 给队友一点预选的时间 await asyncio.sleep(cfg.get(cfg.autoBanDelay)) diff --git a/app/view/opgg_build_interface.py b/app/view/opgg_build_interface.py index 340ee71..65c424e 100644 --- a/app/view/opgg_build_interface.py +++ b/app/view/opgg_build_interface.py @@ -963,7 +963,7 @@ def __initLayout(self): self.shardsPerksLayout.addLayout(layout) self.gridLayout.setAlignment(Qt.AlignCenter) - self.gridLayout.setHorizontalSpacing(20) + self.gridLayout.setHorizontalSpacing(18) self.gridLayout.setContentsMargins(0, 0, 4, 4) self.gridLayout.addWidget( self.mainTitleIcon, 0, 0, alignment=Qt.AlignCenter)