From 9503d22b6249273d664b04fe040370078321c2e1 Mon Sep 17 00:00:00 2001 From: kedou Date: Sat, 8 Aug 2026 13:50:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8F=AA=E8=AF=BB=20ESP=20?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Cheat/SDK/CContainer/CContainer.cpp | 2 +- CFramework/Cheat/SDK/CExfil/CExfil.cpp | 10 ++--- CFramework/Cheat/SDK/CItem/CItem.cpp | 2 +- CFramework/Cheat/UpdateList.cpp | 2 +- CFramework/Cheat/Visual.cpp | 41 +++++++++++++++++-- 5 files changed, 46 insertions(+), 11 deletions(-) diff --git a/CFramework/Cheat/SDK/CContainer/CContainer.cpp b/CFramework/Cheat/SDK/CContainer/CContainer.cpp index 8fe0e0c..17acf2d 100644 --- a/CFramework/Cheat/SDK/CContainer/CContainer.cpp +++ b/CFramework/Cheat/SDK/CContainer/CContainer.cpp @@ -31,7 +31,7 @@ bool CContainer::Update() } if (m_CName.empty()) - m_CName = "Container"; + m_CName = "容器"; return true; } diff --git a/CFramework/Cheat/SDK/CExfil/CExfil.cpp b/CFramework/Cheat/SDK/CExfil/CExfil.cpp index 9f7ad88..60d7bad 100644 --- a/CFramework/Cheat/SDK/CExfil/CExfil.cpp +++ b/CFramework/Cheat/SDK/CExfil/CExfil.cpp @@ -56,11 +56,11 @@ const char* GetExfilStatusText(const uint8_t status) noexcept { switch (status) { - case static_cast(CLOSE): return "Closed"; - case static_cast(NOTREADY): return "Not ready"; - case static_cast(OPEN): return "Open"; - case static_cast(READY): return "Ready"; - default: return "Unknown"; + case static_cast(CLOSE): return "已关闭"; + case static_cast(NOTREADY): return "等待中"; + case static_cast(OPEN): return "开启"; + case static_cast(READY): return "已准备"; + default: return "未知"; } } diff --git a/CFramework/Cheat/SDK/CItem/CItem.cpp b/CFramework/Cheat/SDK/CItem/CItem.cpp index c1b2530..dd17ef2 100644 --- a/CFramework/Cheat/SDK/CItem/CItem.cpp +++ b/CFramework/Cheat/SDK/CItem/CItem.cpp @@ -190,7 +190,7 @@ bool CItem::Update() // Keep a stable label even when a partially initialized loot object has no template metadata. if (m_CName.empty()) - m_CName = "Item"; + m_CName = "物品"; // Keep the legacy corpse check, but validate the chain through ReadChain's read-only checks. const uintptr_t nameAddr = m.ReadChain(address, { 0x0, 0x0, 0x48 }); diff --git a/CFramework/Cheat/UpdateList.cpp b/CFramework/Cheat/UpdateList.cpp index dfd5031..724d459 100644 --- a/CFramework/Cheat/UpdateList.cpp +++ b/CFramework/Cheat/UpdateList.cpp @@ -213,7 +213,7 @@ void CFramework::UpdateStaticList() exfil.m_pExfilName = exfil.GetName(); if (exfil.m_pExfilName.empty()) - exfil.m_pExfilName = "Exfil"; + exfil.m_pExfilName = "撤离点"; staticSnapshot->exfils.push_back(std::move(exfil)); } } diff --git a/CFramework/Cheat/Visual.cpp b/CFramework/Cheat/Visual.cpp index bbd9902..bebdf41 100644 --- a/CFramework/Cheat/Visual.cpp +++ b/CFramework/Cheat/Visual.cpp @@ -46,6 +46,41 @@ namespace } } + bool HasRuntimeDisplayName(const std::string& value, const char* fallback, + const char* legacyFallback) + { + return !value.empty() && value != fallback && value != legacyFallback; + } + + std::string GetChineseItemDisplayName(const CItem& item) + { + if (item.m_bIsCorpse) + return "尸体"; + if (HasRuntimeDisplayName(item.m_CName, "物品", "Item")) + return item.m_CName; + if (item.m_bIsQuestItem) + return "任务物品"; + + switch (item.m_iRarity) + { + case 2: return "稀有物品"; + case 3: return "超稀有物品"; + default: return "物品"; + } + } + + std::string GetChineseContainerDisplayName(const CContainer& container) + { + return HasRuntimeDisplayName(container.m_CName, "容器", "Container") ? + container.m_CName : "容器"; + } + + std::string GetChineseExfilDisplayName(const CExfil& exfil) + { + return HasRuntimeDisplayName(exfil.m_pExfilName, "撤离点", "Exfil") ? + exfil.m_pExfilName : "撤离点"; + } + ImColor GetExfilDisplayColor(const ExfilDisplayCategory category, const ImColor& closedColor, const ImColor& openColor, const ImColor& pendingColor, const ImColor& unknownColor) @@ -313,7 +348,7 @@ void CFramework::RenderESP() if (!WorldToScreen(viewMatrix, gameSize, item.m_vecOrigin, screen) || !InScreen(screen)) continue; - std::string text = item.m_bIsCorpse ? "Corpse" : item.m_CName; + std::string text = GetChineseItemDisplayName(item); text += " [" + std::to_string((int)distance) + "m]"; const ImColor itemColor = GetItemDisplayColor(item, Col_ESP_ItemQuest, Col_ESP_ItemCommon, Col_ESP_ItemRare, Col_ESP_ItemSuperRare, Col_ESP_Corpse); @@ -334,7 +369,7 @@ void CFramework::RenderESP() if (!WorldToScreen(viewMatrix, gameSize, container.m_vecOrigin, screen) || !InScreen(screen)) continue; - const std::string text = container.m_CName + " [" + std::to_string((int)distance) + "m]"; + const std::string text = GetChineseContainerDisplayName(container) + " [" + std::to_string((int)distance) + "m]"; ImGui::GetBackgroundDrawList()->AddCircleFilled(ImVec2(screen.x, screen.y - 2.f), 2.f, Col_ESP_Container, 0); String(ImVec2(screen.x - (ImGui::CalcTextSize(text.c_str()).x / 2.f), screen.y), Col_ESP_Container, text.c_str()); } @@ -352,7 +387,7 @@ void CFramework::RenderESP() const ImColor exfilColor = GetExfilDisplayColor(category, Col_ESP_ExfilClose, Col_ESP_ExfilOpen, Col_ESP_ExfilPending, Col_ESP_ExfilUnknown); const float distance = GetDistance(localPlayer.m_vecOrigin, exfil.m_pVecLocation); - const std::string text = exfil.m_pExfilName + " [" + GetExfilStatusText(exfil.m_pExfilStatus) + "] [" + + const std::string text = GetChineseExfilDisplayName(exfil) + " [" + GetExfilStatusText(exfil.m_pExfilStatus) + "] [" + std::to_string((int)distance) + "m]"; ImGui::GetBackgroundDrawList()->AddCircleFilled(ImVec2(screen.x, screen.y - 2.f), 2.f, exfilColor, 0); String(ImVec2(screen.x - (ImGui::CalcTextSize(text.c_str()).x / 2.f), screen.y), exfilColor, text.c_str());