fix

fix

Update specialwidget.py

Update dev_chatgpt.py

Update dev_chatgpt.py

Update static_data.json
This commit is contained in:
恍兮惚兮 2024-04-28 02:35:20 +08:00
parent 3b01a281ab
commit 7e19b3fc8b
22 changed files with 59 additions and 75 deletions

View File

@ -108,12 +108,6 @@ class ItemWidget(QWidget):
self.bottommask.resize(a0.size())
self.maskshowfileexists.resize(a0.size())
def settitle(self, text):
self._lb.setText(text)
def setimg(self, pixmap):
self._img.setimg(pixmap)
def __init__(self, exe, pixmap, file) -> None:
super().__init__()
self.itemw = globalconfig["dialog_savegame_layout"]["itemw"]
@ -144,7 +138,9 @@ class ItemWidget(QWidget):
wrap.addWidget(self._img)
layout.addWidget(_w)
self._lb = QLabel(file)
self._lb = QLabel()
if globalconfig["showgametitle"]:
self._lb.setText(file)
self._lb.setWordWrap(True)
self._lb.setAlignment(Qt.AlignCenter)
layout.addWidget(self._lb)
@ -1063,6 +1059,10 @@ class dialog_syssetting(QDialog):
QLabel(_TR("启动游戏不修改顺序")),
getsimpleswitch(globalconfig, "startgamenototop"),
)
formLayout.addRow(
QLabel(_TR("显示标题")),
getsimpleswitch(globalconfig, "showgametitle"),
)
self.show()

View File

@ -226,7 +226,7 @@ def setTabThree_lazy(self):
(self.fontSize_spinBox, 2),
"",
("额外的行间距", 3),
(getspinbox(0, 100, globalconfig, "extra_space"), 2),
(getspinbox(-100, 100, globalconfig, "extra_space"), 2),
],
[
("居中显示", 4),

View File

@ -150,20 +150,6 @@ class ScrollArea(QScrollArea):
self.scrolled.emit(visible_rect)
class lazynotify(QWidget):
def __init__(self, getrealwid) -> None:
super().__init__()
self.done = False
self.getrealwid = getrealwid
def do(self):
wid = self.getrealwid()
wid.setParent(self)
wid.adjustSize()
wid.setVisible(True)
class ScrollFlow(QWidget):
bgclicked = pyqtSignal()
@ -186,34 +172,9 @@ class ScrollFlow(QWidget):
self.listWidget.setLayout(self.l)
self.qscrollarea = ScrollArea(self)
self.qscrollarea = QScrollArea(self)
self.qscrollarea.setWidgetResizable(True)
self.qscrollarea.setWidget(self.listWidget)
self.qscrollarea.scrolled.connect(self.doshowlazywidget)
@trypass
def doshowlazywidget(self, region: QRect):
for i, widget in enumerate(self.lazyitems):
if i in self.lazydoneidx:
continue
widget_rect = widget.geometry() # 有可能已被delete必须try
# print(widget_rect)
if region.intersects(widget_rect):
# print(i,widget_rect)
self.lazydoneidx.append(i)
widget.do()
QApplication.processEvents()
def refreshscroll(self):
QApplication.processEvents()
self.doshowlazywidget(self.geometry())
@trypass
def addwidgetlazy(self, wid, size):
wid = lazynotify(wid)
self.lazyitems.append(wid)
wid.setFixedSize(size)
self.l.addWidget(wid)
@trypass
def addwidget(self, wid):
@ -358,15 +319,15 @@ class lazyscrollflow(QWidget):
self.qscrollarea = ScrollArea(self)
self.qscrollarea.setWidgetResizable(True)
self.qscrollarea.setWidget(self.internalwid)
self.qscrollarea.scrolled.connect(self.doshowlazywidget)
self.qscrollarea.scrolled.connect(lambda _: self.doshowlazywidget(True, _))
def resizeEvent(self, a0: QResizeEvent) -> None:
self.qscrollarea.resize(self.size())
self.resizeandshow()
self.resizeandshow(False)
return super().resizeEvent(a0)
@trypass
def doshowlazywidget(self, region: QRect):
def doshowlazywidget(self, procevent, region: QRect):
needdos = []
with self.lock:
for i, geo in enumerate(self.fakegeos):
@ -390,16 +351,16 @@ class lazyscrollflow(QWidget):
widfunc.setVisible(True)
widfunc.setGeometry(self.fakegeos[i])
self.widgets[i] = widfunc
QApplication.processEvents()
if procevent:
QApplication.processEvents() #会在最大化时死锁
except:
pass
@trypass
def resizeandshow(self):
def resizeandshow(self, procevent=True):
self.fakeresize()
self.doshowlazywidget(self.internalwid.visibleRegion())
self.doshowlazywidget(procevent, self.internalwid.visibleRegion())
def addwidget(self, widfunc):
self.insertwidget(-1, widfunc)

View File

@ -267,10 +267,12 @@ class QUnFrameWindow(resizableframeless):
)
else:
self.translate_text.append(text, hira, origin)
self.translate_text.append(
text, hira if globalconfig["isshowhira"] else [], origin
)
if globalconfig["zitiyangshi"] == 3:
self.translate_text.showyinyingtext(color)
if hira:
def callback(word):

