//==================================================================================================== // // Name: [entWatch] Interface // Author: zaCade & Prometheum // Description: Handle the interface of [entWatch] // //==================================================================================================== #include #pragma newdecls required #include #include //---------------------------------------------------------------------------------------------------- // Purpose: //---------------------------------------------------------------------------------------------------- public Plugin myinfo = { name = "[entWatch] Interface", author = "zaCade & Prometheum", description = "Handle the interface of [entWatch]", version = "4.0.0" }; //---------------------------------------------------------------------------------------------------- // Purpose: //---------------------------------------------------------------------------------------------------- public void OnGameFrame() { if (EW_GetItemCount()) { char sHUDFormat[255]; char sHUDBuffer[64]; for (int index; index < EW_GetItemCount(); index++) { CItem item = EW_GetItemData(index); if (item.dConfig.bDisplayInterface && item.bClient) { char sItemShort[32]; item.dConfig.GetShort(sItemShort, sizeof(sItemShort)); switch(item.dConfig.iMode) { case MODE_COOLDOWN: { if (item.iTimeReady > RoundToCeil(GetEngineTime())) { Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%d]: %N", sItemShort, item.iTimeReady - RoundToCeil(GetEngineTime()), item.iClient); } else { Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%s]: %N", sItemShort, "R", item.iClient); } } case MODE_MAXUSES: { if (item.iTimesUsed < item.dConfig.iMaxUses) { Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%d/%d]: %N", sItemShort, item.iTimesUsed, item.dConfig.iMaxUses, item.iClient); } else { Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%s]: %N", sItemShort, "D", item.iClient); } } case MODE_COOLDOWNMAXUSES: { if (item.iTimesUsed < item.dConfig.iMaxUses) { if (item.iTimeReady > RoundToCeil(GetEngineTime())) { Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%d]: %N", sItemShort, item.iTimeReady - RoundToCeil(GetEngineTime()), item.iClient); } else { Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%d/%d]: %N", sItemShort, item.iTimesUsed, item.dConfig.iMaxUses, item.iClient); } } else { Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%s]: %N", sItemShort, "D", item.iClient); } } case MODE_COOLDOWNCHARGES: { if (item.iTimeReady > RoundToCeil(GetEngineTime())) { Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%d]: %N", sItemShort, item.iTimeReady - RoundToCeil(GetEngineTime()), item.iClient); } else { Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%d/%d]: %N", sItemShort, item.iTimesUsed, item.dConfig.iMaxUses, item.iClient); } } default: { Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%s]: %N", sItemShort, "N/A", item.iClient); } } if (strlen(sHUDFormat) + strlen(sHUDBuffer) < sizeof(sHUDFormat)) { Format(sHUDFormat, sizeof(sHUDFormat), "%s\n%s", sHUDFormat, sHUDBuffer); } else break; } } Handle hMessage = StartMessageAll("KeyHintText"); BfWriteByte(hMessage, 1); BfWriteString(hMessage, sHUDFormat); EndMessage(); } }