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

UWindow.UWindowNetErrorClientWindow


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
class UWindowNetErrorClientWindow extends UWindowDialogClientWindow;

var UWindowDynamicTextArea TextArea;
var UWindowSmallCloseButton CloseB;
var() localized string KickNetworkText,BanNetworkText,TempBanNetworkText;

function Created()
{
	TextArea = UWindowDynamicTextArea(CreateWindow(class'UWindowDynamicTextArea', 4, 4, WinWidth, WinHeight-26));
	TextArea.MaxLines = 15;
	CloseB = UWindowSmallCloseButton(CreateWindow(class'UWindowSmallCloseButton', WinWidth-60, WinHeight-22, 48, 22));
}

function BeforePaint(Canvas C, float X, float Y)
{
	Super.BeforePaint(C, X, Y);
	TextArea.WinWidth = WinWidth-8;
	TextArea.WinHeight = WinHeight-30;
	CloseB.WinTop = WinHeight-24;
	CloseB.WinLeft = WinWidth-60;
}
function Paint(Canvas C, float X, float Y)
{
	LookAndFeel.DrawClientArea(Self, C);
	DrawStretchedTexture(C, TextArea.WinLeft, TextArea.WinTop, TextArea.WinWidth, TextArea.WinHeight, Texture'BlackTexture');
}
function SetNetworkMessage( String Msg )
{
	local int i;
	local UWindowNetErrorWindow WT;

	// Check for short names.
	if ( Msg=="NE_Kick" )
		Msg = KickNetworkText;
	else if ( Left(Msg,6)=="NE_Ban" )
		Msg = BanNetworkText@Mid(Msg,7);
	else if ( Msg=="NE_TBan" )
		Msg = TempBanNetworkText;

	// Check for window title name
	WT = UWindowNetErrorWindow(ParentWindow);
	i = InStr(Msg,"|");
	if ( i==-1 )
		WT.WindowTitle = WT.Default.WindowTitle;
	else
	{
		WT.WindowTitle = Left(Msg,i);
		Msg = Mid(Msg,i+1);
	}

	// Check message lines
	TextArea.Clear();
	i = InStr(Msg,"\\");
	while ( i!=-1 )
	{
		TextArea.AddText(Left(Msg,i));
		Msg = Mid(Msg,i+1);
		i = InStr(Msg,"\\");
	}
	TextArea.AddText(Msg);
}

defaultproperties
{
				KickNetworkText="KICKED!|You have been kicked from this server by an administrator for remainder of the game.\"
				BanNetworkText="BANNED!|You have been banned from this server by an administrator for bad behaviour.\\If you feel like you dont deserve this ban, contact the administrator at: "
				TempBanNetworkText="SESSION BANNED!|You have been temporarily banned from this server for remainder of the map.\"
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: zo 11-11-2012 21:10:28.000 - Creation time: zo 11-11-2012 21:14:22.787 - Created with UnCodeX