From eab0a5d08f4160ab661e914c0dc97a6cafbea0d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Fri, 28 Jun 2024 06:27:35 +0800 Subject: [PATCH] fix --- .../LunaTranslator/gui/dialog_savedgame.py | 22 +++++++++++-------- .../files/defaultconfig/config.json | 1 + 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py index 7c1fbc27..e6152d35 100644 --- a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py +++ b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py @@ -2799,7 +2799,7 @@ class dialog_savedgame_v3(QWidget): self.simplebutton( "其他设置", False, lambda: dialog_syssetting(self, type_=2), False ) - + isfirst = True for i, tag in enumerate(savegametaged): # None # { @@ -2810,7 +2810,7 @@ class dialog_savedgame_v3(QWidget): title = "GLOBAL" lst = savehook_new_list tagid = None - opened = True + opened = globalconfig["global_list_opened"] else: lst = tag["games"] title = tag["title"] @@ -2825,11 +2825,14 @@ class dialog_savedgame_v3(QWidget): ): continue self.reallist[tagid].append(k) + if opened and isfirst and (rowreal == 0): + vis = True + isfirst = False + else: + vis = False group0.insertw( rowreal, - functools.partial( - self.delayitemcreater, k, i == 0 and rowreal == 0, tagid - ), + functools.partial(self.delayitemcreater, k, vis, tagid), 1 + globalconfig["dialog_savegame_layout"]["listitemheight"], ) @@ -2933,10 +2936,11 @@ class dialog_savedgame_v3(QWidget): def _revertoepn(self, tagid): item = savegametaged[calculatetagidx(tagid)] if item is None: - return - savegametaged[calculatetagidx(tagid)]["opened"] = not savegametaged[ - calculatetagidx(tagid) - ]["opened"] + globalconfig["global_list_opened"] = not globalconfig["global_list_opened"] + else: + savegametaged[calculatetagidx(tagid)]["opened"] = not savegametaged[ + calculatetagidx(tagid) + ]["opened"] def moverank(self, dx): uid = self.currentfocusuid diff --git a/LunaTranslator/files/defaultconfig/config.json b/LunaTranslator/files/defaultconfig/config.json index 668da668..294a65e9 100644 --- a/LunaTranslator/files/defaultconfig/config.json +++ b/LunaTranslator/files/defaultconfig/config.json @@ -11,6 +11,7 @@ "WindowBackdrop": 0, "WindowEffect": 0, "read_raw": true, + "global_list_opened": true, "read_trans": false, "read_translator": 0, "disappear_delay": 5,