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 bMultiTrigger = view_as<bool>(KvConfig.GetNum("multitrigger", 0));
|
||||||
bool bNameFixup = view_as<bool>(KvConfig.GetNum("namefixup", 0));
|
bool bNameFixup = view_as<bool>(KvConfig.GetNum("namefixup", 0));
|
||||||
int iTimeout = KvConfig.GetNum("timeout", -1);
|
int iTimeout = KvConfig.GetNum("timeout", -1);
|
||||||
int iOffset = KvConfig.GetNum("offset", 0);
|
|
||||||
|
|
||||||
CConfig Config = view_as<CConfig>(INVALID_HANDLE);
|
CConfig Config = view_as<CConfig>(INVALID_HANDLE);
|
||||||
|
|
||||||
@@ -317,7 +316,6 @@ public void OnMapStart()
|
|||||||
Config.bMultiTrigger = bMultiTrigger;
|
Config.bMultiTrigger = bMultiTrigger;
|
||||||
Config.bNameFixup = bNameFixup;
|
Config.bNameFixup = bNameFixup;
|
||||||
Config.iTimeout = iTimeout;
|
Config.iTimeout = iTimeout;
|
||||||
Config.iOffset = iOffset;
|
|
||||||
|
|
||||||
Config.SetTrigger(sTrigger);
|
Config.SetTrigger(sTrigger);
|
||||||
Config.SetOutput(sTrigger[iTriggerDelim + 1]);
|
Config.SetOutput(sTrigger[iTriggerDelim + 1]);
|
||||||
@@ -931,15 +929,21 @@ public void OnGameFrame()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!IsVoteInProgress())
|
bool voteInProgress = IsVoteInProgress();
|
||||||
{
|
|
||||||
if(g_sHUDText[0])
|
if(g_sHUDText[0])
|
||||||
{
|
{
|
||||||
for(int client = 1; client <= MaxClients; client++)
|
for(int client = 1; client <= MaxClients; client++)
|
||||||
{
|
{
|
||||||
if(IsClientInGame(client))
|
if(IsClientInGame(client))
|
||||||
|
{
|
||||||
|
if (voteInProgress)
|
||||||
|
{
|
||||||
|
PrintCenterText(client, g_sHUDText);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
PrintHintText(client, g_sHUDText);
|
PrintHintText(client, g_sHUDText);
|
||||||
|
}
|
||||||
StopSound(client, SNDCHAN_STATIC, "UI/hint.wav");
|
StopSound(client, SNDCHAN_STATIC, "UI/hint.wav");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -951,14 +955,20 @@ public void OnGameFrame()
|
|||||||
{
|
{
|
||||||
if(IsClientInGame(client))
|
if(IsClientInGame(client))
|
||||||
{
|
{
|
||||||
PrintHintText(client, "");
|
if (voteInProgress)
|
||||||
|
{
|
||||||
|
PrintCenterText(client, g_sHUDText);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PrintHintText(client, g_sHUDText);
|
||||||
|
}
|
||||||
StopSound(client, SNDCHAN_STATIC, "UI/hint.wav");
|
StopSound(client, SNDCHAN_STATIC, "UI/hint.wav");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
s_bLastHudPrinted = false;
|
s_bLastHudPrinted = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
bool BossInit(CBoss _Boss)
|
bool BossInit(CBoss _Boss)
|
||||||
{
|
{
|
||||||
@@ -1316,7 +1326,6 @@ bool BossProcess(CBoss _Boss)
|
|||||||
bool bInvalid = false;
|
bool bInvalid = false;
|
||||||
int iHealth = 0;
|
int iHealth = 0;
|
||||||
int iLastHealth = _Boss.iHealth;
|
int iLastHealth = _Boss.iHealth;
|
||||||
int iMaxHealth = _Boss.iMaxHealth;
|
|
||||||
int iLastChange = _Boss.iLastChange;
|
int iLastChange = _Boss.iLastChange;
|
||||||
|
|
||||||
if(_Boss.IsBreakable)
|
if(_Boss.IsBreakable)
|
||||||
@@ -1396,26 +1405,16 @@ bool BossProcess(CBoss _Boss)
|
|||||||
bInvalid = true;
|
bInvalid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int iOffset = _Config.iOffset;
|
|
||||||
if(iOffset != 0)
|
|
||||||
iHealth += iOffset;
|
|
||||||
|
|
||||||
if(iHealth < 0)
|
if(iHealth < 0)
|
||||||
iHealth = 0;
|
iHealth = 0;
|
||||||
|
|
||||||
if(iMaxHealth < iHealth)
|
|
||||||
{
|
|
||||||
iMaxHealth = iHealth;
|
|
||||||
_Boss.iMaxHealth = iHealth;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(iHealth != iLastHealth)
|
if(iHealth != iLastHealth)
|
||||||
{
|
{
|
||||||
iLastChange = GetTime();
|
iLastChange = GetTime();
|
||||||
_Boss.iLastChange = iLastChange;
|
_Boss.iLastChange = iLastChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Boss hasn't initialized HP yet.
|
// Boss hasnt initialized HP yet.
|
||||||
if(iHealth == 0 && iLastHealth == 0)
|
if(iHealth == 0 && iLastHealth == 0)
|
||||||
{
|
{
|
||||||
// Boss invalid: Delete boss
|
// Boss invalid: Delete boss
|
||||||
@@ -1453,15 +1452,6 @@ bool BossProcess(CBoss _Boss)
|
|||||||
sFormat[FormatLen++] = ' ';
|
sFormat[FormatLen++] = ' ';
|
||||||
|
|
||||||
FormatLen += IntToString(iHealth, sFormat[FormatLen], sizeof(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;
|
sFormat[FormatLen] = 0;
|
||||||
|
|
||||||
StrCat(g_sHUDText, sizeof(g_sHUDText), sFormat);
|
StrCat(g_sHUDText, sizeof(g_sHUDText), sFormat);
|
||||||
|
|||||||
Reference in New Issue
Block a user