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

KFGui.KFAddBotButton


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
class KFAddBotButton extends moButton;

function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
	local KFGameReplicationInfo KFGRI;

	Super.InitComponent(MyController, MyOwner);
	
	KFGRI = KFGameReplicationInfo(PlayerOwner().GameReplicationInfo);
	
	if ( KFGRI == none || KFGRI.TempBotName=="" )
	{
		DisableMe();
	}
}
function bool InternalOnClick(GUIComponent Sender)
{
	local int PendingBots;
	local KFGameReplicationInfo  KFGRI;
	local String BotName;

	KFGRI = KFGameReplicationInfo(PlayerOwner().GameReplicationInfo);

	if (KFGRI == none)
		return false;

	PendingBots = KFGRI.PendingBots;
	if (KFGRI.TempBotName != "")
		BotName = KFGRI.TempBotName;

	if(BotName != "")
	{
		if ((PlayerOwner().GameReplicationInfo.PRIArray.length  + PendingBots) < 6)
		{
			PendingBots ++;
			KFPlayerController(PlayerOwner()).ServerSetGRIPendingBots(PendingBots,BotName);
			PlayerOwner().ClientMessage("Bot "$KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).LastBotName[PendingBots]$" added to BotList");
			PlayerOwner().ClientMessage("Number of Bots to spawn: "$KFGameReplicationInfo(PlayerOwner().GameReplicationInfo).PendingBots);
		}
		else Warn("No Valid KF Bot selected");
	}
}

defaultproperties
{
     ButtonCaption="Add Bot"
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Fri 13-10-2023 03:17:26.000 - Creation time: Fri 13-10-2023 03:19:03.059 - Created with UnCodeX