mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
sync
This commit is contained in:
parent
798b483f09
commit
4a24afe8d6
@ -857,11 +857,10 @@ class hookselect(closeashidewindow):
|
|||||||
try:
|
try:
|
||||||
hc, hn, tp = key
|
hc, hn, tp = key
|
||||||
gobject.baseobject.textsource.usermanualaccepthooks.append(key)
|
gobject.baseobject.textsource.usermanualaccepthooks.append(key)
|
||||||
if key in gobject.baseobject.textsource.selectedhook:
|
gobject.baseobject.textsource.edit_selectedhook_remove(key)
|
||||||
gobject.baseobject.textsource.selectedhook.remove(key)
|
|
||||||
|
|
||||||
if select:
|
if select:
|
||||||
gobject.baseobject.textsource.selectedhook.append(key)
|
gobject.baseobject.textsource.edit_selectedhook_insert(key)
|
||||||
|
|
||||||
if hn[:8] == "UserHook":
|
if hn[:8] == "UserHook":
|
||||||
needinserthookcode = savehook_new_data[gobject.baseobject.gameuid][
|
needinserthookcode = savehook_new_data[gobject.baseobject.gameuid][
|
||||||
|
@ -168,6 +168,21 @@ class texthook(basetext):
|
|||||||
self.delaycollectallselectedoutput()
|
self.delaycollectallselectedoutput()
|
||||||
self.autohookmonitorthread()
|
self.autohookmonitorthread()
|
||||||
|
|
||||||
|
def edit_selectedhook_remove(self, key):
|
||||||
|
try:
|
||||||
|
self.selectedhook.remove(key)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
_, _, tp = key
|
||||||
|
self.Luna_SyncThread(tp, False)
|
||||||
|
|
||||||
|
def edit_selectedhook_insert(self, key, idx=-1):
|
||||||
|
if idx == -1:
|
||||||
|
idx = len(self.selectedhook)
|
||||||
|
self.selectedhook.insert(idx, key)
|
||||||
|
_, _, tp = key
|
||||||
|
self.Luna_SyncThread(tp, True)
|
||||||
|
|
||||||
def initdll(self):
|
def initdll(self):
|
||||||
LunaHost = CDLL(
|
LunaHost = CDLL(
|
||||||
gobject.GetDllpath(
|
gobject.GetDllpath(
|
||||||
@ -538,7 +553,7 @@ class texthook(basetext):
|
|||||||
insertindex = j
|
insertindex = j
|
||||||
else:
|
else:
|
||||||
insertindex = j + 1
|
insertindex = j + 1
|
||||||
self.selectedhook.insert(insertindex, key)
|
self.edit_selectedhook_insert(key, insertindex)
|
||||||
gobject.baseobject.hookselectdialog.addnewhooksignal.emit(
|
gobject.baseobject.hookselectdialog.addnewhooksignal.emit(
|
||||||
key, select, isembedable
|
key, select, isembedable
|
||||||
)
|
)
|
||||||
@ -627,7 +642,9 @@ class texthook(basetext):
|
|||||||
def delaycollectallselectedoutput(self):
|
def delaycollectallselectedoutput(self):
|
||||||
while not self.ending:
|
while not self.ending:
|
||||||
time.sleep(0.01)
|
time.sleep(0.01)
|
||||||
if time.time() < self.lastflushtime + self.config["textthreaddelay"] / 1000:
|
if time.time() < self.lastflushtime + min(
|
||||||
|
0.1, self.config["textthreaddelay"] / 1000
|
||||||
|
):
|
||||||
continue
|
continue
|
||||||
if len(self.multiselectedcollector) == 0:
|
if len(self.multiselectedcollector) == 0:
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user