This commit is contained in:
恍兮惚兮 2024-08-15 00:47:00 +08:00
parent 91cd3dfe5e
commit 2fdd5621ec
6 changed files with 21 additions and 12 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
LunaTranslator/userconfig
LunaTranslator/userconfig1
lunatranslator/cache
*.pyc

View File

@ -662,12 +662,13 @@ class MAINUI:
found = findgameuidofpath(pexe)
if found:
gameuid, reflist = found
if globalconfig["startgamenototop"] == False:
idx = reflist.index(gameuid)
reflist.insert(0, reflist.pop(idx))
else:
gameuid = find_or_create_uid(savehook_new_list, pexe, title)
reflist = savehook_new_list
if globalconfig["startgamenototop"] == False:
idx = reflist.index(gameuid)
reflist.insert(0, reflist.pop(idx))
savehook_new_list.insert(0, gameuid)
self.textsource = texthook(pids, hwnd, pexe, gameuid, autostart=False)
self.textsource.start()

View File

@ -383,7 +383,7 @@ class hookselect(closeashidewindow):
addnewhooksignal = pyqtSignal(tuple, bool)
getnewsentencesignal = pyqtSignal(str)
sysmessagesignal = pyqtSignal(str)
changeprocessclearsignal = pyqtSignal(dict)
changeprocessclearsignal = pyqtSignal()
removehooksignal = pyqtSignal(tuple)
getfoundhooksignal = pyqtSignal(dict)
update_item_new_line = pyqtSignal(tuple, str)
@ -444,7 +444,7 @@ class hookselect(closeashidewindow):
1, QHeaderView.ResizeMode.ResizeToContents
)
def changeprocessclear(self, config):
def changeprocessclear(self):
# self.ttCombo.clear()
self.ttCombomodelmodel.clear()
self.save = []

View File

@ -86,6 +86,8 @@ EmbedCallback = CFUNCTYPE(None, c_wchar_p, ThreadParam)
class texthook(basetext):
autofindpids = False
@property
def config(self):
if savehook_new_data[self.gameuid]["hooksetting_follow_default"]:
@ -135,7 +137,7 @@ class texthook(basetext):
self.pids = pids
self.is64bit = Is64bit(pids[0])
self.hwnd = hwnd
gobject.baseobject.hookselectdialog.changeprocessclearsignal.emit(self.config)
gobject.baseobject.hookselectdialog.changeprocessclearsignal.emit()
self.isremoveuseless = self.config["removeuseless"] and len(
self.autostarthookcode
)

View File

@ -53,6 +53,8 @@ class hwndchecker:
class basetext:
autofindpids = True
@property
def hwnd(self):
@ -65,14 +67,17 @@ class basetext:
if self.__hwnd:
self.__hwnd.end = True
self.__hwnd = None
self.pids = []
self.gameuid = None
self.md5 = "0"
self.basename = self.__basename
if self.autofindpids:
self.pids = []
self.gameuid = None
self.md5 = "0"
self.basename = self.__basename
if _hwnd:
self.__hwnd = hwndchecker(_hwnd, self)
if not self.autofindpids:
return
self.pids = [windows.GetWindowThreadProcessId(_hwnd)]
gameuid = findgameuidofpath(getpidexe(self.pids[0]))
if gameuid:

View File

@ -29,7 +29,7 @@ include(generate_product_version)
set(VERSION_MAJOR 5)
set(VERSION_MINOR 26)
set(VERSION_PATCH 9)
set(VERSION_PATCH 10)
add_library(pch pch.cpp)
target_precompile_headers(pch PUBLIC pch.h)