diff --git a/data/update/TBoGT/common/data/frontend_menus.xml b/data/update/TBoGT/common/data/frontend_menus.xml index d94f6a3d..47a8b54b 100644 --- a/data/update/TBoGT/common/data/frontend_menus.xml +++ b/data/update/TBoGT/common/data/frontend_menus.xml @@ -1110,12 +1110,12 @@ + - + - + - @@ -1210,12 +1210,12 @@ + - diff --git a/data/update/common/data/frontend_menus.xml b/data/update/common/data/frontend_menus.xml index 1b0126ed..735a109e 100644 --- a/data/update/common/data/frontend_menus.xml +++ b/data/update/common/data/frontend_menus.xml @@ -780,12 +780,12 @@ + - @@ -808,12 +808,12 @@ + - diff --git a/external/hooking b/external/hooking index 62d4ff80..961c83cc 160000 --- a/external/hooking +++ b/external/hooking @@ -1 +1 @@ -Subproject commit 62d4ff80e4a9c587f75bc6eaf6325e2b140bde28 +Subproject commit 961c83cc26c49ba4d0d2c73b17cd85b2421caed2 diff --git a/shaders/GTAIV.EFLC.FusionShaders b/shaders/GTAIV.EFLC.FusionShaders index 8f84bef1..593496d4 160000 --- a/shaders/GTAIV.EFLC.FusionShaders +++ b/shaders/GTAIV.EFLC.FusionShaders @@ -1 +1 @@ -Subproject commit 8f84bef1a9640380230de8fa5efcc999baee91e2 +Subproject commit 593496d441e44466b3f53a5f4b88466d91151c46 diff --git a/source/extrainfo.ixx b/source/extrainfo.ixx index 4236be5d..6ecb5f60 100644 --- a/source/extrainfo.ixx +++ b/source/extrainfo.ixx @@ -42,15 +42,22 @@ public: extra = s; extra += L"~n~"; extra += L" "; - extra += L"~p~IMG Files: " + std::to_wstring(imgNum) + L" / " + std::to_wstring(imgArrSize); - if (imgNum >= imgArrSize) extra += L"; ~r~WARNING: 255 IMG limit exceeded, will cause streaming issues."; + + auto FF_WARN0 = CText::getText("FF_WARN0"); + extra += FF_WARN0[0] ? FF_WARN0 : L"~p~IMG Files: " + std::to_wstring(imgNum) + L" / " + std::to_wstring(imgArrSize); + auto FF_WARN1 = CText::getText("FF_WARN1"); + if (imgNum >= imgArrSize) extra += FF_WARN1[0] ? FF_WARN1 : L"; ~r~WARNING: 255 IMG limit exceeded, will cause streaming issues."; static auto LamppostShadows = FusionFixSettings.GetRef("PREF_LAMPPOSTSHADOWS"); if (LamppostShadows->get()) { extra += L"~n~"; extra += L" "; - extra += L"~r~WARNING: Lamppost shadows may cause visual artifacts and performance issues."; + auto FF_WARN2 = CText::getText("FF_WARN2"); + if (FF_WARN2[0]) + extra += FF_WARN2; + else + extra += L"~r~WARNING: Lamppost shadows may cause visual artifacts and performance issues."; } static auto ViewDistance = FusionFixSettings.GetRef("PREF_VIEW_DISTANCE"); @@ -59,12 +66,15 @@ public: { extra += L"~n~"; extra += L" "; + auto FF_WARN3 = CText::getText("FF_WARN3"); + auto FF_WARN4 = CText::getText("FF_WARN4"); + auto FF_WARN5 = CText::getText("FF_WARN5"); if (ViewDistance->get() > 24 && DetailQuality->get() > 30) - extra += L"~r~WARNING: View Distance slider above 25 and Detail Distance slider above 31 may cause object pop-in."; + extra += FF_WARN3[0] ? FF_WARN3 : L"~r~WARNING: View Distance slider above 25 and Detail Distance slider above 31 may cause object pop-in."; else if (ViewDistance->get() > 24) - extra += L"~r~WARNING: View Distance slider above 25 may cause object pop-in."; + extra += FF_WARN4[0] ? FF_WARN4 : L"~r~WARNING: View Distance slider above 25 may cause object pop-in."; else if (DetailQuality->get() > 30) - extra += L"~r~WARNING: Detail Distance slider above 31 may cause object pop-in."; + extra += FF_WARN5[0] ? FF_WARN5 : L"~r~WARNING: Detail Distance slider above 31 may cause object pop-in."; } regs.eax = (uintptr_t)extra.c_str(); diff --git a/source/settings.ixx b/source/settings.ixx index a0245731..1ac52029 100644 --- a/source/settings.ixx +++ b/source/settings.ixx @@ -15,44 +15,58 @@ import gxtloader; namespace CText { + using CText = void; + CText* g_text = nullptr; + + const wchar_t* (__fastcall* Get)(CText* text, void* edx, const char* key); + SafetyHookInline shGetText{}; - const wchar_t* __fastcall getText(void* g_text, void* edx, const char* key) + const wchar_t* __fastcall getText(CText* text, void* edx, const char* key) { auto hash = GetHash(key); if (gxtEntries.contains(hash)) return gxtEntries[hash].c_str(); - return shGetText.fastcall(g_text, edx, key); + return shGetText.fastcall(text, edx, key); } SafetyHookInline shGetTextByKey{}; - const wchar_t* __fastcall getTextByKey(void* g_text, void* edx, uint32_t hash, int a3) + const wchar_t* __fastcall getTextByKey(CText* text, void* edx, uint32_t hash, int a3) { if (gxtEntries.contains(hash)) return gxtEntries[hash].c_str(); - return shGetTextByKey.fastcall(g_text, edx, hash, a3); + return shGetTextByKey.fastcall(text, edx, hash, a3); } SafetyHookInline shDoesTextLabelExist{}; - char __fastcall doesTextLabelExist(void* g_text, void* edx, const char* key) + char __fastcall doesTextLabelExist(CText* text, void* edx, const char* key) { if (gxtEntries.contains(GetHash(key))) return 1; - return shDoesTextLabelExist.fastcall(g_text, edx, key); + return shDoesTextLabelExist.fastcall(text, edx, key); + } + + export const wchar_t* getText(const char* key) + { + return Get(g_text, nullptr, key); } void Hook() { - //auto pattern = find_pattern("83 EC 44 A1 ? ? ? ? 33 C4 89 44 24 40 8B 44 24 48 56 8B F1", "83 EC 44 A1 ? ? ? ? 33 C4 89 44 24 40 8B 44 24 48 85 C0"); - //CText::shGetText = safetyhook::create_inline(pattern.get_first(), CText::getText); + auto pattern = find_pattern("B9 ? ? ? ? E8 ? ? ? ? 50 8D 84 24 ? ? ? ? 50 E8 ? ? ? ? 83 C4 0C", "B9 ? ? ? ? E8 ? ? ? ? 50 8D 84 24 ? ? ? ? 68 ? ? ? ? 50 BA ? ? ? ? E8 ? ? ? ? 83 C4 14"); + g_text = *pattern.get_first(1); + + pattern = find_pattern("83 EC 44 A1 ? ? ? ? 33 C4 89 44 24 40 8B 44 24 48 56 8B F1", "83 EC 44 A1 ? ? ? ? 33 C4 89 44 24 40 8B 44 24 48 85 C0"); + Get = *pattern.get_first(0); + //shGetText = safetyhook::create_inline(pattern.get_first(), getText); - auto pattern = find_pattern("83 EC 48 A1 ? ? ? ? 33 C4 89 44 24 44 53 55", "83 EC 48 A1 ? ? ? ? 33 C4 89 44 24 44 53 55"); - shGetTextByKey = safetyhook::create_inline(pattern.get_first(), CText::getTextByKey); + pattern = find_pattern("83 EC 48 A1 ? ? ? ? 33 C4 89 44 24 44 53 55", "83 EC 48 A1 ? ? ? ? 33 C4 89 44 24 44 53 55"); + shGetTextByKey = safetyhook::create_inline(pattern.get_first(), getTextByKey); pattern = find_pattern("51 8B 44 24 08 53 8B D9 C6 44 24", "51 8B 44 24 08 85 C0 53 8B D9"); - CText::shDoesTextLabelExist = safetyhook::create_inline(pattern.get_first(), CText::doesTextLabelExist); + shDoesTextLabelExist = safetyhook::create_inline(pattern.get_first(), doesTextLabelExist); } } diff --git a/text/americanFF.txt b/text/americanFF.txt index be1ff2bb..f16bdf37 100644 --- a/text/americanFF.txt +++ b/text/americanFF.txt @@ -82,8 +82,11 @@ Tree Alpha [Shadow Filter] Shadow Filter +[FF_WARN0] +~p~IMG Files: + [FF_WARN1] -~r~WARNING: 255 IMG limit exceeded, will cause streaming issues. +; ~r~WARNING: 255 IMG limit exceeded, will cause streaming issues. [FF_WARN2] ~r~WARNING: Lamppost shadows may cause visual artifacts and performance issues.