From 632bd88392c6f8e9704d2d27201884d6a71b6e5a 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: Sun, 14 Apr 2024 01:22:55 +0800 Subject: [PATCH] fix --- .../LunaTranslator/gui/dialog_savedgame.py | 27 +++++++++++++++++-- .../LunaTranslator/gui/specialwidget.py | 19 ++++++++++--- .../files/defaultconfig/config.json | 1 + LunaTranslator/files/lang/ar.json | 5 +++- LunaTranslator/files/lang/cht.json | 5 +++- LunaTranslator/files/lang/en.json | 5 +++- LunaTranslator/files/lang/es.json | 5 +++- LunaTranslator/files/lang/fr.json | 5 +++- LunaTranslator/files/lang/it.json | 5 +++- LunaTranslator/files/lang/ja.json | 5 +++- LunaTranslator/files/lang/ko.json | 5 +++- LunaTranslator/files/lang/pl.json | 5 +++- LunaTranslator/files/lang/ru.json | 5 +++- LunaTranslator/files/lang/th.json | 5 +++- LunaTranslator/files/lang/tr.json | 5 +++- LunaTranslator/files/lang/uk.json | 5 +++- LunaTranslator/files/lang/vi.json | 5 +++- LunaTranslator/files/lang/zh.json | 5 +++- 18 files changed, 102 insertions(+), 20 deletions(-) diff --git a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py index d79e0c7d..ff8b8300 100644 --- a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py +++ b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py @@ -1116,6 +1116,10 @@ class dialog_syssetting(QDialog): "imagewrapmode", ), ) + formLayout.addRow( + QLabel(_TR("启动游戏不修改顺序")), + getsimpleswitch(globalconfig, "startgamenototop"), + ) self.show() @@ -1446,8 +1450,9 @@ class TagWidget(QWidget): class dialog_savedgame_new(saveposwindow): def startgame(self, game): if os.path.exists(game): - idx = savehook_new_list.index(game) - savehook_new_list.insert(0, savehook_new_list.pop(idx)) + if globalconfig["startgamenototop"] == False: + idx = savehook_new_list.index(game) + savehook_new_list.insert(0, savehook_new_list.pop(idx)) self.close() startgame(game) @@ -1606,6 +1611,9 @@ class dialog_savedgame_new(saveposwindow): self.simplebutton("删除游戏", True, self.clicked2, False) self.simplebutton("打开目录", True, self.clicked4, True) + if globalconfig["startgamenototop"]: + self.simplebutton("左移", True, functools.partial(self.moverank, -1), False) + self.simplebutton("右移", True, functools.partial(self.moverank, 1), False) self.simplebutton("添加游戏", False, self.clicked3, 1) self.simplebutton("批量添加", False, self.clicked3_batch, 1) self.simplebutton("其他设置", False, lambda: dialog_syssetting(self), False) @@ -1635,6 +1643,21 @@ class dialog_savedgame_new(saveposwindow): self.__filter = WindowEventFilter() # keep ref self.installEventFilter(self.__filter) + def moverank(self, dx): + game = self.currentfocuspath + + idx1 = self.idxsave.index(game) + idx2 = (idx1 + dx) % len(self.idxsave) + game2 = self.idxsave[idx2] + self.idxsave[idx1], self.idxsave[idx2] = self.idxsave[idx2], self.idxsave[idx1] + self.flow.switchidx(idx1, idx2) + idx1 = savehook_new_list.index(game) + idx2 = savehook_new_list.index(game2) + savehook_new_list[idx1], savehook_new_list[idx2] = ( + savehook_new_list[idx2], + savehook_new_list[idx1], + ) + def showsettingdialog(self): try: dialog_setting_game(self.parent(), self.currentfocuspath) diff --git a/LunaTranslator/LunaTranslator/gui/specialwidget.py b/LunaTranslator/LunaTranslator/gui/specialwidget.py index d2257343..30d3e7dd 100644 --- a/LunaTranslator/LunaTranslator/gui/specialwidget.py +++ b/LunaTranslator/LunaTranslator/gui/specialwidget.py @@ -390,9 +390,9 @@ class lazyscrollflow(QWidget): widfunc.setVisible(True) widfunc.setGeometry(self.fakegeos[i]) self.widgets[i] = widfunc - + QApplication.processEvents() - + except: pass @@ -403,7 +403,20 @@ class lazyscrollflow(QWidget): def addwidget(self, widfunc): self.insertwidget(-1, widfunc) - + + @trypass + def switchidx(self, idx1, idx2): + with self.lock: + self.widgets[idx1], self.widgets[idx2] = ( + self.widgets[idx2], + self.widgets[idx1], + ) + self.fakegeos[idx1], self.fakegeos[idx2] = ( + self.fakegeos[idx2], + self.fakegeos[idx1], + ) + self.resizeandshow() + @trypass def insertwidget(self, idx, widfunc): refresh = True diff --git a/LunaTranslator/files/defaultconfig/config.json b/LunaTranslator/files/defaultconfig/config.json index c0b16261..dc981e9a 100644 --- a/LunaTranslator/files/defaultconfig/config.json +++ b/LunaTranslator/files/defaultconfig/config.json @@ -122,6 +122,7 @@ "fontsize": 17.0, "localeswitchmethod": 0, "hide_not_exists":false, + "startgamenototop":false, "extra_space":0, "fonttype": "Arial", "fonttype2": "Arial", diff --git a/LunaTranslator/files/lang/ar.json b/LunaTranslator/files/lang/ar.json index c64957aa..112d5136 100644 --- a/LunaTranslator/files/lang/ar.json +++ b/LunaTranslator/files/lang/ar.json @@ -760,5 +760,8 @@ "过滤": "تصفية", "备份路径": "مسار النسخ الاحتياطي", "存档备份": "أرشيف النسخ الاحتياطي", - "备份到": "النسخ الاحتياطي" + "备份到": "النسخ الاحتياطي", + "左移": "تحول اليسار", + "右移": "حق التحول", + "启动游戏不修改顺序": "بدء اللعبة دون تعديل النظام" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/cht.json b/LunaTranslator/files/lang/cht.json index a040e75a..331f21e6 100644 --- a/LunaTranslator/files/lang/cht.json +++ b/LunaTranslator/files/lang/cht.json @@ -760,5 +760,8 @@ "过滤": "過濾", "备份路径": "備份路徑", "存档备份": "存檔備份", - "备份到": "備份到" + "备份到": "備份到", + "左移": "左移", + "右移": "右移", + "启动游戏不修改顺序": "啟動遊戲不修改順序" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/en.json b/LunaTranslator/files/lang/en.json index 833929a2..57ddd523 100644 --- a/LunaTranslator/files/lang/en.json +++ b/LunaTranslator/files/lang/en.json @@ -760,5 +760,8 @@ "过滤": "filter", "备份路径": "Backup path", "存档备份": "Archive backup", - "备份到": "Back up to" + "备份到": "Back up to", + "左移": "Left shift", + "右移": "Right shift", + "启动游戏不修改顺序": "Start the game without changing the order" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/es.json b/LunaTranslator/files/lang/es.json index 88eb71c2..f279b4b8 100644 --- a/LunaTranslator/files/lang/es.json +++ b/LunaTranslator/files/lang/es.json @@ -760,5 +760,8 @@ "过滤": "Filtrar", "备份路径": "Ruta de respaldo", "存档备份": "Archivo de copias de Seguridad", - "备份到": "Copia de Seguridad a" + "备份到": "Copia de Seguridad a", + "左移": "Desplazamiento a la izquierda", + "右移": "A la derecha", + "启动游戏不修改顺序": "Iniciar el juego sin modificar el orden" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/fr.json b/LunaTranslator/files/lang/fr.json index bfc9588d..7878b604 100644 --- a/LunaTranslator/files/lang/fr.json +++ b/LunaTranslator/files/lang/fr.json @@ -760,5 +760,8 @@ "过滤": "Filtration", "备份路径": "Chemin de sauvegarde", "存档备份": "Sauvegarde archivée", - "备份到": "Sauvegarder à" + "备份到": "Sauvegarder à", + "左移": "Déplacement à gauche", + "右移": "Déplacement à droite", + "启动游戏不修改顺序": "Lancer le jeu sans modifier l'ordre" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/it.json b/LunaTranslator/files/lang/it.json index 3317a5f5..0f1261ee 100644 --- a/LunaTranslator/files/lang/it.json +++ b/LunaTranslator/files/lang/it.json @@ -760,5 +760,8 @@ "过滤": "filtro", "备份路径": "Percorso di backup", "存档备份": "Archivia backup", - "备份到": "Torna a" + "备份到": "Torna a", + "左移": "Spostamento sinistro", + "右移": "Spostamento destro", + "启动游戏不修改顺序": "Inizia il gioco senza cambiare l'ordine" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/ja.json b/LunaTranslator/files/lang/ja.json index acd9164a..b5f3a1d4 100644 --- a/LunaTranslator/files/lang/ja.json +++ b/LunaTranslator/files/lang/ja.json @@ -760,5 +760,8 @@ "过滤": "フィルタリング", "备份路径": "バックアップパス", "存档备份": "アーカイブバックアップ", - "备份到": "バックアップ先" + "备份到": "バックアップ先", + "左移": "左へ移動", + "右移": "右へ移動", + "启动游戏不修改顺序": "ゲームを起動しても順序は変更されません" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/ko.json b/LunaTranslator/files/lang/ko.json index 529b9b36..a323f9d3 100644 --- a/LunaTranslator/files/lang/ko.json +++ b/LunaTranslator/files/lang/ko.json @@ -760,5 +760,8 @@ "过滤": "필터링", "备份路径": "백업 경로", "存档备份": "아카이브 백업", - "备份到": "백업 대상" + "备份到": "백업 대상", + "左移": "왼쪽 이동", + "右移": "오른쪽 이동", + "启动游戏不修改顺序": "게임을 시작하면 순서를 수정하지 않습니다." } \ No newline at end of file diff --git a/LunaTranslator/files/lang/pl.json b/LunaTranslator/files/lang/pl.json index eef6c931..30d6f314 100644 --- a/LunaTranslator/files/lang/pl.json +++ b/LunaTranslator/files/lang/pl.json @@ -760,5 +760,8 @@ "过滤": "filtr", "备份路径": "Ścieżka kopii zapasowej", "存档备份": "Kopia zapasowa archiwum", - "备份到": "Powrót do" + "备份到": "Powrót do", + "左移": "Przesunięcie w lewo", + "右移": "Prawa zmiana", + "启动游戏不修改顺序": "Rozpocznij grę bez zmiany kolejności" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/ru.json b/LunaTranslator/files/lang/ru.json index 29eee08e..67a95fe3 100644 --- a/LunaTranslator/files/lang/ru.json +++ b/LunaTranslator/files/lang/ru.json @@ -760,5 +760,8 @@ "过滤": "Фильтр", "备份路径": "Путь к резервному копированию", "存档备份": "Архивное резервное копирование", - "备份到": "Резервное копирование" + "备份到": "Резервное копирование", + "左移": "Переместить налево", + "右移": "Направо.", + "启动游戏不修改顺序": "Запустить игру без изменения порядка" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/th.json b/LunaTranslator/files/lang/th.json index 671276e5..4b9f0d13 100644 --- a/LunaTranslator/files/lang/th.json +++ b/LunaTranslator/files/lang/th.json @@ -760,5 +760,8 @@ "过滤": "การกรอง", "备份路径": "เส้นทางการสำรองข้อมูล", "存档备份": "การสำรองข้อมูลที่เก็บถาวร", - "备份到": "สำรองข้อมูลไปยัง" + "备份到": "สำรองข้อมูลไปยัง", + "左移": "เลื่อนซ้าย", + "右移": "ย้ายขวา", + "启动游戏不修改顺序": "เริ่มเกมโดยไม่มีการปรับเปลี่ยนลำดับ" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/tr.json b/LunaTranslator/files/lang/tr.json index c23c9929..91ae8e77 100644 --- a/LunaTranslator/files/lang/tr.json +++ b/LunaTranslator/files/lang/tr.json @@ -760,5 +760,8 @@ "过滤": "filter", "备份路径": "Yedekleme yolu", "存档备份": "Arşiv yedekleme", - "备份到": "Geri dön." + "备份到": "Geri dön.", + "左移": "Sol vardiyası", + "右移": "Sağ değişiklik", + "启动游戏不修改顺序": "Düzeni değiştirmeden oyunu başlat" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/uk.json b/LunaTranslator/files/lang/uk.json index 13f52653..24fe49a1 100644 --- a/LunaTranslator/files/lang/uk.json +++ b/LunaTranslator/files/lang/uk.json @@ -760,5 +760,8 @@ "过滤": "фільтр", "备份路径": "Шлях до резервної копії", "存档备份": "Резервна копія архіву", - "备份到": "Назад до" + "备份到": "Назад до", + "左移": "Ліва зміна", + "右移": "Права зміна", + "启动游戏不修改顺序": "Почати гру без зміни порядку" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/vi.json b/LunaTranslator/files/lang/vi.json index 35c37bd9..89bf365f 100644 --- a/LunaTranslator/files/lang/vi.json +++ b/LunaTranslator/files/lang/vi.json @@ -760,5 +760,8 @@ "过滤": "Bộ lọc", "备份路径": "Đường dẫn sao lưu", "存档备份": "Lưu trữ sao lưu", - "备份到": "Sao lưu vào" + "备份到": "Sao lưu vào", + "左移": "Dịch trái", + "右移": "Dịch phải", + "启动游戏不修改顺序": "Bắt đầu trò chơi Không thay đổi thứ tự" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/zh.json b/LunaTranslator/files/lang/zh.json index 43a06eea..24fd7163 100644 --- a/LunaTranslator/files/lang/zh.json +++ b/LunaTranslator/files/lang/zh.json @@ -760,5 +760,8 @@ "过滤": "", "备份路径": "", "存档备份": "", - "备份到": "" + "备份到": "", + "左移": "", + "右移": "", + "启动游戏不修改顺序": "" } \ No newline at end of file