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()
|
public void OnGameFrame()
|
||||||
{
|
{
|
||||||
/* if (EW_GetItemCount())
|
if (EW_GetItemCount())
|
||||||
{
|
{
|
||||||
char sHUDFormat[250];
|
char sHUDFormat[255];
|
||||||
char sHUDBuffer[64];
|
char sHUDBuffer[64];
|
||||||
|
|
||||||
for (int index; index < EW_GetItemCount(); index++)
|
for (int index; index < EW_GetItemCount(); index++)
|
||||||
{
|
{
|
||||||
any itemArray[items];
|
CItem item = EW_GetItemData(index);
|
||||||
EW_GetItemArray(index, itemArray, sizeof(itemArray));
|
|
||||||
|
|
||||||
if (itemArray[item_display] & DISPLAY_HUD)
|
if (item.dConfig.bDisplayInterface && item.bOwner)
|
||||||
{
|
{
|
||||||
if (itemArray[item_owned] && itemArray[item_owner] >= 0)
|
char sItemShort[32];
|
||||||
{
|
item.dConfig.GetShort(sItemShort, sizeof(sItemShort));
|
||||||
switch(itemArray[item_mode])
|
|
||||||
|
switch(item.dConfig.iMode)
|
||||||
{
|
{
|
||||||
case MODE_COOLDOWN:
|
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
|
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:
|
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
|
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:
|
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
|
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
|
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:
|
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
|
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:
|
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);
|
Format(sHUDFormat, sizeof(sHUDFormat), "%s\n%s", sHUDFormat, sHUDBuffer);
|
||||||
}
|
}
|
||||||
else break;
|
else break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Handle hMessage = StartMessageAll("KeyHintText");
|
Handle hMessage = StartMessageAll("KeyHintText");
|
||||||
BfWriteByte(hMessage, 1);
|
BfWriteByte(hMessage, 1);
|
||||||
BfWriteString(hMessage, sHUDFormat);
|
BfWriteString(hMessage, sHUDFormat);
|
||||||
EndMessage();
|
EndMessage();
|
||||||
}*/
|
}
|
||||||
}
|
}
|
@ -13,7 +13,7 @@
|
|||||||
#include <sourcemod>
|
#include <sourcemod>
|
||||||
#include <entWatch_core>
|
#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:
|
// Purpose:
|
||||||
@ -43,6 +43,8 @@ public void EW_OnClientItemDrop(int client, int index)
|
|||||||
|
|
||||||
if (item.dConfig.bDisplayEventMessages)
|
if (item.dConfig.bDisplayEventMessages)
|
||||||
{
|
{
|
||||||
|
SetGlobalTransTarget(LANG_SERVER);
|
||||||
|
|
||||||
char sClientName[32];
|
char sClientName[32];
|
||||||
GetClientName(client, sClientName, sizeof(sClientName));
|
GetClientName(client, sClientName, sizeof(sClientName));
|
||||||
|
|
||||||
@ -69,6 +71,8 @@ public void EW_OnClientItemDeath(int client, int index)
|
|||||||
|
|
||||||
if (item.dConfig.bDisplayEventMessages)
|
if (item.dConfig.bDisplayEventMessages)
|
||||||
{
|
{
|
||||||
|
SetGlobalTransTarget(LANG_SERVER);
|
||||||
|
|
||||||
char sClientName[32];
|
char sClientName[32];
|
||||||
GetClientName(client, sClientName, sizeof(sClientName));
|
GetClientName(client, sClientName, sizeof(sClientName));
|
||||||
|
|
||||||
@ -95,6 +99,8 @@ public void EW_OnClientItemPickup(int client, int index)
|
|||||||
|
|
||||||
if (item.dConfig.bDisplayEventMessages)
|
if (item.dConfig.bDisplayEventMessages)
|
||||||
{
|
{
|
||||||
|
SetGlobalTransTarget(LANG_SERVER);
|
||||||
|
|
||||||
char sClientName[32];
|
char sClientName[32];
|
||||||
GetClientName(client, sClientName, sizeof(sClientName));
|
GetClientName(client, sClientName, sizeof(sClientName));
|
||||||
|
|
||||||
@ -121,6 +127,8 @@ public void EW_OnClientItemDisconnect(int client, int index)
|
|||||||
|
|
||||||
if (item.dConfig.bDisplayEventMessages)
|
if (item.dConfig.bDisplayEventMessages)
|
||||||
{
|
{
|
||||||
|
SetGlobalTransTarget(LANG_SERVER);
|
||||||
|
|
||||||
char sClientName[32];
|
char sClientName[32];
|
||||||
GetClientName(client, sClientName, sizeof(sClientName));
|
GetClientName(client, sClientName, sizeof(sClientName));
|
||||||
|
|
||||||
@ -147,6 +155,8 @@ public void EW_OnClientItemActivate(int client, int index)
|
|||||||
|
|
||||||
if (item.dConfig.bDisplayActivateMessages)
|
if (item.dConfig.bDisplayActivateMessages)
|
||||||
{
|
{
|
||||||
|
SetGlobalTransTarget(LANG_SERVER);
|
||||||
|
|
||||||
char sClientName[32];
|
char sClientName[32];
|
||||||
GetClientName(client, sClientName, sizeof(sClientName));
|
GetClientName(client, sClientName, sizeof(sClientName));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user