From e1c87aeb5c4299aa7f39256a38bcb2a668d211ee Mon Sep 17 00:00:00 2001 From: Ji O Date: Tue, 27 Dec 2022 23:05:02 +0900 Subject: [PATCH] Change the maximum number of characters to wrap with newlines --- src/hook.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/hook.cpp b/src/hook.cpp index 3d8843a..aa7585a 100644 --- a/src/hook.cpp +++ b/src/hook.cpp @@ -1430,6 +1430,21 @@ namespace reinterpret_cast(textcommon_awake_orig)(_this); } + void* textcommon_SetTextWithLineHeadWrap_orig = nullptr; + void textcommon_SetTextWithLineHeadWrap_hook(Il2CppObject* _this, Il2CppString* str, int maxCharacter) { + reinterpret_cast(textcommon_SetTextWithLineHeadWrap_orig)(_this, str, maxCharacter * 2); + } + + void* textcommon_SetTextWithLineHeadWrapWithColorTag_orig = nullptr; + void textcommon_SetTextWithLineHeadWrapWithColorTag_hook(Il2CppObject* _this, Il2CppString* str, int maxCharacter) { + reinterpret_cast(textcommon_SetTextWithLineHeadWrapWithColorTag_orig)(_this, str, maxCharacter * 2); + } + + void* textcommon_SetSystemTextWithLineHeadWrap_orig = nullptr; + void textcommon_SetSystemTextWithLineHeadWrap_hook(Il2CppObject* _this, Il2CppObject* systemText, int maxCharacter) { + reinterpret_cast(textcommon_SetSystemTextWithLineHeadWrap_orig)(_this, systemText, maxCharacter * 2); + } + void* TextMeshProUguiCommon_Awake_orig = nullptr; void TextMeshProUguiCommon_Awake_hook(Il2CppObject* _this) { @@ -2721,6 +2736,27 @@ namespace "TextMeshProUguiCommon", "Awake", 0 ); + auto textcommon_SetSystemTextWithLineHeadWrap_addr = reinterpret_cast( + il2cpp_symbols::get_method_pointer( + "umamusume.dll", "Gallop", + "TextCommon", "SetSystemTextWithLineHeadWrap", 2 + ) + ); + + auto textcommon_SetTextWithLineHeadWrapWithColorTag_addr = reinterpret_cast( + il2cpp_symbols::get_method_pointer( + "umamusume.dll", "Gallop", + "TextCommon", "SetTextWithLineHeadWrapWithColorTag", 2 + ) + ); + + auto textcommon_SetTextWithLineHeadWrap_addr = reinterpret_cast( + il2cpp_symbols::get_method_pointer( + "umamusume.dll", "Gallop", + "TextCommon", "SetTextWithLineHeadWrap", 2 + ) + ); + textcommon_get_TextId = reinterpret_cast(il2cpp_symbols::get_method_pointer( "umamusume.dll", "Gallop", "TextCommon", "get_TextId", 0 @@ -3121,6 +3157,10 @@ namespace // ADD_HOOK(text_get_text, "UnityEngine.UI.Text::get_text at %p\n"); + ADD_HOOK(textcommon_SetTextWithLineHeadWrap, "Gallop.TextCommon::SetTextWithLineHeadWrap at %p\n"); + ADD_HOOK(textcommon_SetTextWithLineHeadWrapWithColorTag, "Gallop.TextCommon::SetTextWithLineHeadWrapWithColorTag at %p\n"); + ADD_HOOK(textcommon_SetSystemTextWithLineHeadWrap, "Gallop.TextCommon::SetSystemTextWithLineHeadWrap at %p\n"); + ADD_HOOK(localizeextension_text, "Gallop.LocalizeExtention.Text(TextId) at %p\n"); // Looks like they store all localized texts that used by code in a dict ADD_HOOK(localize_get, "Gallop.Localize.Get(TextId) at %p\n");