// ==================================================================== // Class: xVoting.MapVoteGameConfigPage // // this page allows modification of the xVotingHandler GameConfig // configuration variables. // // Written by Bruce Bickar // (c) 2003, Epic Games, Inc. All Rights Reserved // ==================================================================== class MapVoteGameConfigPage extends GUICustomPropertyPage DependsOn(VotingHandler); var automated GUISectionBackground sb_List, sb_List2; var automated GUIListBox lb_GameConfigList; var automated moComboBox co_GameClass; var automated moEditBox ed_GameTitle; var automated moEditBox ed_Acronym; var automated moEditBox ed_Prefix; var automated MultiSelectListBox lb_Mutator; var automated moEditBox ed_Parameter; var automated GUIButton b_New; var automated GUIButton b_Delete; var automated moCheckBox ch_Default; var array GameTypes; var array Mutators; var() editconst noexport CacheManager.GameRecord CurrentGame; // autosave var() int SaveIndex, ListIndex; var bool bChanged; // localization var localized string lmsgNew; var localized string lmsgAdd; //------------------------------------------------------------------------------------------------ function InitComponent(GUIController MyController, GUIComponent MyOwner) { local int i; Super.Initcomponent(MyController, MyOwner); // load existing configuration for(i=0; i MutatorArray; if (lb_GameConfigList.List.ItemCount==0 || lb_GameConfigList.List.Index == ListIndex) return; SaveChange(); SaveIndex = int(lb_GameConfigList.List.GetExtra()); ListIndex = lb_GameConfigList.List.Index; LoadMutators(); co_GameClass.Find(class'xVoting.xVotingHandler'.default.GameConfig[SaveIndex].GameClass, true, True); ed_GameTitle.SetComponentValue(class'xVoting.xVotingHandler'.default.GameConfig[SaveIndex].GameName, True); ed_Acronym.SetComponentValue(class'xVoting.xVotingHandler'.default.GameConfig[SaveIndex].Acronym, True); ed_Prefix.SetComponentValue(class'xVoting.xVotingHandler'.default.GameConfig[SaveIndex].Prefix, True); ed_Parameter.SetComponentValue(class'xVoting.xVotingHandler'.default.GameConfig[SaveIndex].Options, True); ch_Default.SetComponentValue(string(class'xVoting.xVotingHandler'.default.DefaultGameConfig == SaveIndex), True); Split(class'xVoting.xVotingHandler'.default.GameConfig[SaveIndex].Mutators, ",", MutatorArray); for(i=0; i=0) { class'xVoting.xVotingHandler'.default.GameConfig.Remove(SaveIndex,1); class'xVoting.xVotingHandler'.static.StaticSaveConfig(); } if (ListIndex>=0) { for (i=0;i SaveIndex ) lb_GameconfigList.List.SetExtraAtIndex(i,""$(x-1)); } lb_GameConfigList.List.Remove(ListIndex,1); } SaveIndex = -1; ListIndex = -1; if (lb_GameConfigList.List.ItemCount==0) { DisableComponent(b_Delete); co_GameClass.SetIndex(-1); ed_GameTitle.SetComponentValue("", True); ed_Acronym.SetComponentValue("", True); ed_Prefix.SetComponentValue("", True); ed_Parameter.SetComponentValue("", True); ch_Default.SetComponentValue("False", True); DisableComponent(co_GameClass); DisableComponent(ed_GameTitle); DisableComponent(ed_Acronym); DisableComponent(ed_Prefix); DisableComponent(ed_Parameter); DisableComponent(lb_Mutator); DisableComponent(ch_Default); bChanged=false; } else lb_GameConfigList.List.SetIndex(0); return true; } defaultproperties { OnOpen=InternalOnOpen Begin Object class=AltSectionBackground name=SBList Caption="GameTypes" WinWidth=0.377929 WinHeight=0.753907 WinLeft=0.042969 WinTop=0.044272 bFillClient=true End Object sb_List=SBList Begin Object class=ALtSectionBackground name=SBList2 Caption="Mutators" //HeaderBase=Texture'InterfaceArt_tex.Menu.changeme_texture' //material'2K4Menus.NewControls.Display2' WinWidth=0.451250 WinHeight=0.295899 WinLeft=0.483359 WinTop=0.540159 TopPadding=0.1 BottomPadding=0.1 LeftPadding=0.0 RightPadding=0.0 RenderWeight=0.49; End Object sb_List2=SBList2 Begin Object Class=GUIListBox Name=GameConfigListBox Hint="Select a game configuration to edit or delete." WinWidth=0.344087 WinHeight=0.727759 WinLeft=0.626758 WinTop=0.160775 TabOrder=0 bVisibleWhenEmpty=true End Object lb_GameConfigList = GameConfigListBox Begin Object class=GUIButton Name=NewButton Caption="New" Hint="Create a new game configuration." StyleName="SquareButton" TabOrder=1 OnClick=NewButtonClick WinWidth=0.158281 WinLeft=0.060047 WinTop=0.913925 End Object b_New=NewButton Begin Object class=GUIButton Name=DeleteButton Caption="Delete" Hint="Delete the selected game configuration." StyleName="SquareButton" TabOrder=2 OnClick=DeleteButtonClick WinWidth=0.159531 WinLeft=0.268403 WinTop=0.913925 MenuState=MSAT_Disabled End Object b_Delete=DeleteButton Begin Object Class=moEditBox Name=GameTitleEditBox Caption = "Game Title" Hint="Enter a custom game configuration title." TabOrder=3 WinWidth=0.592970 WinHeight=0.074249 WinLeft=0.028955 WinTop=0.223844 CaptionWidth=0.4 ComponentWidth=0.6 OnChange=FieldChange MenuState=MSAT_Disabled End Object ed_GameTitle = GameTitleEditBox Begin Object Class=moComboBox Name=GameClassComboBox Caption = "Game Class" Hint="Select a game type for the select game configuration." TabOrder=4 WinWidth=0.592970 WinHeight=0.076855 WinLeft=0.028955 WinTop=0.136135 CaptionWidth=0.4 ComponentWidth=0.6 OnChange=FieldChange MenuState=MSAT_Disabled End Object co_GameClass = GameClassComboBox Begin Object Class=moEditBox Name=AcronymEditBox //Caption = "Acronym" Caption = "Abbreviation" Hint="A short abbreviation, description, or acronym that identifies the game configuration. This will be appended to the map name in vote messages." TabOrder=5 WinWidth=0.592970 WinHeight=0.076855 WinLeft=0.028955 WinTop=0.306343 CaptionWidth=0.4 ComponentWidth=0.6 OnChange=FieldChange MenuState=MSAT_Disabled End Object ed_Acronym = AcronymEditBox Begin Object Class=moEditBox Name=PrefixEditBox Caption = "Map Prefixes" Hint="List of map name prefixes. Separate each with commas." WinWidth=0.592970 WinHeight=0.074249 WinLeft=0.028955 WinTop=0.393185 TabOrder=6 CaptionWidth=0.4 ComponentWidth=0.6 OnChange=FieldChange MenuState=MSAT_Disabled End Object ed_Prefix = PrefixEditBox Begin Object Class=moEditBox Name=ParameterEditBox Caption = "Parameters" Hint="(Advanced) List of game parameters with values. Separated each with a comma. (ex. GoalScore=4,MinPlayers=4)" WinWidth=0.490431 WinHeight=0.030000 WinLeft=0.077783 WinTop=0.826949 CaptionWidth=0.4 TabOrder=7 ComponentWidth=0.6 OnChange=FieldChange MenuState=MSAT_Disabled End Object ed_Parameter = ParameterEditBox Begin Object class=moCheckbox Name=DefaultCheckBox Caption="Default" Hint="The selected game configuration will be the default if all the players leave the server" CaptionWidth=0.8 ComponentWidth=0.2 OnChange=FieldChange TabOrder=8 WinWidth=0.194922 WinHeight=0.030000 WinLeft=0.659814 WinTop=0.826949 MenuState=MSAT_Disabled End Object ch_Default = DefaultCheckBox Begin Object Class=MultiSelectListBox Name=MutatorListBox Hint="Select each mutator that should be loaded with this game configuration." WinWidth=0.396485 WinHeight=0.315234 WinLeft=0.224267 WinTop=0.484369 TabOrder=9 bVisibleWhenEmpty=true OnChange=FieldChange MenuState=MSAT_Disabled End Object lb_Mutator = MutatorListBox Background=None bAcceptsInput=false WinWidth=0.917187 WinHeight=0.885075 WinLeft=0.041015 WinTop=0.031510 DefaultWidth=0.917187 DefaultHeight=0.885075 DefaultLeft=0.041015 DefaultTop=0.031510 WindowName="Map Voting Game Configuration" lmsgNew="New" lmsgAdd="Add" ListIndex=-1; SaveIndex=-1; }