Jump to content

Recommended Posts

Posted (edited)

Hi

Make window OnScreenMessageExWnd with 28 textboxes on screen center:
ryGYtK4.png

 

Add it to a new *.uc class with the same name (OnScreenMessageExWnd)

class OnScreenMessageExWnd extends UICommonAPI;

const DAMAGE_MESSAGE_OFFSET = 100;
const MAX_DAMAGE_MESSAGE = 28;

var WindowHandle Me;
var TextBoxHandle DamageText[MAX_DAMAGE_MESSAGE]; 
  	
function OnLoad()
{
	local int i;
	Me = GetWindowHandle("OnScreenMessageExWnd");
	
	for (i=0; i<MAX_DAMAGE_MESSAGE; i++)
	{
		DamageText[i] = GetTextBoxHandle("OnScreenMessageExWnd.DamageText-0-" $ i);
	}
}
	
function OnRegisterEvent()
{
	RegisterEvent( EV_SystemMessage );
}	
	
function OnEvent(int Event_ID, string param)
{
    switch( Event_ID )
	{
   		case EV_SystemMessage:
    		HandleSystemMessage(param);
    	break;			
    }
}

	
function HandleSystemMessage (string a_Param)
{
	local int SystemMsgIndex, DamageToPlayer, i;
  
	ParseInt(a_Param,"Index",SystemMsgIndex);
	switch (SystemMsgIndex)
	{
		case 2261: //player msg
		case 2281: //summoner msg
		for(i=0; i<MAX_DAMAGE_MESSAGE; i++)
		{
			if(DamageText[i].GetText() == "") 
			{
				DamageText[i].SetAlpha(255); 
			  
				ParseInt( a_Param, "Param3", DamageToPlayer); 
			  
				DamageText[i].SetText(string(DamageToPlayer));
				DamageText[i].SetAnchor( "OnScreenMessageExWnd", "BottomCenter", "BottomCenter", -200 + Rand(150), Rand(60) ); 
				DamageText[i].ClearAnchor(); 
				DamageText[i].Move(0, -1500, 8f);   
				DamageText[i].SetAlpha( 0, 2.8f );
				Me.KillTimer(i + DAMAGE_MESSAGE_OFFSET + 1);
				Me.SetTimer(i + DAMAGE_MESSAGE_OFFSET + 1, 2500); 
				break;
			}
		}
		break;
	}
}

function OnTimer (int TimerID)
{
	Me.KillTimer(TimerID);	
	
	if(TimerID >= 101 && TimerID <= 200)
		DamageText[TimerID-DAMAGE_MESSAGE_OFFSET-1].SetText("");
}

 

 

Result:

use.gif

 

Enjoy

 

Edited by api
  • Like 3
  • Thanks 2
  • Upvote 1
  • 3 weeks later...
Posted (edited)

Hi bro. Wat does it meens?

I'm trying to Fer damage received, what param i whould use?

Where can i find params data?

 

ParseInt(a_Param,"Index",
)
Edited by barao45
  • 1 month later...
  • 8 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock