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

UTGame.UTUIFrontEnd_PlayerStats


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
/**
 * Copyright 1998-2008 Epic Games, Inc. All Rights Reserved.
 *
 * Player stats scene for UT3.
 */
class UTUIFrontEnd_PlayerStats extends UTUIFrontEnd;

/** The index to use for getting detailed stats information for a specific result row on the leaderboard in the previous screen. */
var transient int StatsIndex;

/** Reference to the various tab pages. */
var transient UTUITabPage_StatsGeneral GeneralTab;
var transient UTUITabPage_StatsWeapons WeaponsTab;
var transient UTUITabPage_StatsVehicles VehiclesTab;
var transient UTUITabPage_StatsVehicleWeapons VehicleWeaponsTab;
var transient UTUITabPage_StatsRewards RewardsTab;

/** Reference to the stats datastore. */
var transient UTDataStore_OnlineStats StatsDataStore;

/** Player name label. */
var transient UILabel	PlayerNameLabel;

/** PostInitialize event - Sets delegates for the scene. */
event PostInitialize()
{
	Super.PostInitialize();

	// Get widget references
	PlayerNameLabel = UILabel(FindChild('lblPlayerName', true));

	// Add tab pages to tab control
	GeneralTab = UTUITabPage_StatsGeneral(FindChild('pnlGeneral', true));
	if(GeneralTab != none)
	{
		TabControl.InsertPage(GeneralTab, 0, 0, false);
	}

	WeaponsTab = UTUITabPage_StatsWeapons(FindChild('pnlWeapons', true));
	if(WeaponsTab != none)
	{
		TabControl.InsertPage(WeaponsTab, 0, 1, false);
	}

	VehiclesTab = UTUITabPage_StatsVehicles(FindChild('pnlVehicles', true));
	if(VehiclesTab != none)
	{
		TabControl.InsertPage(VehiclesTab, 0, 2, false);
	}

	VehicleWeaponsTab = UTUITabPage_StatsVehicleWeapons(FindChild('pnlVehicleWeapons', true));
	if(VehicleWeaponsTab != none)
	{
		TabControl.InsertPage(VehicleWeaponsTab, 0, 3, false);
	}

	RewardsTab = UTUITabPage_StatsRewards(FindChild('pnlRewards', true));
	if(RewardsTab != none)
	{
		TabControl.InsertPage(RewardsTab, 0, 4, false);
	}

	StatsDataStore = UTDataStore_OnlineStats(FindDataStore('UTLeaderboards', GetPlayerOwner()));

	PlayerNameLabel.SetDataStoreBinding(StatsDataStore.DetailsPlayerNick);
}

/** Scene activated event, sets up the title for the scene. */
event SceneActivated(bool bInitialActivation)
{
	Super.SceneActivated(bInitialActivation);

    //Make sure the stats list is active for scroll wheel support
	UTUITabPage_StatsPage(TabControl.ActivePage).StatsList.SetFocus(none);
}

/** Setup the scene's button bar. */
function SetupButtonBar()
{
	if(ButtonBar!=None)
	{	
		ButtonBar.Clear();
		ButtonBar.AppendButton("<Strings:UTGameUI.ButtonCallouts.Back>", OnButtonBar_Back);
		ButtonBar.AppendButton("<Strings:UTGameUI.ButtonCallouts.GamerCard>", OnButtonBar_PlayerCard);
	}
}

/** Callback to show the player card for this player. */
function OnPlayerCard()
{
	ShowPlayerCard(StatsDataStore.DetailsPlayerNetId,StatsDataStore.DetailsPlayerNick);
}

/** Callback for when the user wants to exit the scene. */
function OnBack()
{
	CloseScene(self);
}

/**
 * Provides a hook for unrealscript to respond to input using actual input key names (i.e. Left, Tab, etc.)
 *
 * Called when an input key event is received which this widget responds to and is in the correct state to process.  The
 * keys and states widgets receive input for is managed through the UI editor's key binding dialog (F8).
 *
 * This delegate is called BEFORE kismet is given a chance to process the input.
 *
 * @param	EventParms	information about the input event.
 *
 * @return	TRUE to indicate that this input key was processed; no further processing will occur on this input key event.
 */
function bool HandleInputKey( const out InputEventParameters EventParms )
{
	local bool bResult;

	bResult=false;

	if(EventParms.EventType==IE_Released)
	{
		if(EventParms.InputKeyName=='XboxTypeS_B' || EventParms.InputKeyName=='Escape')
		{
			OnBack();
			bResult=true;
		}
		if(EventParms.InputKeyName=='XboxTypeS_Y')
		{
			OnPlayerCard();
			bResult=true;
		}
	}

	return bResult;
}


/** Buttonbar Callbacks. */
function bool OnButtonBar_Back(UIScreenObject InButton, int PlayerIndex)
{
	OnBack();

	return true;
}

function bool OnButtonBar_PlayerCard(UIScreenObject InButton, int PlayerIndex)
{
	OnPlayerCard();

	return true;
}


/**
 * Called when a new page is activated.
 *
 * @param	Sender			the tab control that activated the page
 * @param	NewlyActivePage	the page that was just activated
 * @param	PlayerIndex		the index [into the Engine.GamePlayers array] for the player that generated this event.
 */
function OnPageActivated( UITabControl Sender, UITabPage NewlyActivePage, int PlayerIndex )
{
	// Start a stats read for the page we just activated
	UTUITabPage_StatsPage(NewlyActivePage).ReadStats();

	Super.OnPageActivated(Sender, NewlyActivePage, PlayerIndex);
}

defaultproperties
{
   Begin Object Class=UIComp_Event Name=SceneEventComponent ObjName=SceneEventComponent Archetype=UIComp_Event'UTGame.Default__UTUIFrontEnd:SceneEventComponent'
      ObjectArchetype=UIComp_Event'UTGame.Default__UTUIFrontEnd:SceneEventComponent'
   End Object
   EventProvider=SceneEventComponent
   Name="Default__UTUIFrontEnd_PlayerStats"
   ObjectArchetype=UTUIFrontEnd'UTGame.Default__UTUIFrontEnd'
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: tr 31-1-2018 17:18:50.000 - Creation time: sk 18-3-2018 10:01:27.027 - Created with UnCodeX