//============================================================================== // Description // // Created by Ron Prestenback // © 2003, Epic Games, Inc. All Rights Reserved //============================================================================== class UT2K4Tab_WeaponPref extends Settings_Tabs; struct WeapItem { var class WeapClass; var int WeapPriority; var int CrosshairIndex; var bool bAltFireMode; var bool bClassicModel; var color CustomColor; var float CrosshairScale; }; var array WeaponsList; var automated GUISectionBackground i_BG, i_BG2, i_BG3; var automated GUIImage i_Crosshair, i_CrosshairBG, i_Shadow, i_Bk; var automated GUIGFXButton b_Up, b_Down; var automated GUIListBox lb_Weapons; var automated GUIScrollTextBox lb_Desc; var automated moCheckbox ch_Swap, ch_WeaponCrosshair, ch_ClassicModel; var automated moComboBox co_Crosshair; var automated moSlider sl_Red, sl_Blue, sl_Green, sl_Alpha, sl_CrosshairScale; var SpinnyWeap SpinnyWeap; // MUST be set to null when you leave the window var() vector SpinnyWeapOffset; var bool bWeaponCrosshair, bSwap; var int iCrosshair, WeaponIndex; var color cCrosshair; var float MaxCrosshairWidth, MaxCrosshairHeight, fScale; var localized string HiddenText, LoadingText; var config bool bDebugPriority, bDebugScale, bDebugWeapon; function int CompareWeaponPriority(GUIListElem ElemA, GUIListElem ElemB) { local int PA, PB, Result; local class WA, WB; WA = class(ElemA.ExtraData); WB = class(ElemB.ExtraData); PA = WA.default.Priority; PB = WB.default.Priority; Result = PB - PA; if ( Result != 0 || ElemA.Item == "" || ElemB.Item == "" ) return Result; Result = StrCmp(ElemA.Item, ElemB.Item); if ( Result != 0 ) return Result; return StrCmp(ElemA.ExtraStrData, ElemB.ExtraStrData); } function InitComponent(GUIController MyController, GUIComponent MyOwner) { local int i; local array CustomCrosshairs; Super.InitComponent(MyController, MyOwner); cCrosshair = class'HUD'.default.CrosshairColor; co_Crosshair.MyComboBox.MyListBox.MyList.bInitializeList = false; class'CacheManager'.static.GetCrosshairList(CustomCrosshairs); for(i = 0;i < CustomCrosshairs.Length;i++) co_Crosshair.AddItem(CustomCrosshairs[i].FriendlyName, CustomCrosshairs[i].CrosshairTexture); co_Crosshair.ReadOnly(true); co_Crosshair.MyComboBox.Edit.bAlwaysNotify = True; lb_Weapons.List.bDropSource=True; lb_Weapons.List.bDropTarget=True; lb_Weapons.List.bMultiSelect=False; i_BG2.ManageComponent(lb_Weapons); i_BG3.ManageComponent(ch_WeaponCrosshair); i_BG3.ManageComponent(sl_Red); i_BG3.ManageComponent(sl_Green); i_BG3.ManageComponent(sl_Blue); i_BG3.ManageComponent(sl_Alpha); i_BG3.ManageComponent(sl_CrosshairScale); i_BG3.ManageComponent(co_Crosshair); if ( bDebugWeapon ) OnKeyEvent = CoolOnKeyEvent; } function IntializeWeaponList() { local UT2K4GenericMessageBox Page; // Display the "loading" page if ( Controller.OpenMenu("GUI2K4.UT2K4GenericMessageBox", "", LoadingText) ) { Page = UT2K4GenericMessageBox(Controller.ActivePage); Page.RemoveComponent(Page.b_Ok); Page.RemoveComponent(Page.l_Text); Page.l_Text2.FontScale = FNS_Large; Page.l_Text2.WinHeight = 1.0; Page.l_Text2.WinTop = 0.0; Page.l_Text2.bBoundToParent = True; Page.l_Text2.bScaleToParent = True; Page.l_Text2.VertAlign = TXTA_Center; Page.l_Text2.TextAlign = TXTA_Center; Page.bRenderWorld = False; Page.OnRendered = ReallyInitializeWeaponList; } } function ReallyInitializeWeaponList( Canvas C ) { local int i; local array Records; if ( Controller.ActivePage.Tag != 55 ) { Controller.ActivePage.Tag = 55; return; } // Initialise weapon list. Sort based on current priority - highest priority first class'CacheManager'.static.GetWeaponList(Records); // Disable the combo list's OnChange() lb_Weapons.List.bNotify = False; lb_Weapons.List.Clear(); for(i=0; i