From 3d8378419f4a9d02b90257987f2aeeb0d92db20b Mon Sep 17 00:00:00 2001 From: Grinch_ Date: Wed, 6 Jul 2022 11:08:08 +0600 Subject: [PATCH] Add more stuff for discord rpc --- resource/common/locale/English.toml | 2 ++ src/rpc.cpp | 21 +++++++++++---- src/visual.cpp | 40 ----------------------------- 3 files changed, 18 insertions(+), 45 deletions(-) diff --git a/resource/common/locale/English.toml b/resource/common/locale/English.toml index 9198e7e..c5feb7c 100644 --- a/resource/common/locale/English.toml +++ b/resource/common/locale/English.toml @@ -383,6 +383,8 @@ DoingMission = "Doing mission" Driving = "Driving" In = "in" InsideMenus = "Inside Menus" +InsideInterior = "Inside interior" +OnRampage = "On rampage with cops" PlayingFor = "Playing for {}:{}:{}" Walking = "Walking" Wasted = "Wasted!" diff --git a/src/rpc.cpp b/src/rpc.cpp index d864431..ee359af 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -89,6 +89,11 @@ void RPC::Process() #else size_t wantedLevel = pPed->m_pWanted->m_nWantedLevel; #endif + if (BY_GAME(Util::IsOnMission(), false, false)) + { + stateText = TEXT("RPC.DoingMission"); + } + if (wantedLevel > 0) { detailsText = std::format("{}: ", TEXT("Player.WantedLevel")); @@ -96,11 +101,21 @@ void RPC::Process() { detailsText += "☆"; } + + if (wantedLevel > 3) + { + stateText = TEXT("RPC.OnRampage"); + } } else { detailsText = std::format("{}: ${}", TEXT("Player.Money"), pInfo->m_nMoney); } + + if (pPed->m_nAreaCode != 0) // world + { + stateText = TEXT("RPC.InsideInterior"); + } if (BY_GAME(pPed->m_nPedFlags.bInVehicle, pPed->m_bInVehicle, pPed->m_bInVehicle)) { @@ -115,16 +130,12 @@ void RPC::Process() smallImgText = std::format("{} {} {}", TEXT("RPC.Walking"), TEXT("RPC.In"), Util::GetLocationName(&pPed->GetPosition())); } - if (BY_GAME(Util::IsOnMission(), false, false)) - { - stateText = TEXT("RPC.DoingMission"); - } if (CheatMenu::IsMenuShown()) { stateText = TEXT("RPC.BrowsingCheatMenu"); } - + if (Command(CPools::GetPedRef(pPed))) { stateText = TEXT("RPC.Wasted"); diff --git a/src/visual.cpp b/src/visual.cpp index 0ae3a2a..ade70bc 100644 --- a/src/visual.cpp +++ b/src/visual.cpp @@ -107,46 +107,6 @@ static float LimitRadarPoint(CVector2D& point) return 1.1f; } -static double __cdecl LimitRadarPoint2(CVector2D *pos) -{ - float vroot = pos->Magnitude(); - if (FrontEndMenuManager.m_bDrawRadarOrMap) - { - return vroot; - } - - if (vroot > 1.0) - { - if (pos->x > -1.0 && pos->x < 1.0 && pos->y > -1.0 && pos->y < 1.0) - { - return 0.99; - } - - float posYd = pos->y * 57.295779513; - if (posYd > 45.0 || posYd <= -45.0) - { - pos->x = cos(posYd / 57.295779513) * sqrt(2); - if (posYd > 45.0 && posYd <= 135.0) - { - pos->y = 1.0; - return vroot; - } - if (posYd <= 135.0 && posYd > -135.0) - { - pos->y = -1.0; - return vroot; - } - pos->x = -1.0; - } - else - { - pos->x = 1.0; - } - pos->y = sin(posYd / 57.295779513) * sqrt(2); - } - - return vroot; -} #elif GTAVC #define TOTAL_WEATHERS 7 #else