research tracker info in demo/hltv

-not sure if there's a demo verison that needs to be updated
This commit is contained in:
pierow 2023-08-22 22:28:24 -04:00
parent 93d134dca4
commit 60c4e0901c
2 changed files with 27 additions and 0 deletions

View file

@ -3162,6 +3162,9 @@ void AvHGamerules::UpdateHLTVProxy()
const HiveInfoListType tmp; const HiveInfoListType tmp;
NetMsg_AlienInfo_Hives( NULL, theTeamHiveInfo, tmp ); NetMsg_AlienInfo_Hives( NULL, theTeamHiveInfo, tmp );
ResearchInfoListType theTeamResearchInfo = this->mTeamA.GetResearchInfoList();
NetMsg_PlayHUDNotification_Research(NULL, 2, theTeamResearchInfo);
this->mTimeOfLastHLTVProxyUpdate = gpGlobals->time; this->mTimeOfLastHLTVProxyUpdate = gpGlobals->time;
} }
} }

View file

@ -4141,6 +4141,20 @@ int AvHHud::InitializeDemoPlayback(int inSize, unsigned char* inBuffer)
this->mHiveInfoList.push_back(theHiveInfo); this->mHiveInfoList.push_back(theHiveInfo);
} }
// Read in number of research infos
this->mResearchInfoList.clear();
int theNumResearchInfos = 0;
LoadData(&theNumResearchInfos, inBuffer, sizeof(int), theBytesRead);
// For each one, add a new research info
for (i = 0; i < theNumResearchInfos; i++)
{
AvHResearchInfo theResearchInfo;
LoadData(&theResearchInfo, inBuffer, sizeof(AvHResearchInfo), theBytesRead);
this->mResearchInfoList.push_back(theResearchInfo);
}
// Load and set current pie menu control // Load and set current pie menu control
int thePieMenuControlLength = 0; int thePieMenuControlLength = 0;
LoadData(&thePieMenuControlLength, inBuffer, sizeof(int), theBytesRead); LoadData(&thePieMenuControlLength, inBuffer, sizeof(int), theBytesRead);
@ -4253,6 +4267,9 @@ void AvHHud::InitializeDemoRecording()
int theNumHiveInfoRecords = (int)this->mHiveInfoList.size(); int theNumHiveInfoRecords = (int)this->mHiveInfoList.size();
int theHiveInfoSize = sizeof(int) + theNumHiveInfoRecords*sizeof(AvHHiveInfo); int theHiveInfoSize = sizeof(int) + theNumHiveInfoRecords*sizeof(AvHHiveInfo);
int theNumResearchInfoRecords = (int)this->mResearchInfoList.size();
int theResearchInfoSize = sizeof(int) + theNumResearchInfoRecords * sizeof(AvHResearchInfo);
string thePieMenuControl = gPieMenuHandler.GetPieMenuControl(); string thePieMenuControl = gPieMenuHandler.GetPieMenuControl();
int theCurrentPieMenuControlSize = sizeof(int) + (int)thePieMenuControl.size(); int theCurrentPieMenuControlSize = sizeof(int) + (int)thePieMenuControl.size();
@ -4282,6 +4299,13 @@ void AvHHud::InitializeDemoRecording()
SaveData(theCharArray, &(*theHiveInfoIter), sizeof(AvHHiveInfo), theCounter); SaveData(theCharArray, &(*theHiveInfoIter), sizeof(AvHHiveInfo), theCounter);
} }
// Write out num research info records
SaveData(theCharArray, &theNumResearchInfoRecords, sizeof(int), theCounter);
for (ResearchInfoListType::iterator theResearchInfoIter = this->mResearchInfoList.begin(); theResearchInfoIter != this->mResearchInfoList.end(); theResearchInfoIter++)
{
SaveData(theCharArray, &(*theResearchInfoIter), sizeof(AvHResearchInfo), theCounter);
}
// Save length of pie menu control name // Save length of pie menu control name
int thePieMenuControlNameLength = (int)thePieMenuControl.size(); int thePieMenuControlNameLength = (int)thePieMenuControl.size();
SaveData(theCharArray, &thePieMenuControlNameLength, sizeof(int), theCounter); SaveData(theCharArray, &thePieMenuControlNameLength, sizeof(int), theCounter);