This commit is contained in:
test123456654321 2024-10-25 16:57:02 +08:00
parent 81feb86bd0
commit 311a38a474
6 changed files with 10 additions and 17 deletions

View File

@ -62,7 +62,7 @@ include(generate_product_version)
set(VERSION_MAJOR 3) set(VERSION_MAJOR 3)
set(VERSION_MINOR 16) set(VERSION_MINOR 16)
set(VERSION_PATCH 0) set(VERSION_PATCH 1)
set(VERSION_REVISION 0) set(VERSION_REVISION 0)
if(BUILD_CORE) if(BUILD_CORE)

View File

@ -165,18 +165,11 @@ static std::wstring insertSpacesAfterUnencodableSTD(const std::wstring &text, Ho
} }
std::wstring adjustSpacesSTD(const std::wstring &text, HookParam hp) std::wstring adjustSpacesSTD(const std::wstring &text, HookParam hp)
{ {
if (hp.type & EMBED_INSERT_SPACE_ALWAYS)
switch (embedsharedmem->spaceadjustpolicy)
{
case 0:
return text;
case 1:
return alwaysInsertSpacesSTD(text); return alwaysInsertSpacesSTD(text);
case 2: else if (hp.type & EMBED_INSERT_SPACE_AFTER_UNENCODABLE)
return insertSpacesAfterUnencodableSTD(text, hp); return insertSpacesAfterUnencodableSTD(text, hp);
default:
return text; return text;
}
} }
bool isPauseKeyPressed() bool isPauseKeyPressed()
{ {

View File

@ -1786,7 +1786,7 @@ namespace
// return Private::oldHookFun = (Private::hook_fun_t)winhook::replace_fun(addr, (ULONG)Private::newHookFun); // return Private::oldHookFun = (Private::hook_fun_t)winhook::replace_fun(addr, (ULONG)Private::newHookFun);
HookParam hp; HookParam hp;
hp.address = addr; hp.address = addr;
hp.type = EMBED_ABLE | CODEC_UTF16; // 0x41 hp.type = EMBED_ABLE | CODEC_UTF16 | EMBED_INSERT_SPACE_AFTER_UNENCODABLE; // 0x41
hp.hook_before = Private::text_fun; hp.hook_before = Private::text_fun;
hp.hook_after = Private::hookafter; hp.hook_after = Private::hookafter;
hp.hook_font = F_GetGlyphOutlineW; hp.hook_font = F_GetGlyphOutlineW;
@ -1878,7 +1878,7 @@ namespace OtherHook
return false; return false;
HookParam hp; HookParam hp;
hp.address = addr; hp.address = addr;
hp.type = EMBED_ABLE | CODEC_UTF16; // 0x41 hp.type = EMBED_ABLE | CODEC_UTF16 | EMBED_INSERT_SPACE_AFTER_UNENCODABLE; // 0x41
hp.hook_before = Private::hookBefore; hp.hook_before = Private::hookBefore;
hp.hook_after = Private::hookafter2; hp.hook_after = Private::hookafter2;
hp.hook_font = F_GetGlyphOutlineW; hp.hook_font = F_GetGlyphOutlineW;

View File

@ -102,7 +102,7 @@ C_LUNA_API void Luna_FindHooks(DWORD pid, SearchParam sp, findhookcallback_t fin
wcscpy_s(hookcode,HOOKCODE_LEN, hp.hookcode); wcscpy_s(hookcode,HOOKCODE_LEN, hp.hookcode);
findhookcallback(hookcode,text.c_str()); }); findhookcallback(hookcode,text.c_str()); });
} }
C_LUNA_API void Luna_EmbedSettings(DWORD pid, UINT32 waittime, UINT8 fontCharSet, bool fontCharSetEnabled, wchar_t *fontFamily, UINT32 spaceadjustpolicy, UINT32 keeprawtext, bool fastskipignore) C_LUNA_API void Luna_EmbedSettings(DWORD pid, UINT32 waittime, UINT8 fontCharSet, bool fontCharSetEnabled, wchar_t *fontFamily, UINT32 keeprawtext, bool fastskipignore)
{ {
auto sm = Host::GetEmbedSharedMem(pid); auto sm = Host::GetEmbedSharedMem(pid);
if (!sm) if (!sm)
@ -111,7 +111,6 @@ C_LUNA_API void Luna_EmbedSettings(DWORD pid, UINT32 waittime, UINT8 fontCharSet
sm->fontCharSet = fontCharSet; sm->fontCharSet = fontCharSet;
sm->fontCharSetEnabled = fontCharSetEnabled; sm->fontCharSetEnabled = fontCharSetEnabled;
wcscpy_s(sm->fontFamily, 100, fontFamily); wcscpy_s(sm->fontFamily, 100, fontFamily);
sm->spaceadjustpolicy = spaceadjustpolicy;
sm->keeprawtext = keeprawtext; sm->keeprawtext = keeprawtext;
sm->fastskipignore = fastskipignore; sm->fastskipignore = fastskipignore;
} }

View File

@ -83,6 +83,8 @@ enum HookParamType : uint64_t
NEXT_MASK(EMBED_AFTER_NEW), NEXT_MASK(EMBED_AFTER_NEW),
NEXT_MASK(EMBED_AFTER_OVERWRITE), NEXT_MASK(EMBED_AFTER_OVERWRITE),
NEXT_MASK(EMBED_CODEC_UTF16), NEXT_MASK(EMBED_CODEC_UTF16),
NEXT_MASK(EMBED_INSERT_SPACE_ALWAYS),
NEXT_MASK(EMBED_INSERT_SPACE_AFTER_UNENCODABLE),
DECLARE_VALUE(NORMAL_INLINEHOOK, 0), DECLARE_VALUE(NORMAL_INLINEHOOK, 0),
NEXT_MASK(BREAK_POINT), NEXT_MASK(BREAK_POINT),

View File

@ -19,7 +19,6 @@ struct EmbedSharedMem
uint64_t ctx1[10]; uint64_t ctx1[10];
uint64_t ctx2[10]; uint64_t ctx2[10];
UINT32 waittime; UINT32 waittime;
UINT32 spaceadjustpolicy;
UINT32 keeprawtext; UINT32 keeprawtext;
uint64_t hash; uint64_t hash;
wchar_t text[1000]; wchar_t text[1000];