entWatch: Rework interface code, fix translations in messages.
This commit is contained in:
parent
87877c0adc
commit
4a826805fe
@ -28,91 +28,90 @@ public Plugin myinfo =
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public void OnGameFrame()
|
||||
{
|
||||
/* if (EW_GetItemCount())
|
||||
if (EW_GetItemCount())
|
||||
{
|
||||
char sHUDFormat[250];
|
||||
char sHUDFormat[255];
|
||||
char sHUDBuffer[64];
|
||||
|
||||
for (int index; index < EW_GetItemCount(); index++)
|
||||
{
|
||||
any itemArray[items];
|
||||
EW_GetItemArray(index, itemArray, sizeof(itemArray));
|
||||
CItem item = EW_GetItemData(index);
|
||||
|
||||
if (itemArray[item_display] & DISPLAY_HUD)
|
||||
if (item.dConfig.bDisplayInterface && item.bOwner)
|
||||
{
|
||||
if (itemArray[item_owned] && itemArray[item_owner] >= 0)
|
||||
{
|
||||
switch(itemArray[item_mode])
|
||||
char sItemShort[32];
|
||||
item.dConfig.GetShort(sItemShort, sizeof(sItemShort));
|
||||
|
||||
switch(item.dConfig.iMode)
|
||||
{
|
||||
case MODE_COOLDOWN:
|
||||
{
|
||||
if (itemArray[item_nextuse] > RoundToCeil(GetEngineTime()))
|
||||
if (item.iTimeReady > RoundToCeil(GetEngineTime()))
|
||||
{
|
||||
Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%d]: %N", itemArray[item_short], itemArray[item_nextuse] - RoundToCeil(GetEngineTime()), itemArray[item_owner]);
|
||||
Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%d]: %N", sItemShort, item.iTimeReady - RoundToCeil(GetEngineTime()), item.iOwner);
|
||||
}
|
||||
else
|
||||
{
|
||||
Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%s]: %N", itemArray[item_short], "R", itemArray[item_owner]);
|
||||
Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%s]: %N", sItemShort, "R", item.iOwner);
|
||||
}
|
||||
}
|
||||
case MODE_MAXUSES:
|
||||
{
|
||||
if (itemArray[item_uses] < itemArray[item_maxuses])
|
||||
if (item.iTimesUsed < item.dConfig.iMaxUses)
|
||||
{
|
||||
Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%d/%d]: %N", itemArray[item_short], itemArray[item_uses], itemArray[item_maxuses], itemArray[item_owner]);
|
||||
Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%d/%d]: %N", sItemShort, item.iTimesUsed, item.dConfig.iMaxUses, item.iOwner);
|
||||
}
|
||||
else
|
||||
{
|
||||
Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%s]: %N", itemArray[item_short], "D", itemArray[item_owner]);
|
||||
Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%s]: %N", sItemShort, "D", item.iOwner);
|
||||
}
|
||||
}
|
||||
case MODE_COOLDOWNMAXUSES:
|
||||
{
|
||||
if (itemArray[item_uses] < itemArray[item_maxuses])
|
||||
if (item.iTimesUsed < item.dConfig.iMaxUses)
|
||||
{
|
||||
if (itemArray[item_nextuse] > RoundToCeil(GetEngineTime()))
|
||||
if (item.iTimeReady > RoundToCeil(GetEngineTime()))
|
||||
{
|
||||
Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%d]: %N", itemArray[item_short], itemArray[item_nextuse] - RoundToCeil(GetEngineTime()), itemArray[item_owner]);
|
||||
Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%d]: %N", sItemShort, item.iTimeReady - RoundToCeil(GetEngineTime()), item.iOwner);
|
||||
}
|
||||
else
|
||||
{
|
||||
Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%d/%d]: %N", itemArray[item_short], itemArray[item_uses], itemArray[item_maxuses], itemArray[item_owner]);
|
||||
Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%d/%d]: %N", sItemShort, item.iTimesUsed, item.dConfig.iMaxUses, item.iOwner);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%s]: %N", itemArray[item_short], "D", itemArray[item_owner]);
|
||||
Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%s]: %N", sItemShort, "D", item.iOwner);
|
||||
}
|
||||
}
|
||||
case MODE_COOLDOWNCHARGES:
|
||||
{
|
||||
if (itemArray[item_nextuse] > RoundToCeil(GetEngineTime()))
|
||||
if (item.iTimeReady > RoundToCeil(GetEngineTime()))
|
||||
{
|
||||
Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%d]: %N", itemArray[item_short], itemArray[item_nextuse] - RoundToCeil(GetEngineTime()), itemArray[item_owner]);
|
||||
Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%d]: %N", sItemShort, item.iTimeReady - RoundToCeil(GetEngineTime()), item.iOwner);
|
||||
}
|
||||
else
|
||||
{
|
||||
Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%d/%d]: %N", itemArray[item_short], itemArray[item_uses], itemArray[item_maxuses], itemArray[item_owner]);
|
||||
Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%d/%d]: %N", sItemShort, item.iTimesUsed, item.dConfig.iMaxUses, item.iOwner);
|
||||
}
|
||||
}
|
||||
default:
|
||||
{
|
||||
Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%s]: %N", itemArray[item_short], "N/A", itemArray[item_owner]);
|
||||
Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%s]: %N", sItemShort, "N/A", item.iOwner);
|
||||
}
|
||||
}
|
||||
|
||||
if (strlen(sHUDFormat) + strlen(sHUDBuffer) <= sizeof(sHUDFormat) - 2)
|
||||
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();
|
||||
}*/
|
||||
}
|
||||
}
|
@ -13,7 +13,7 @@
|
||||
#include <sourcemod>
|
||||
#include <entWatch_core>
|
||||
|
||||
#define MESSAGEFORMAT "\x07%s[entWatch] \x07%s%s \x07%s(\x07%s%s\x07%s) %s \x07%6s%s"
|
||||
#define MESSAGEFORMAT "\x07%s[entWatch] \x07%s%s \x07%s(\x07%s%s\x07%s) %t \x07%6s%s"
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
@ -43,6 +43,8 @@ public void EW_OnClientItemDrop(int client, int index)
|
||||
|
||||
if (item.dConfig.bDisplayEventMessages)
|
||||
{
|
||||
SetGlobalTransTarget(LANG_SERVER);
|
||||
|
||||
char sClientName[32];
|
||||
GetClientName(client, sClientName, sizeof(sClientName));
|
||||
|
||||
@ -69,6 +71,8 @@ public void EW_OnClientItemDeath(int client, int index)
|
||||
|
||||
if (item.dConfig.bDisplayEventMessages)
|
||||
{
|
||||
SetGlobalTransTarget(LANG_SERVER);
|
||||
|
||||
char sClientName[32];
|
||||
GetClientName(client, sClientName, sizeof(sClientName));
|
||||
|
||||
@ -95,6 +99,8 @@ public void EW_OnClientItemPickup(int client, int index)
|
||||
|
||||
if (item.dConfig.bDisplayEventMessages)
|
||||
{
|
||||
SetGlobalTransTarget(LANG_SERVER);
|
||||
|
||||
char sClientName[32];
|
||||
GetClientName(client, sClientName, sizeof(sClientName));
|
||||
|
||||
@ -121,6 +127,8 @@ public void EW_OnClientItemDisconnect(int client, int index)
|
||||
|
||||
if (item.dConfig.bDisplayEventMessages)
|
||||
{
|
||||
SetGlobalTransTarget(LANG_SERVER);
|
||||
|
||||
char sClientName[32];
|
||||
GetClientName(client, sClientName, sizeof(sClientName));
|
||||
|
||||
@ -147,6 +155,8 @@ public void EW_OnClientItemActivate(int client, int index)
|
||||
|
||||
if (item.dConfig.bDisplayActivateMessages)
|
||||
{
|
||||
SetGlobalTransTarget(LANG_SERVER);
|
||||
|
||||
char sClientName[32];
|
||||
GetClientName(client, sClientName, sizeof(sClientName));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user