MCPcopy Create free account
hub / github.com/Phobos-developers/Phobos / UpdateAll

Method UpdateAll

src/Misc/FlyingStrings.cpp:57–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57void FlyingStrings::UpdateAll()
58{
59 if (Data.empty())
60 return;
61
62 for (int i = Data.size() - 1; i >= 0; --i)
63 {
64 auto& dataItem = Data[i];
65
66 auto [point, visible] = TacticalClass::Instance->CoordsToClient(dataItem.Location);
67
68 point += dataItem.PixelOffset;
69
70 RectangleStruct bound = DSurface::Temp->GetRect();
71 bound.Height -= 32;
72
73 if (Unsorted::CurrentFrame > dataItem.CreationFrame + Duration - 70)
74 {
75 point.Y -= (Unsorted::CurrentFrame - dataItem.CreationFrame);
76 DSurface::Temp->DrawText(dataItem.Text, &bound, &point, dataItem.Color, 0, TextPrintType::NoShadow);
77 }
78 else
79 {
80 DSurface::Temp->DrawText(dataItem.Text, &bound, &point, dataItem.Color, 0, TextPrintType::NoShadow);
81 }
82
83 if (Unsorted::CurrentFrame > dataItem.CreationFrame + Duration || Unsorted::CurrentFrame < dataItem.CreationFrame)
84 Data.erase(Data.begin() + i);
85 }
86}

Callers

nothing calls this directly

Calls 4

eraseMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected