if mapvote is going on just use centertext instead
This commit is contained in:
+17
-27
@@ -241,7 +241,6 @@ public void OnMapStart()
|
||||
bool bMultiTrigger = view_as<bool>(KvConfig.GetNum("multitrigger", 0));
|
||||
bool bNameFixup = view_as<bool>(KvConfig.GetNum("namefixup", 0));
|
||||
int iTimeout = KvConfig.GetNum("timeout", -1);
|
||||
int iOffset = KvConfig.GetNum("offset", 0);
|
||||
|
||||
CConfig Config = view_as<CConfig>(INVALID_HANDLE);
|
||||
|
||||
@@ -317,7 +316,6 @@ public void OnMapStart()
|
||||
Config.bMultiTrigger = bMultiTrigger;
|
||||
Config.bNameFixup = bNameFixup;
|
||||
Config.iTimeout = iTimeout;
|
||||
Config.iOffset = iOffset;
|
||||
|
||||
Config.SetTrigger(sTrigger);
|
||||
Config.SetOutput(sTrigger[iTriggerDelim + 1]);
|
||||
@@ -931,15 +929,21 @@ public void OnGameFrame()
|
||||
}
|
||||
}
|
||||
|
||||
if(!IsVoteInProgress())
|
||||
{
|
||||
bool voteInProgress = IsVoteInProgress();
|
||||
if(g_sHUDText[0])
|
||||
{
|
||||
for(int client = 1; client <= MaxClients; client++)
|
||||
{
|
||||
if(IsClientInGame(client))
|
||||
{
|
||||
if (voteInProgress)
|
||||
{
|
||||
PrintCenterText(client, g_sHUDText);
|
||||
}
|
||||
else
|
||||
{
|
||||
PrintHintText(client, g_sHUDText);
|
||||
}
|
||||
StopSound(client, SNDCHAN_STATIC, "UI/hint.wav");
|
||||
}
|
||||
}
|
||||
@@ -951,14 +955,20 @@ public void OnGameFrame()
|
||||
{
|
||||
if(IsClientInGame(client))
|
||||
{
|
||||
PrintHintText(client, "");
|
||||
if (voteInProgress)
|
||||
{
|
||||
PrintCenterText(client, g_sHUDText);
|
||||
}
|
||||
else
|
||||
{
|
||||
PrintHintText(client, g_sHUDText);
|
||||
}
|
||||
StopSound(client, SNDCHAN_STATIC, "UI/hint.wav");
|
||||
}
|
||||
}
|
||||
s_bLastHudPrinted = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool BossInit(CBoss _Boss)
|
||||
{
|
||||
@@ -1316,7 +1326,6 @@ bool BossProcess(CBoss _Boss)
|
||||
bool bInvalid = false;
|
||||
int iHealth = 0;
|
||||
int iLastHealth = _Boss.iHealth;
|
||||
int iMaxHealth = _Boss.iMaxHealth;
|
||||
int iLastChange = _Boss.iLastChange;
|
||||
|
||||
if(_Boss.IsBreakable)
|
||||
@@ -1396,26 +1405,16 @@ bool BossProcess(CBoss _Boss)
|
||||
bInvalid = true;
|
||||
}
|
||||
|
||||
int iOffset = _Config.iOffset;
|
||||
if(iOffset != 0)
|
||||
iHealth += iOffset;
|
||||
|
||||
if(iHealth < 0)
|
||||
iHealth = 0;
|
||||
|
||||
if(iMaxHealth < iHealth)
|
||||
{
|
||||
iMaxHealth = iHealth;
|
||||
_Boss.iMaxHealth = iHealth;
|
||||
}
|
||||
|
||||
if(iHealth != iLastHealth)
|
||||
{
|
||||
iLastChange = GetTime();
|
||||
_Boss.iLastChange = iLastChange;
|
||||
}
|
||||
|
||||
// Boss hasn't initialized HP yet.
|
||||
// Boss hasnt initialized HP yet.
|
||||
if(iHealth == 0 && iLastHealth == 0)
|
||||
{
|
||||
// Boss invalid: Delete boss
|
||||
@@ -1453,15 +1452,6 @@ bool BossProcess(CBoss _Boss)
|
||||
sFormat[FormatLen++] = ' ';
|
||||
|
||||
FormatLen += IntToString(iHealth, sFormat[FormatLen], sizeof(sFormat) - FormatLen);
|
||||
|
||||
sFormat[FormatLen++] = ' ';
|
||||
sFormat[FormatLen++] = '[';
|
||||
|
||||
FormatLen += IntToString(RoundToNearest(float(iHealth) / float(iMaxHealth) * 100), sFormat[FormatLen], sizeof(sFormat) - FormatLen);
|
||||
|
||||
FormatLen += StrCat(sFormat[FormatLen], sizeof(sFormat) - FormatLen, "%%%%"); // No idea why this needs 4 percents, but it works.
|
||||
|
||||
sFormat[FormatLen++] = ']';
|
||||
sFormat[FormatLen] = 0;
|
||||
|
||||
StrCat(g_sHUDText, sizeof(g_sHUDText), sFormat);
|
||||
|
||||
Reference in New Issue
Block a user