// ==================================================================== // Class: UT2K4UI.GUICharacterList // Parent: UT2K4UI.GUIHorzList // // // ==================================================================== class GUICharacterList extends GUICircularList Native; cpptext { void PreDraw(UCanvas* Canvas); protected: void DrawItem(UCanvas* Canvas, INT Item, FLOAT X, FLOAT Y, FLOAT XL, FLOAT YL, UBOOL bSelected, UBOOL bPending); public: } var() array PlayerList; var() bool bLocked; var() Material DefaultPortrait; // Image used for unused entries var() array SelectedElements; function InitComponent(GUIController MyController, GUIComponent MyOwner) { Super.Initcomponent(MyController, MyOwner); InitList(); } function InitList() { local int i; local array AllPlayerList; class'xUtil'.static.GetPlayerList(AllPlayerList); // Filter out 'duplicate' characters - only used in single player for(i=0; i=0) && (Index = 0 && i < PlayerList.Length; } function Add(string NewItem, optional Object obj) { return; // GUICharacterLists can not be modifed at runtime } function Remove(int i, optional int Count) { return; // GUICharacterLists can not be modifed at runtime } function Clear() { return; // GUICharacterLists can not be modifed at runtime } function Find(string Text, optional bool bExact) { local int i; for (i=0;i 0 ) { Index--; OnChange(Self); } return true; } else return Super.MoveLeft(); } function bool MoveRight() { if (bLocked) { if (Index GetPendingElements( optional bool bGuarantee ) { local int i; if ( (DropState == DRP_Source && Controller.DropSource == Self) || bGuarantee ) { if ( SelectedElements.Length == 0 ) { for (i = 0; i < SelectedItems.Length; i++) if (ValidIndex(SelectedItems[i])) SelectedElements[SelectedElements.Length] = PlayerList[SelectedItems[i]]; if ( SelectedElements.Length == 0 && IsValid() ) SelectedElements[0] = PlayerList[Index]; } return SelectedElements; } } function bool InternalOnBeginDrag(GUIComponent Sender) { if ( Super.InternalOnBeginDrag(Sender) ) { SelectedElements = GetPendingElements(); return true; } return false; } // Called on the drop source when when an Item has been dropped. bAccepted tells it whether // the operation was successful or not. function InternalOnEndDrag(GUIComponent Accepting, bool bAccepted) { // Pending items were dropped somewhere - list cannot be modified at runtime if (bAccepted && Accepting != None) bRepeatClick = False; // If the drag-n-drop wasn't accepted, set bRepeatClick to True so that ClearPendingElements() // won't clear the SelectedItems array - we may want to retry to drag-n-drop if (Accepting == None) bRepeatClick = True; SetOutlineAlpha(255); if ( bNotify ) CheckLinkedObjects(Self); } // Cannot add to CharacterList at runtime function bool InternalOnDragDrop(GUIComponent Sender) { InternalOnMouseRelease(Sender); return false; }