mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-27 15:44:12 +08:00
sync
This commit is contained in:
parent
798b483f09
commit
4a24afe8d6
@ -857,11 +857,10 @@ class hookselect(closeashidewindow):
|
||||
try:
|
||||
hc, hn, tp = key
|
||||
gobject.baseobject.textsource.usermanualaccepthooks.append(key)
|
||||
if key in gobject.baseobject.textsource.selectedhook:
|
||||
gobject.baseobject.textsource.selectedhook.remove(key)
|
||||
gobject.baseobject.textsource.edit_selectedhook_remove(key)
|
||||
|
||||
if select:
|
||||
gobject.baseobject.textsource.selectedhook.append(key)
|
||||
gobject.baseobject.textsource.edit_selectedhook_insert(key)
|
||||
|
||||
if hn[:8] == "UserHook":
|
||||
needinserthookcode = savehook_new_data[gobject.baseobject.gameuid][
|
||||
|
@ -168,6 +168,21 @@ class texthook(basetext):
|
||||
self.delaycollectallselectedoutput()
|
||||
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):
|
||||
LunaHost = CDLL(
|
||||
gobject.GetDllpath(
|
||||
@ -538,7 +553,7 @@ class texthook(basetext):
|
||||
insertindex = j
|
||||
else:
|
||||
insertindex = j + 1
|
||||
self.selectedhook.insert(insertindex, key)
|
||||
self.edit_selectedhook_insert(key, insertindex)
|
||||
gobject.baseobject.hookselectdialog.addnewhooksignal.emit(
|
||||
key, select, isembedable
|
||||
)
|
||||
@ -627,7 +642,9 @@ class texthook(basetext):
|
||||
def delaycollectallselectedoutput(self):
|
||||
while not self.ending:
|
||||
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
|
||||
if len(self.multiselectedcollector) == 0:
|
||||
continue
|
||||
|
Loading…
x
Reference in New Issue
Block a user