| 55 | } |
| 56 | |
| 57 | void 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 | } |