void addHUDItem(float& x, D3DCOLOR color, char* text)
{
mainFont->Print(text, color, 1.0f + x, (float)GetSystemMetrics(SM_CYSCREEN) - 20);
(x) += mainFont->DrawLength(text);
}
void renderHUD()
{
float x = 0.0f;
char buf[MAX_PATH];
D3DCOLOR color_disabled = D3DCOLOR_ARGB(191, 255, 255, 255);
D3DCOLOR color_enabled = D3DCOLOR_ARGB(220, 44, 167, 212);
D3DCOLOR color_text = D3DCOLOR_ARGB(191, 255, 255, 255);
if (SF->getGame()->getCurrentState() == CHEAT_STATE_ACTOR)
{
if (set.hud_time_status)
{
SYSTEMTIME lt;
GetLocalTime(<);
sprintf(buf, "[%02d:%02d:%02d]", lt.wHour, lt.wMinute, lt.wSecond);
addHUDItem(x, color_text, buf);
}
addHUDItem(x, cheat_state_onfoot.inv ? color_enabled : color_disabled, " [Inv]");
addHUDItem(x, cheat_state_onfoot.airbrk ? color_enabled : color_disabled, " [AirBrk]");
addHUDItem(x, cheat_state_onfoot.fly ? color_enabled : color_disabled, " [Fly]");
addHUDItem(x, cheat_state_onfoot.fly ? color_enabled : color_disabled, " [Fly]");
//COORDS
sprintf(buf, " [%.2f, %.2f, %.2f]",
SF->getGame()->actorInfoGet(ACTOR_SELF, ACTOR_ALIVE)->base.matrix[4 * 3],
SF->getGame()->actorInfoGet(ACTOR_SELF, ACTOR_ALIVE)->base.matrix[4 * 3 + 1],
SF->getGame()->actorInfoGet(ACTOR_SELF, ACTOR_ALIVE)->base.matrix[4 * 3 + 2]);
addHUDItem(x, color_text, buf);
//FPS
sprintf(buf, " [FPS: %0.0f]", getFPS());
addHUDItem(x, color_text, buf);
}
else if (SF->getGame()->getCurrentState() == CHEAT_STATE_VEHICLE)
{
if (set.hud_time_status)
{
SYSTEMTIME lt;
GetLocalTime(<);
sprintf(buf, "[%02d:%02d:%02d]", lt.wHour, lt.wMinute, lt.wSecond);
addHUDItem(x, color_text, buf);
}
addHUDItem(x, cheat_state_vehicle.inv ? color_enabled : color_disabled, " [Inv]");
addHUDItem(x, cheat_state_vehicle.airbrk ? color_enabled : color_disabled, " [AirBrk]");
addHUDItem(x, cheat_state_vehicle.fly ? color_enabled : color_disabled, " [Fly]");
//COORDS
sprintf(buf, " [%.2f, %.2f, %.2f]",
SF->getGame()->vehicleInfoGet(VEHICLE_SELF, VEHICLE_TYPE_CAR)->base.matrix[4 * 3],
SF->getGame()->vehicleInfoGet(VEHICLE_SELF, VEHICLE_TYPE_CAR)->base.matrix[4 * 3 + 1],
SF->getGame()->vehicleInfoGet(VEHICLE_SELF, VEHICLE_TYPE_CAR)->base.matrix[4 * 3 + 2]);
addHUDItem(x, color_text, buf);
//FPS
sprintf(buf, " [FPS: %0.0f]", getFPS());
addHUDItem(x, color_text, buf);
}
}