MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / WhatUnitsDirect

Function WhatUnitsDirect

engine/Poseidon/Game/Chat.cpp:451–515  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

449 GEngine->DrawText(Point2DFloat(_x, top), _size, Rect2DFloat(_x, top, _w, _h), _font, color, line);
450 *line = 0;
451
452 row--;
453 if (row < 0)
454 {
455 return;
456 }
457 top -= _h;
458 }
459 }
460}
461
462void ChatList::GetSpeakingPlayers()
463{
464 AutoArray<NetVoiceSpeakerInfo, Poseidon::Foundation::MemAllocSA> activeSpeakers;
465 GetNetworkManager().GetVoiceSpeakers(activeSpeakers);
466
467 AutoArray<SpeakingIndication> speaking;
468 auto& testSpeakers = TestSpeakingIndications();
469 for (int i = 0; i < testSpeakers.Size(); i++)
470 {
471 SpeakingIndication item = testSpeakers[i];
472 item.lastSpeaking = Glob.uiTime;
473 speaking.Append() = item;
474 _lastSpeaking = Glob.uiTime;
475 }
476
477 for (int i = 0; i < activeSpeakers.Size(); i++)
478 {
479 const NetVoiceSpeakerInfo& speaker = activeSpeakers[i];
480 if (!speaker.active)
481 {
482 continue;
483 }
484
485 SpeakingIndication& item = speaking.Append();
486 const PlayerIdentity* identity = GetNetworkManager().FindIdentity(speaker.player);
487 item.name = identity ? identity->GetName() : Format("Player %d", speaker.player);
488 item.channel = VoNChatChannelToChatChannel(speaker.channel);
489 item.lastSpeaking = Glob.uiTime;
490 _lastSpeaking = Glob.uiTime;
491 }
492
493 for (int i = 0; i < speaking.Size(); i++)
494 {
495 const SpeakingIndication& item = speaking[i];
496 bool alreadyThere = false;
497 for (int j = 0; j < _speaking.Size(); j++)
498 {
499 SpeakingIndication& stable = _speaking[j];
500 if (strcmp(stable.name, item.name) == 0)
501 {
502 stable.lastSpeaking = item.lastSpeaking;
503 stable.channel = item.channel;
504 alreadyThere = true;
505 break;
506 }
507 }
508 if (!alreadyThere)

Callers 1

WhatUnitsFunction · 0.85

Calls 12

ObjRadiusRectangleFunction · 0.85
IsRemotePlayerMethod · 0.80
GetPersonMethod · 0.80
IsFreeSoldierMethod · 0.80
SquareFunction · 0.50
PositionMethod · 0.45
SizeMethod · 0.45
GetTypeMethod · 0.45
IsDammageDestroyedMethod · 0.45
CommanderUnitMethod · 0.45
Distance2Method · 0.45
AddMethod · 0.45

Tested by

no test coverage detected