Add more stuff for discord rpc

This commit is contained in:
Grinch_ 2022-07-06 11:08:08 +06:00
parent 81e39ddfda
commit 3d8378419f
3 changed files with 18 additions and 45 deletions

View File

@ -383,6 +383,8 @@ DoingMission = "Doing mission"
Driving = "Driving" Driving = "Driving"
In = "in" In = "in"
InsideMenus = "Inside Menus" InsideMenus = "Inside Menus"
InsideInterior = "Inside interior"
OnRampage = "On rampage with cops"
PlayingFor = "Playing for {}:{}:{}" PlayingFor = "Playing for {}:{}:{}"
Walking = "Walking" Walking = "Walking"
Wasted = "Wasted!" Wasted = "Wasted!"

View File

@ -89,6 +89,11 @@ void RPC::Process()
#else #else
size_t wantedLevel = pPed->m_pWanted->m_nWantedLevel; size_t wantedLevel = pPed->m_pWanted->m_nWantedLevel;
#endif #endif
if (BY_GAME(Util::IsOnMission(), false, false))
{
stateText = TEXT("RPC.DoingMission");
}
if (wantedLevel > 0) if (wantedLevel > 0)
{ {
detailsText = std::format("{}: ", TEXT("Player.WantedLevel")); detailsText = std::format("{}: ", TEXT("Player.WantedLevel"));
@ -96,11 +101,21 @@ void RPC::Process()
{ {
detailsText += ""; detailsText += "";
} }
if (wantedLevel > 3)
{
stateText = TEXT("RPC.OnRampage");
}
} }
else else
{ {
detailsText = std::format("{}: ${}", TEXT("Player.Money"), pInfo->m_nMoney); 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)) 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())); 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()) if (CheatMenu::IsMenuShown())
{ {
stateText = TEXT("RPC.BrowsingCheatMenu"); stateText = TEXT("RPC.BrowsingCheatMenu");
} }
if (Command<Commands::IS_CHAR_DEAD>(CPools::GetPedRef(pPed))) if (Command<Commands::IS_CHAR_DEAD>(CPools::GetPedRef(pPed)))
{ {
stateText = TEXT("RPC.Wasted"); stateText = TEXT("RPC.Wasted");

View File

@ -107,46 +107,6 @@ static float LimitRadarPoint(CVector2D& point)
return 1.1f; 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 #elif GTAVC
#define TOTAL_WEATHERS 7 #define TOTAL_WEATHERS 7
#else #else