View File

@ -24,6 +24,9 @@ class TS(basetransdev):
"th": "Thai",
}
def inittranslator(self):
self.currenttext = None
def getcurr(self, idx):
res = self.wait_for_result(
@ -53,11 +56,13 @@ class TS(basetransdev):
self.Runtime_evaluate(
r"""document.querySelector("#__next > div.relative.z-0.flex.h-full.w-full.overflow-hidden > div.relative.flex.h-full.max-w-full.flex-1.flex-col.overflow-hidden > main > div.flex.h-full.flex-col > div.w-full.pt-2.md\\:pt-0.dark\\:border-white\\/20.md\\:border-transparent.md\\:dark\\:border-transparent.md\\:w-\\[calc\\(100\\%-\\.5rem\\)\\] > form > div > div.flex.w-full.items-center > div > button").click()"""
)
self.currenttext = content
currtext = ""
while True:
while self.currenttext == content:
time.sleep(0.01) # get text before violate usage policies.
newcurr = self.getcurr(idx)
if newcurr == currtext:
continue
yield newcurr[len(currtext) :]
currtext = newcurr

View File

@ -131,6 +131,7 @@
"localeswitchmethod": 0,
"hide_not_exists":false,
"startgamenototop":true,
"showgametitle":true,
"extra_space":0,
"fonttype": "Arial",
"fonttype2": "Arial",

View File

@ -1,5 +1,5 @@
{
"version":"v2.46.0",
"version":"v2.46.1",
"themes":{
"dark":[
{"file":"dark1.qss","name":"PyQtDarkTheme"},

View File

@ -764,5 +764,6 @@
"右移": "حق التحول",
"启动游戏不修改顺序": "بدء اللعبة دون تعديل النظام",
"使用自定义优化": "استخدام التخصيص الأمثل",
"游戏管理": "إدارة الألعاب"
"游戏管理": "إدارة الألعاب",
"显示标题": "عرض العنوان"
}

View File

@ -764,5 +764,6 @@
"右移": "右移",
"启动游戏不修改顺序": "啟動遊戲不修改順序",
"使用自定义优化": "使用自定義優化",
"游戏管理": "遊戲管理"
"游戏管理": "遊戲管理",
"显示标题": "顯示標題"
}

View File

@ -764,5 +764,6 @@
"右移": "Right shift",
"启动游戏不修改顺序": "Start the game without changing the order",
"使用自定义优化": "Use custom optimization",
"游戏管理": "Game Management"
"游戏管理": "Game Management",
"显示标题": "show heading"
}

View File

@ -764,5 +764,6 @@
"右移": "A la derecha",
"启动游戏不修改顺序": "Iniciar el juego sin modificar el orden",
"使用自定义优化": "Usar optimizaciones personalizadas",
"游戏管理": "Gestión de juegos"
"游戏管理": "Gestión de juegos",
"显示标题": "Mostrar título"
}

