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...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

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