Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

TribesGUI.HUDMessageWindow


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
class HUDMessageWindow extends HUDMessagePane;

// number of messages in the window right now
var int NumMessages;
var int ForcedMaxVisibleLines;

function InitElement()
{
	super.InitElement();

	RemoveAll();
	NumMessages = 0;
}

function GetNewMessages(ClientSideCharacter c)
{
	local HUDTextMessage newMessage;
	local int i;

	// take care of the case when there are more messages
	// in the children list than there are on the csc list
	if(c.Messages.Length < NumMessages)
	{
		for(i = 0; i < NumMessages - c.Messages.Length; ++i)
		{
			MessagePool.FreeObject(Children[i]);
			RemoveElementAt(i);
		}
		NumMessages = children.Length;
	}

	// add all the messages
	while(NumMessages < c.messages.Length)
	{
		newMessage = HUDTextMessage(MessagePool.AllocateObject(class'HUDTextMessage'));
		newMessage.SetText(MessageStyles[c.messages[NumMessages].Type], c.messages[NumMessages].Text);

		AddMessage(newMessage);

		NumMessages++;
	}
}

function UpdateData(ClientSideCharacter c)
{
	super.UpdateData(c);

	bVisible = c.bDisplayChatWindow;

	if(! bVisible)
		return;

	if(ForcedMaxVisibleLines < 0)
	{
		if(MaxDisplayableLines != c.CurrentChatWindowSize)
		{
			MaxDisplayableLines = c.CurrentChatWindowSize;
			ScrollMessages(0);
		}
	}
	else if(MaxDisplayableLines != ForcedMaxVisibleLines)
	{
		MaxDisplayableLines = ForcedMaxVisibleLines;
		ScrollMessages(0);
	}

	if(c.ChatScrollDelta != 0)
	{
		ScrollMessages(c.ChatScrollDelta);
		c.ChatScrollDelta = 0;
	}
}

defaultproperties
{
	ForcedMaxVisibleLines = -1;
	bScrollable=true
	bAutoHeight=true
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: st 16.4.2014 10:20:44.000 - Creation time: st 23.5.2018 00:10:44.376 - Created with UnCodeX