From ee11a477b388c26cc6db44b091e5c835f374b396 Mon Sep 17 00:00:00 2001 From: Zzaphkiel Date: Sat, 29 Jun 2024 15:31:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8F=8D=E5=A4=8D=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E6=90=9C=E7=B4=A2=E7=95=8C=E9=9D=A2=E6=97=B6=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F=E4=BC=9A=E4=B9=B1=E7=9A=84=E9=97=AE=E9=A2=98=20(#411)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/lol/tools.py | 2 -- app/view/search_interface.py | 15 +++++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/lol/tools.py b/app/lol/tools.py index 5f8d71c..0adcefd 100644 --- a/app/lol/tools.py +++ b/app/lol/tools.py @@ -1617,8 +1617,6 @@ def needResize(rect): targetWindowWidth = int(1280 * clientZoom) targetWindowHeight = int(720 * clientZoom) - print(targetWindowWidth, targetWindowHeight) - def patchDpiChangedMessage(hWnd): dpi = ctypes.windll.user32.GetDpiForWindow(hWnd) wParam = win32api.MAKELONG(dpi, dpi) diff --git a/app/view/search_interface.py b/app/view/search_interface.py index 6cdb9dd..8cb364c 100644 --- a/app/view/search_interface.py +++ b/app/view/search_interface.py @@ -1110,8 +1110,15 @@ async def searchAndShowFirstPage(self, puuid=None): self.gamesView.gameDetailView.clear() - # NOTE 如果是生涯和搜索反复横跳, 就不重新启loadgames任务了 + # NOTE 如果是生涯和搜索反复横跳, 就不重新启 loadgames 任务了 if puuid != self.puuid: + if self.gameLoadingTask: + self.gameLoadingTask.cancel() + + while not self.gameLoadingTask.cancelled() \ + and not self.gameLoadingTask.done(): + await asyncio.sleep(.2) + self.puuid = summoner['puuid'] self.gamesView.gamesTab.clear() @@ -1156,7 +1163,7 @@ def waitingForDrawSelect(self, gameId): # 如果在绘制前Tabs的StackWidget改变, 会导致画错框甚至找不到绘制对象 AttributeError # 必须保证绘制时界面没有被改变; (目前暂时是将耗时操作移到画框后面) # FIXME -- By Hpero4 - # 如果选中的对局不在第一页中(>11), 将不会画上选择框 + # 如果选中的对局不在第一页中(> 11), 将不会画上选择框 layout = tabs.stackWidget.widget(1).layout() for i in range(layout.count()): item = layout.itemAt(i) @@ -1182,15 +1189,15 @@ def waitingForDrawSelect(self, gameId): async def onSearchButtonClicked(self): if not await self.searchAndShowFirstPage(): return - self.filterComboBox.setCurrentIndex(0) # 将筛选条件回调至"全部" -- By Hpero4 + self.filterComboBox.setCurrentIndex(0) # 将筛选条件回调至"全部" -- By Hpero4 self.gamesView.gamesTab.clickFirstTab() async def __loadGames(self, puuid): begIdx = 20 endIdx = 29 - # NOTE 换了查询目标, 若之前正在查, 先等task被release掉 -- By Hpero4 + # NOTE 换了查询目标, 若之前正在查, 先等 task 被 release 掉 -- By Hpero4 while self.gameLoadingTask and not self.gameLoadingTask.done() and puuid != self.puuid: await asyncio.sleep(.2)