From 0e90cd5414ac2c7ce22e500ef1a43fc12b87841d Mon Sep 17 00:00:00 2001 From: pierow Date: Tue, 22 Aug 2023 22:15:42 -0400 Subject: [PATCH] Parasite indicator on player names -Added indicator if looking at a parasited player -Changed commander parasited player indicator and color to always show, regardless if selected --- main/source/mod/AvHHud.cpp | 9 +++++++++ main/source/mod/AvHHudRender.cpp | 25 +++++++++++++------------ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/main/source/mod/AvHHud.cpp b/main/source/mod/AvHHud.cpp index a9735e88..c1798d2c 100644 --- a/main/source/mod/AvHHud.cpp +++ b/main/source/mod/AvHHud.cpp @@ -5408,6 +5408,15 @@ bool AvHHud::GetEntityInfoString(int inEntityID, string& outEntityInfoString, bo outEntityInfoString += string(theStatusCStr); } + // Do this client side so the extra chars don't need to be transmitted. Welder handled server side in UpdateStatusBar. + if (theEntity->curstate.team == theTeam) + { + if (GetHasUpgrade(theEntity->curstate.iuser4, MASK_PARASITED)) + { + outEntityInfoString += " [Parasited]"; + } + } + outIsEnemy = theIsEnemy; theSuccess = true; } diff --git a/main/source/mod/AvHHudRender.cpp b/main/source/mod/AvHHudRender.cpp index 66c8bae1..6fe4be79 100644 --- a/main/source/mod/AvHHudRender.cpp +++ b/main/source/mod/AvHHudRender.cpp @@ -696,24 +696,25 @@ void AvHHud::DrawPlayerNames() int theR, theG, theB; this->GetPrimaryHudColor(theR, theG, theB, true, false); - // If selected, draw in different color + // If selected or parasited, draw in different color if(inTopDownMode) { + if (GetHasUpgrade(theCurrentPlayer->curstate.iuser4, MASK_PARASITED)) + { + ////Old NS 3.2 method. Now in AvHHud::GetEntityInfoString. + //string thePrePendString; + //LocalizeString(kParasited, thePrePendString); + //theEntityName = string(theEntityName + " (" + thePrePendString + ")"); + + // Set color to parasited color + UnpackRGB(theR, theG, theB, RGB_MARINE_PARASITED); + } + bool theIsSelected = (std::find(this->mSelected.begin(), this->mSelected.end(), i) != this->mSelected.end()); - if(theIsSelected) + if (theIsSelected) { // Selected color UnpackRGB(theR, theG, theB, RGB_MARINE_SELECTED); - - if(GetHasUpgrade(theCurrentPlayer->curstate.iuser4, MASK_PARASITED)) - { - string thePrePendString; - LocalizeString(kParasited, thePrePendString); - theEntityName = string(theEntityName + " (" + thePrePendString + ")"); - - // Set color to parasited color - UnpackRGB(theR, theG, theB, RGB_MARINE_PARASITED); - } } }