diff --git a/LunaTranslator/LunaTranslator/gui/dialog_savedgame_common.py b/LunaTranslator/LunaTranslator/gui/dialog_savedgame_common.py index d4df19fb..9a637bb5 100644 --- a/LunaTranslator/LunaTranslator/gui/dialog_savedgame_common.py +++ b/LunaTranslator/LunaTranslator/gui/dialog_savedgame_common.py @@ -415,14 +415,21 @@ def getcachedimage(src, small): def getpixfunction(kk, small=False, iconfirst=False): if iconfirst: + if ( + savehook_new_data[kk].get("currenticon") + in savehook_new_data[kk]["imagepath_all"] + ): + src = savehook_new_data[kk].get("currenticon") + pix = getcachedimage(src, small) + if pix: + return pix _pix = getExeIcon(uid2gamepath[kk], False, cache=True) - if not _pix.toImage().allGray(): - return _pix + return _pix if ( - savehook_new_data[kk]["currentmainimage"] + savehook_new_data[kk].get("currentmainimage") in savehook_new_data[kk]["imagepath_all"] ): - src = savehook_new_data[kk]["currentmainimage"] + src = savehook_new_data[kk].get("currentmainimage") pix = getcachedimage(src, small) if pix: return pix diff --git a/LunaTranslator/LunaTranslator/gui/dialog_savedgame_v3.py b/LunaTranslator/LunaTranslator/gui/dialog_savedgame_v3.py index 5b2eb5f3..c4dd734d 100644 --- a/LunaTranslator/LunaTranslator/gui/dialog_savedgame_v3.py +++ b/LunaTranslator/LunaTranslator/gui/dialog_savedgame_v3.py @@ -94,8 +94,9 @@ class clickitem(QWidget): self.lay.setSpacing(0) size = globalconfig["dialog_savegame_layout"]["listitemheight"] margin = min(3, int(size / 15)) - self.lay.setContentsMargins(margin, margin, margin, margin) - + lay1 = QHBoxLayout() + lay1.setContentsMargins(margin, margin, margin, margin) + self.lay.setContentsMargins(0, 0, 0, 0) self.maskshowfileexists = QLabel(self) exists = os.path.exists(get_launchpath(uid)) self.maskshowfileexists.setObjectName("savegame_exists" + str(exists)) @@ -113,7 +114,8 @@ class clickitem(QWidget): icon = getpixfunction(uid, small=True, iconfirst=True) icon.setDevicePixelRatio(self.devicePixelRatioF()) _.setPixmap(icon) - self.lay.addWidget(_) + lay1.addWidget(_) + self.lay.addLayout(lay1) _ = QLabel(savehook_new_data[uid]["title"]) _.setWordWrap(True) _.setFixedHeight(size) @@ -571,12 +573,19 @@ class pixwrapper(QWidget): menu = QMenu(self) setimage = LAction(("设为封面")) + curr = savehook_new_data[self.k]["currentvisimage"] + curricon = savehook_new_data[self.k].get("currenticon") + if curr == curricon: + seticon = LAction(("还原图标")) + else: + seticon = LAction(("设为图标")) deleteimage = LAction(("删除图片")) deleteimage_x = LAction(("删除图片文件")) hualang = LAction(("画廊")) pos = LAction(("位置")) menu.addAction(setimage) + menu.addAction(seticon) menu.addAction(deleteimage) menu.addAction(deleteimage_x) menu.addAction(hualang) @@ -601,8 +610,12 @@ class pixwrapper(QWidget): ispathsedit=dict(), ) elif action == setimage: - curr = savehook_new_data[self.k]["currentvisimage"] savehook_new_data[self.k]["currentmainimage"] = curr + elif action == seticon: + if curr == curricon: + savehook_new_data[self.k].pop("currenticon") + else: + savehook_new_data[self.k]["currenticon"] = curr def switchpos(self, pos): globalconfig["viewlistpos"] = pos diff --git a/LunaTranslator/LunaTranslator/gui/specialwidget.py b/LunaTranslator/LunaTranslator/gui/specialwidget.py index 341c804b..46c3d2ef 100644 --- a/LunaTranslator/LunaTranslator/gui/specialwidget.py +++ b/LunaTranslator/LunaTranslator/gui/specialwidget.py @@ -594,6 +594,8 @@ class shownumQPushButton(QPushButton): def __init__(self, *arg, **kw): super().__init__(*arg, **kw) self.num = 0 + self.setCheckable(True) + self.clicked.connect(self.setChecked) def setnum(self, num): self.num = num @@ -616,6 +618,13 @@ class shownumQPushButton(QPushButton): str(self.num), ) + numberRect = rect.adjusted(10, 0, textRect.width() + -10, 0) + painter.drawText( + numberRect, + Qt.AlignmentFlag.AlignLeft | Qt.AlignmentFlag.AlignVCenter, + ("+", "-")[self.isChecked()], + ) + class shrinkableitem(QWidget): def __init__(self, p, shrinker: shownumQPushButton, opened): @@ -631,6 +640,7 @@ class shrinkableitem(QWidget): self.lay.addWidget(self.btn) self.lay.addWidget(self.items) self.items.setVisible(opened) + shrinker.setChecked(opened) self._ref_p_stackedlist = p def visheight(self): diff --git a/LunaTranslator/LunaTranslator/myutils/config.py b/LunaTranslator/LunaTranslator/myutils/config.py index 697e4404..2e3ab8c3 100644 --- a/LunaTranslator/LunaTranslator/myutils/config.py +++ b/LunaTranslator/LunaTranslator/myutils/config.py @@ -165,7 +165,8 @@ def getdefaultsavehook(title=None): # "isimagepathusersetted_much": False, "istitlesetted": False, "currentvisimage": None, - "currentmainimage": "", + # "currentmainimage": "", + # "currenticon": "", # "noundictconfig": [], "noundictconfig_ex": [], "noundict_use": False, diff --git a/LunaTranslator/files/defaultconfig/config.json b/LunaTranslator/files/defaultconfig/config.json index 6b064a52..f2f11e12 100644 --- a/LunaTranslator/files/defaultconfig/config.json +++ b/LunaTranslator/files/defaultconfig/config.json @@ -524,7 +524,7 @@ "itemh": 350, "margin": 10, "textH": 50, - "backcolor1": "#c38282", + "backcolor1": "#ffffff", "onselectcolor1": "#007fff", "onfilenoexistscolor1": "#acacac", "transparent": 25, diff --git a/LunaTranslator/files/lang/ar.json b/LunaTranslator/files/lang/ar.json index 2394c372..8bf63795 100644 --- a/LunaTranslator/files/lang/ar.json +++ b/LunaTranslator/files/lang/ar.json @@ -852,5 +852,7 @@ "prompt格式(需要根据模型版本决定)": "Prompt الشكل ( يجب أن تكون مصممة على أساس نموذج الإصدار )", "v0.10pre1(支持gpt词典)": "v0.10pre1 ( دعم GPT القاموس )", "输出的内容": "المحتوى الناتج", - "选取OCR范围时不透明度": "التعتيم عند اختيار مجموعة التعرف الضوئي على الحروف" + "选取OCR范围时不透明度": "التعتيم عند اختيار مجموعة التعرف الضوئي على الحروف", + "设为图标": "تعيين رمز", + "还原图标": "استعادة الرموز" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/cht.json b/LunaTranslator/files/lang/cht.json index 6fd526b3..d315b829 100644 --- a/LunaTranslator/files/lang/cht.json +++ b/LunaTranslator/files/lang/cht.json @@ -852,5 +852,7 @@ "prompt格式(需要根据模型版本决定)": "prompt 格式(需要根據模型版本決定)", "v0.10pre1(支持gpt词典)": "v0.10pre1(支援 gpt 詞典)", "输出的内容": "輸出的內容", - "选取OCR范围时不透明度": "選取OCR範圍時不透明度" + "选取OCR范围时不透明度": "選取OCR範圍時不透明度", + "设为图标": "設為圖標", + "还原图标": "還原圖標" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/cs.json b/LunaTranslator/files/lang/cs.json index 80b01b11..9fa1357e 100644 --- a/LunaTranslator/files/lang/cs.json +++ b/LunaTranslator/files/lang/cs.json @@ -852,5 +852,7 @@ "prompt格式(需要根据模型版本决定)": "Formát výzvy (v závislosti na verzi modelu)", "v0.10pre1(支持gpt词典)": "V0.10 pre1 (podporuje GPT slovník)", "输出的内容": "Výstupní obsah", - "选取OCR范围时不透明度": "Krytí při výběru rozsahu OCR" + "选取OCR范围时不透明度": "Krytí při výběru rozsahu OCR", + "设为图标": "Nastavit jako ikona", + "还原图标": "obnovit ikony" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/de.json b/LunaTranslator/files/lang/de.json index d45af154..0d4aeea8 100644 --- a/LunaTranslator/files/lang/de.json +++ b/LunaTranslator/files/lang/de.json @@ -852,5 +852,7 @@ "prompt格式(需要根据模型版本决定)": "Aufforderungsformat (abhängig von der Modellversion)", "v0.10pre1(支持gpt词典)": "V0.10 pre1 (unterstützt GPT Wörterbuch)", "输出的内容": "Ausgabeinhalt", - "选取OCR范围时不透明度": "Deckkraft bei Auswahl des OCR-Bereichs" + "选取OCR范围时不透明度": "Deckkraft bei Auswahl des OCR-Bereichs", + "设为图标": "Als Symbol festlegen", + "还原图标": "Symbole wiederherstellen" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/en.json b/LunaTranslator/files/lang/en.json index 0cf82831..ce74be0b 100644 --- a/LunaTranslator/files/lang/en.json +++ b/LunaTranslator/files/lang/en.json @@ -852,5 +852,7 @@ "prompt格式(需要根据模型版本决定)": "Prompt format (depending on the model version)", "v0.10pre1(支持gpt词典)": "V0.10 pre1 (supports GPT dictionary)", "输出的内容": "Output content", - "选取OCR范围时不透明度": "Opacity when selecting OCR range" + "选取OCR范围时不透明度": "Opacity when selecting OCR range", + "设为图标": "Set as icon", + "还原图标": "restore icons" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/es.json b/LunaTranslator/files/lang/es.json index ae9cb538..ea89dbfc 100644 --- a/LunaTranslator/files/lang/es.json +++ b/LunaTranslator/files/lang/es.json @@ -852,5 +852,7 @@ "prompt格式(需要根据模型版本决定)": "Formato prompt (debe decidirse en función de la versión del modelo)", "v0.10pre1(支持gpt词典)": "V0.10pre1 (admite diccionario gpt)", "输出的内容": "Contenido exportado", - "选取OCR范围时不透明度": "Opacidad al seleccionar el rango OCR" + "选取OCR范围时不透明度": "Opacidad al seleccionar el rango OCR", + "设为图标": "Establecer como icono", + "还原图标": "Restaurar iconos" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/fr.json b/LunaTranslator/files/lang/fr.json index 7dd940b7..c17dc1e9 100644 --- a/LunaTranslator/files/lang/fr.json +++ b/LunaTranslator/files/lang/fr.json @@ -852,5 +852,7 @@ "prompt格式(需要根据模型版本决定)": "Format prompt (à décider en fonction de la version du modèle)", "v0.10pre1(支持gpt词典)": "V0.10pre1 (support du dictionnaire GPT)", "输出的内容": "Contenu de la sortie", - "选取OCR范围时不透明度": "Opacité lorsque la plage OCR est sélectionnée" + "选取OCR范围时不透明度": "Opacité lorsque la plage OCR est sélectionnée", + "设为图标": "Faire une icône", + "还原图标": "Restaurer les icônes" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/it.json b/LunaTranslator/files/lang/it.json index d1299718..5d3c16c7 100644 --- a/LunaTranslator/files/lang/it.json +++ b/LunaTranslator/files/lang/it.json @@ -852,5 +852,7 @@ "prompt格式(需要根据模型版本决定)": "Formato di richiesta (a seconda della versione del modello)", "v0.10pre1(支持gpt词典)": "V0.10 pre1 (supporta il dizionario GPT)", "输出的内容": "Contenuto di output", - "选取OCR范围时不透明度": "Opacità durante la selezione dell'intervallo OCR" + "选取OCR范围时不透明度": "Opacità durante la selezione dell'intervallo OCR", + "设为图标": "Imposta come icona", + "还原图标": "ripristina icone" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/ja.json b/LunaTranslator/files/lang/ja.json index 48399b3b..4ee83fff 100644 --- a/LunaTranslator/files/lang/ja.json +++ b/LunaTranslator/files/lang/ja.json @@ -852,5 +852,7 @@ "prompt格式(需要根据模型版本决定)": "promptフォーマット(モデルバージョンに基づいて決定する必要がある)", "v0.10pre1(支持gpt词典)": "v 0.10 pre 1(gpt辞書対応)", "输出的内容": "出力の内容", - "选取OCR范围时不透明度": "OCR範囲選択時の不透明度" + "选取OCR范围时不透明度": "OCR範囲選択時の不透明度", + "设为图标": "アイコンとして設定", + "还原图标": "リストアアイコン" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/ko.json b/LunaTranslator/files/lang/ko.json index 350d80fa..1fdfa47a 100644 --- a/LunaTranslator/files/lang/ko.json +++ b/LunaTranslator/files/lang/ko.json @@ -852,5 +852,7 @@ "prompt格式(需要根据模型版本决定)": "prompt 형식 (모델 버전에 따라 결정)", "v0.10pre1(支持gpt词典)": "v0.10pre1(gpt 사전 지원)", "输出的内容": "내보낸 내용", - "选取OCR范围时不透明度": "OCR 범위 선택 시 불투명도" + "选取OCR范围时不透明度": "OCR 범위 선택 시 불투명도", + "设为图标": "아이콘으로 설정", + "还原图标": "복원 아이콘" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/nl.json b/LunaTranslator/files/lang/nl.json index 328ac25e..8870b19f 100644 --- a/LunaTranslator/files/lang/nl.json +++ b/LunaTranslator/files/lang/nl.json @@ -852,5 +852,7 @@ "prompt格式(需要根据模型版本决定)": "Prompt formaat (afhankelijk van de modelversie)", "v0.10pre1(支持gpt词典)": "V0.10 pre1 (ondersteunt GPT woordenboek)", "输出的内容": "Uitvoerinhoud", - "选取OCR范围时不透明度": "Opaciteit bij het selecteren van OCR-bereik" + "选取OCR范围时不透明度": "Opaciteit bij het selecteren van OCR-bereik", + "设为图标": "Als pictogram instellen", + "还原图标": "pictogrammen herstellen" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/pl.json b/LunaTranslator/files/lang/pl.json index 3ecb2a20..e28d8b5e 100644 --- a/LunaTranslator/files/lang/pl.json +++ b/LunaTranslator/files/lang/pl.json @@ -852,5 +852,7 @@ "prompt格式(需要根据模型版本决定)": "Format pytania (w zależności od wersji modelu)", "v0.10pre1(支持gpt词典)": "V0.10 pre1 (obsługuje słownik GPT)", "输出的内容": "Zawartość wyjściowa", - "选取OCR范围时不透明度": "Przezroczystość przy wyborze zakresu OCR" + "选取OCR范围时不透明度": "Przezroczystość przy wyborze zakresu OCR", + "设为图标": "Ustaw jako ikonę", + "还原图标": "przywróć ikony" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/pt.json b/LunaTranslator/files/lang/pt.json index e16b84b2..188eb143 100644 --- a/LunaTranslator/files/lang/pt.json +++ b/LunaTranslator/files/lang/pt.json @@ -852,5 +852,7 @@ "prompt格式(需要根据模型版本决定)": "Formato do pedido (dependendo da versão do modelo)", "v0.10pre1(支持gpt词典)": "V0. 10 pre1 (suporta dicionário GPT)", "输出的内容": "Conteúdo de saída", - "选取OCR范围时不透明度": "Opacidade ao seleccionar o intervalo OCR" + "选取OCR范围时不透明度": "Opacidade ao seleccionar o intervalo OCR", + "设为图标": "Definir como ícone", + "还原图标": "restaurar ícones" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/ru.json b/LunaTranslator/files/lang/ru.json index a691ad5b..7828dfb8 100644 --- a/LunaTranslator/files/lang/ru.json +++ b/LunaTranslator/files/lang/ru.json @@ -852,5 +852,7 @@ "prompt格式(需要根据模型版本决定)": "Формат prompt (должен быть определен в соответствии с версией модели)", "v0.10pre1(支持gpt词典)": "v0.10pre1 (Поддержка словаря gpt)", "输出的内容": "Экспорт содержимого", - "选取OCR范围时不透明度": "Непрозрачность выбора диапазона OCR" + "选取OCR范围时不透明度": "Непрозрачность выбора диапазона OCR", + "设为图标": "Установить значок", + "还原图标": "Восстановить значок" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/sv.json b/LunaTranslator/files/lang/sv.json index 3bdb3e08..d503721a 100644 --- a/LunaTranslator/files/lang/sv.json +++ b/LunaTranslator/files/lang/sv.json @@ -852,5 +852,7 @@ "prompt格式(需要根据模型版本决定)": "Frågaformat (beroende på modellversion)", "v0.10pre1(支持gpt词典)": "V0. 10 pre1 (stöder GPT ordbok)", "输出的内容": "Utdatainnehåll", - "选取OCR范围时不透明度": "Opacitet vid val av OCR-område" + "选取OCR范围时不透明度": "Opacitet vid val av OCR-område", + "设为图标": "Ange som ikon", + "还原图标": "återställ ikoner" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/th.json b/LunaTranslator/files/lang/th.json index 4fd8a5cb..0ad60af4 100644 --- a/LunaTranslator/files/lang/th.json +++ b/LunaTranslator/files/lang/th.json @@ -852,5 +852,7 @@ "prompt格式(需要根据模型版本决定)": "รูปแบบ prompt (ต้องตัดสินใจตามรุ่น)", "v0.10pre1(支持gpt词典)": "v0.10pre1 (สนับสนุนพจนานุกรม gpt)", "输出的内容": "เนื้อหาที่ส่งออก", - "选取OCR范围时不透明度": "ความทึบเมื่อเลือกช่วง OCR" + "选取OCR范围时不透明度": "ความทึบเมื่อเลือกช่วง OCR", + "设为图标": "ตั้งค่าเป็นไอคอน", + "还原图标": "เรียกคืนไอคอน" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/tr.json b/LunaTranslator/files/lang/tr.json index 59a68264..3b71a604 100644 --- a/LunaTranslator/files/lang/tr.json +++ b/LunaTranslator/files/lang/tr.json @@ -852,5 +852,7 @@ "prompt格式(需要根据模型版本决定)": "Soru format ı (model versiyonuna bağlı)", "v0.10pre1(支持gpt词典)": "V0. 10 pre1 (GPT sözlük destekliyor)", "输出的内容": "Çıkış içeriği", - "选取OCR范围时不透明度": "OCR menzilini seçerken meşgullük" + "选取OCR范围时不透明度": "OCR menzilini seçerken meşgullük", + "设为图标": "İşaretçi olarak ayarlayın", + "还原图标": "İşaretçikleri geri yükleyin" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/uk.json b/LunaTranslator/files/lang/uk.json index 5a3481cd..7501907c 100644 --- a/LunaTranslator/files/lang/uk.json +++ b/LunaTranslator/files/lang/uk.json @@ -852,5 +852,7 @@ "prompt格式(需要根据模型版本决定)": "Формат запиту (залежно від версії моделі)", "v0.10pre1(支持gpt词典)": "V0. 10 pre1 (підтримує словник GPT)", "输出的内容": "Вміст виводу", - "选取OCR范围时不透明度": "Непрозорість під час вибору діапазону OCR" + "选取OCR范围时不透明度": "Непрозорість під час вибору діапазону OCR", + "设为图标": "Встановити як піктограму", + "还原图标": "відновити піктограми" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/vi.json b/LunaTranslator/files/lang/vi.json index e3fd9575..5b6eaa1d 100644 --- a/LunaTranslator/files/lang/vi.json +++ b/LunaTranslator/files/lang/vi.json @@ -852,5 +852,7 @@ "prompt格式(需要根据模型版本决定)": "Định dạng prompt (cần được quyết định dựa trên phiên bản model)", "v0.10pre1(支持gpt词典)": "v0.10pre1 (hỗ trợ từ điển gpt)", "输出的内容": "Nội dung xuất", - "选取OCR范围时不透明度": "Độ mờ đục khi chọn phạm vi OCR" + "选取OCR范围时不透明度": "Độ mờ đục khi chọn phạm vi OCR", + "设为图标": "Đặt làm biểu tượng", + "还原图标": "Khôi phục biểu tượng" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/zh.json b/LunaTranslator/files/lang/zh.json index 43446627..b909a117 100644 --- a/LunaTranslator/files/lang/zh.json +++ b/LunaTranslator/files/lang/zh.json @@ -852,5 +852,10 @@ "prompt格式(需要根据模型版本决定)": "", "v0.10pre1(支持gpt词典)": "", "输出的内容": "", - "选取OCR范围时不透明度": "" + "选取OCR范围时不透明度": "", + "设为图标": "", + "还原图标": "", + "俺たちに翼はない ~Prelude~": "", + "俺たちに翼はない ―――under the innocent sky.": "", + "俺の名は~美少女と入れ替わったと思ったら巨根の男の娘になってしまった!?~": "" } \ No newline at end of file diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 2eaf6b3e..af4f1b55 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -29,7 +29,7 @@ include(generate_product_version) set(VERSION_MAJOR 5) set(VERSION_MINOR 34) -set(VERSION_PATCH 7) +set(VERSION_PATCH 8) add_library(pch pch.cpp) target_precompile_headers(pch PUBLIC pch.h)