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

KFGui.KFModelSelect


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
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
class KFModelSelect extends UT2k4ModelSelect;

// Overridden to get rid of the Race combo
function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
	super(LockedFloatingWindow).Initcomponent(MyController, MyOwner);

	sb_Main.SetPosition(0.040000,0.075000,0.680742,0.555859);
	sb_Main.RightPadding = 0.5;
	sb_Main.ManageComponent(CharList);

	class'xUtil'.static.GetPlayerList(PlayerList);
	RefreshCharacterList("DUP");

	// Spawn spinning character actor
	if ( SpinnyDude == None )
		SpinnyDude = PlayerOwner().spawn(class'XInterface.SpinnyWeap');

	SpinnyDude.SetDrawType(DT_Mesh);
	SpinnyDude.SetDrawScale(0.9);
	SpinnyDude.SpinRate = 0;
}

function RefreshCharacterList(string ExcludedChars, optional string Race)
{
    local int i, j;
    local array<string> Excluded;

    // Prevent list from calling OnChange events
    CharList.List.bNotify = False;
    CharList.Clear();

    Split(ExcludedChars, ";", Excluded);
    for ( i = 0; i < PlayerList.Length; i++ )
    {
		// Check that this character is selectable
		if ( PlayerList[i].Menu != "" )
		{
			for (j = 0; j < Excluded.Length; j++)
				if ( InStr(";" $ Playerlist[i].Menu $ ";", ";" $ Excluded[j] $ ";") != -1 )
					break;

			if ( j < Excluded.Length )
				continue;
		}

        if ( IsUnLocked(PlayerList[i]) )
        {
			CharList.List.Add(Playerlist[i].Portrait, i, 0);
        }
        else if ( Playerlist[i].LockedPortrait == none )
        {
			CharList.List.Add(Playerlist[i].Portrait, i, 1);
        }
        else
        {
        	CharList.List.Add(Playerlist[i].LockedPortrait, i, 1);
        }
    }

    CharList.List.LockedMat = LockedImage;
    CharList.List.bNotify = True;
}

function HandleParameters( string Who, string Team )
{
	local int i;

	for ( i = 0; i < PlayerList.Length; i++)
	{
		if ( PlayerList[i].DefaultName ~= Who && IsUnlocked(PlayerList[i]) )
		{
			CharList.List.SetIndex(CharList.List.FindItem(i));
		}
	}

	UpdateSpinnyDude();
}

// Overridden to set Idle Animation
function UpdateSpinnyDude()
{
	local int idx;
	local xUtil.PlayerRecord Rec;
	local Mesh PlayerMesh;
	local Material BodySkin, HeadSkin;
	local string BodySkinName, HeadSkinName, TeamSuffix;

	idx = CharList.List.GetItem();
	if ( idx < 0 || idx >= Playerlist.Length )
		return;

	Rec = PlayerList[idx];

	if (Rec.Race ~= "Juggernaut" || Rec.DefaultName~="Axon" || Rec.DefaultName~="Cyclops" || Rec.DefaultName ~="Virus" )
		SpinnyDudeOffset=vect(250.0,1.00,-14.00);
	else
	    SpinnyDudeOffset=vect(250.0,1.00,-24.00);

	PlayerMesh = Mesh(DynamicLoadObject(Rec.MeshName, class'Mesh'));
	if(PlayerMesh == None)
	{
		Log("Could not load mesh: "$Rec.MeshName$" For player: "$Rec.DefaultName);
		return;
	}

	// Get the body skin
	BodySkinName = Rec.BodySkinName;

	// Get the head skin
	HeadSkinName = Rec.FaceSkinName;
	if ( Rec.TeamFace )
		HeadSkinName $= TeamSuffix;

	BodySkin = Material(DynamicLoadObject(BodySkinName, class'Material'));
	if(BodySkin == None)
	{
		Log("Could not load body material: "$Rec.BodySkinName$" For player: "$Rec.DefaultName);
		return;
	}

	HeadSkin = Material(DynamicLoadObject(HeadSkinName, class'Material'));
	if(HeadSkin == None)
	{
		Log("Could not load head material: "$HeadSkinName$" For player: "$Rec.DefaultName);
		return;
	}

	SpinnyDude.LinkMesh(PlayerMesh);
	SpinnyDude.Skins[0] = BodySkin;
	SpinnyDude.Skins[1] = HeadSkin;
	SpinnyDude.LoopAnim('Profile_idle');
}

// Overridden to stop log spam
function PopulateRaces()
{
}

// Overridden to hook up Steam Checks
function bool IsUnlocked(xUtil.PlayerRecord Test)
{
	// If character has no menu filter, just return true
	if ( PlayerOwner() == none )
		return super.IsUnlocked(Test);

	return PlayerOwner().CharacterAvailable(Test.DefaultName);
}

function HandleLockedCharacterClicked(int NewIndex)
{
	if ( PlayerOwner() != none && PlayerOwner().PurchaseCharacter(Playerlist[NewIndex].DefaultName) )
	{
		Controller.CloseMenu(true);
	}
}

defaultproperties
{
     Begin Object Class=KFGUIVertImageListBox Name=vil_CharList
         CellStyle=CELL_FixedCount
         NoVisibleRows=3
         NoVisibleCols=4
         OnCreateComponent=vil_CharList.InternalOnCreateComponent
         WinTop=0.185119
         WinLeft=0.102888
         WinWidth=0.403407
         WinHeight=0.658125
         TabOrder=0
         bBoundToParent=True
         bScaleToParent=True
         OnChange=KFModelSelect.ListChange
     End Object
     CharList=KFGUIVertImageListBox'KFGui.KFModelSelect.vil_CharList'

     co_Race=None

}

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.729 - Created with UnCodeX