| 215 | } |
| 216 | |
| 217 | void GeneralUtils::DisplayDamageNumberString(int damage, DamageDisplayType type, CoordStruct coords, int& offset) |
| 218 | { |
| 219 | if (damage == 0) |
| 220 | return; |
| 221 | |
| 222 | ColorStruct color; |
| 223 | |
| 224 | switch (type) |
| 225 | { |
| 226 | case DamageDisplayType::Regular: |
| 227 | color = damage > 0 ? ColorStruct { 255, 0, 0 } : ColorStruct { 0, 255, 0 }; |
| 228 | break; |
| 229 | case DamageDisplayType::Shield: |
| 230 | color = damage > 0 ? ColorStruct { 0, 160, 255 } : ColorStruct { 0, 255, 230 }; |
| 231 | break; |
| 232 | case DamageDisplayType::Intercept: |
| 233 | color = damage > 0 ? ColorStruct { 255, 128, 128 } : ColorStruct { 128, 255, 128 }; |
| 234 | break; |
| 235 | default: |
| 236 | break; |
| 237 | } |
| 238 | |
| 239 | int maxOffset = Unsorted::CellWidthInPixels / 2; |
| 240 | int width = 0, height = 0; |
| 241 | wchar_t damageStr[0x20]; |
| 242 | swprintf_s(damageStr, L"%d", damage); |
| 243 | |
| 244 | BitFont::Instance->GetTextDimension(damageStr, &width, &height, 120); |
| 245 | |
| 246 | if (offset >= maxOffset || offset == INT32_MIN) |
| 247 | offset = -maxOffset; |
| 248 | |
| 249 | FlyingStrings::Add(damageStr, coords, color, Point2D { offset - (width / 2), 0 }); |
| 250 | |
| 251 | offset = offset + width; |
| 252 | } |
| 253 | |
| 254 | DynamicVectorClass<ColorScheme*>* GeneralUtils::BuildPalette(const char* paletteFileName) |
| 255 | { |
nothing calls this directly
no outgoing calls
no test coverage detected