View File

@ -764,5 +764,6 @@
"右移": "Déplacement à droite",
"启动游戏不修改顺序": "Lancer le jeu sans modifier l'ordre",
"使用自定义优化": "Utiliser l'optimisation personnalisée",
"游戏管理": "Gestion des jeux"
"游戏管理": "Gestion des jeux",
"显示标题": "Afficher le titre"
}

View File

@ -764,5 +764,6 @@
"右移": "Spostamento destro",
"启动游戏不修改顺序": "Inizia il gioco senza cambiare l'ordine",
"使用自定义优化": "Usa ottimizzazione personalizzata",
"游戏管理": "Gestione giochi"
"游戏管理": "Gestione giochi",
"显示标题": "mostra intestazione"
}

View File

@ -764,5 +764,6 @@
"右移": "右へ移動",
"启动游戏不修改顺序": "ゲームを起動しても順序は変更されません",
"使用自定义优化": "カスタム最適化の使用",
"游戏管理": "ゲーム管理"
"游戏管理": "ゲーム管理",
"显示标题": "タイトルを表示"
}

View File

@ -764,5 +764,6 @@
"右移": "오른쪽 이동",
"启动游戏不修改顺序": "게임을 시작하면 순서를 수정하지 않습니다.",
"使用自定义优化": "사용자 정의 최적화 사용",
"游戏管理": "게임 관리"
"游戏管理": "게임 관리",
"显示标题": "제목 표시"
}

View File

@ -764,5 +764,6 @@
"右移": "Prawa zmiana",
"启动游戏不修改顺序": "Rozpocznij grę bez zmiany kolejności",
"使用自定义优化": "Użyj niestandardowej optymalizacji",
"游戏管理": "Zarządzanie grą"
"游戏管理": "Zarządzanie grą",
"显示标题": "pokaż nagłówek"
}

View File

@ -764,5 +764,6 @@
"右移": "Направо.",
"启动游戏不修改顺序": "Запустить игру без изменения порядка",
"使用自定义优化": "Использовать пользовательскую оптимизацию",
"游戏管理": "Управление играми"
"游戏管理": "Управление играми",
"显示标题": "Показать заголовок"
}

View File

@ -764,5 +764,6 @@
"右移": "ย้ายขวา",
"启动游戏不修改顺序": "เริ่มเกมโดยไม่มีการปรับเปลี่ยนลำดับ",
"使用自定义优化": "ใช้การปรับแต่งให้เหมาะสม",
"游戏管理": "การจัดการเกม"
"游戏管理": "การจัดการเกม",
"显示标题": "แสดงหัวเรื่อง"
}

View File

@ -764,5 +764,6 @@
"右移": "Sağ değişiklik",
"启动游戏不修改顺序": "Düzeni değiştirmeden oyunu başlat",
"使用自定义优化": "Özel optimizasyon kullan",
"游戏管理": "Oyun Yönetimi"
"游戏管理": "Oyun Yönetimi",
"显示标题": "başlığı göster"
}

View File

@ -764,5 +764,6 @@
"右移": "Права зміна",
"启动游戏不修改顺序": "Почати гру без зміни порядку",
"使用自定义优化": "Використовувати нетипову оптимізацію",
"游戏管理": "Керування грами"
"游戏管理": "Керування грами",
"显示标题": "показувати заголовок"
}

View File

@ -764,5 +764,6 @@
"右移": "Dịch phải",
"启动游戏不修改顺序": "Bắt đầu trò chơi Không thay đổi thứ tự",
"使用自定义优化": "Sử dụng Custom Optimization",
"游戏管理": "Quản lý trò chơi"
"游戏管理": "Quản lý trò chơi",
"显示标题": "Hiện tiêu đề"
}

View File

@ -764,5 +764,6 @@
"右移": "",
"启动游戏不修改顺序": "",
"使用自定义优化": "",
"游戏管理": ""
"游戏管理": "",
"显示标题": ""
}