Well, i don;t know where in this class to add
that
/************************************************
Developer: BITHACK
Copyright (c) 1995,2022 Your company
Script description:....
*************************************************/
class BIT_DemageHUD extends UICommonAPI;
var WindowHandleMe;
const DAMAGE_MESSAGE_OFFSET = 100;
const MAX_DAMAGE_MESSAGE = 28;
var TextBoxHandle DamageText[MAX_DAMAGE_MESSAGE]; //that's how many TextBoxes we need in xdat, i.e. 28
function OnRegisterEvent(){ /* Register game events */
RegisterEvent(EV_SystemMessage);
}
function OnLoad() {
local int i;
Me = GetWindowHandle("BIT_DemageHUD");
for (i=0; i<=MAX_DAMAGE_MESSAGE; i++){
DamageText = GetTextBoxHandle("BIT_DemageHUD.D-" $i);
DamageText.SetText("");
}
}
function OnEvent(int Event_ID, string a_param){
if(Event_ID == EV_SystemMessage) {
HandleSystemMessage(a_param);
}
}
function HandleSystemMessage (string a_Param){
local Color RedColor, WhiteColor;
local int SystemMsgIndex;
ParseInt(a_Param,"Index",SystemMsgIndex);
RedColor.R = 205; RedColor.G = 0; RedColor.B = 0;
WhiteColor.R = 255; WhiteColor.G = 255; WhiteColor.B = 255;
switch (SystemMsgIndex)
{
case 2261: //player msg
case 2281: //summoner msg
DemageHud(WhiteColor, a_param); //Our damage, color white
break;
case 2262: //player msg
case 2263: //player msg
DemageHud(RedColor, a_param); //Damage from enemy, color red
break;
}
}
function DemageHud(Color DColor, string a_param){
local int DamageToPlayer, i;
for(i=0; i <= MAX_DAMAGE_MESSAGE; i++)
{
if(DamageText.GetText() == "") //run in a loop until we hit a free TextBox
{
DamageText.SetAlpha(255); //force opacity, in theory you can tweak the fade in
ParseInt( a_Param, "Param3", DamageToPlayer); //damage number
DamageText.SetText(string(DamageToPlayer)); //set the damage number to a free index of the textbox array
DamageText.SetAnchor( "BIT_DemageHUD", "BottomCenter", "BottomCenter", -120 + Rand(150), Rand(100) ); //select a random point
DamageText.ClearAnchor(); //remove the anchor from the window after the previous action
DamageText.Move(0, -1500, 8f); //start moving the textbox to -1500 (up) with a speed of 8
DamageText.SetTextColor(DColor);
DamageText.SetAlpha( 0, 2.8f ); //smoothly make the textbox transparent
Me.KillTimer(i + DAMAGE_MESSAGE_OFFSET + 1); //kill the timer (index + constant + 1)
Me.SetTimer(i + DAMAGE_MESSAGE_OFFSET + 1, 2500); //we start a timer for this textbox based on the same (index + constant + 1)
break;
}
}
}
function OnTimer(int TimerID){
Me.KillTimer(TimerID); //we kill any timer at the very beginning, the ID is not important to us here
if(TimerID >= 101 && TimerID <= 200) //Here the logic of the factory timer index + DAMAGE_MESSAGE_OFFSET is connected
{
DamageText[TimerID-DAMAGE_MESSAGE_OFFSET-1].SetText(""); //remove the text from the textbox so that it is freed
}
}
defaultproperties{}
Just tell me in what function i should add this FormatNumberWithSpaces(value);