// ==================================================================== // Class: XInterface.UT2QuitPage // Parent: XInterface.GUIMultiComponent // // // ==================================================================== class SchlonzVotingPage extends LargeWindow; var string SchlonzVoteIP; var int SchlonzVotePort; var automated moComboBox co_quali, co_size, co_terrain, co_deco, co_path; var automated moCheckbox co_vehicles, co_powernodes, co_weapons, co_editorr, co_example, co_ban, co_alwayscancel; var automated moEditBox co_ed_editorr, co_ed_example, co_ed_general, co_ed_bots; var automated GUIButton b_Ok, b_Cancel, b_Cycle; var automated GUILabel l_votecnt, l_quali, l_size, l_terrain, l_deco, l_bots; /* replication { // Variables the server should send to the client only initially reliable if( Role==ROLE_Authority ) SchlonzVoteIP, SchlonzVotePort; } */ function InitComponent(GUIController MyController, GUIComponent MyOwner) { local PlayerController PC; local SchlonzUdpLink mysock; Super.Initcomponent(MyController, MyOwner); PC = PlayerOwner(); InitializeCombos(); co_path.SetIndex( 1 ); co_vehicles.Checked( true ); co_powernodes.Checked( true ); co_weapons.Checked( true ); co_alwayscancel.Checked( SchlonzControllerPlayer( PlayerOwner() ).CancelAlways ); mysock = PC.Spawn( class'SchlonzUT.SchlonzUdpLink' ); if( mysock != None ) { mysock.setIpPort( SchlonzControllerPlayer( PlayerOwner() ).SchlonzVoteIP, SchlonzControllerPlayer( PlayerOwner() ).SchlonzVotePort ); mysock.bindNextAvail(); mysock.GetVote( Self ); } // Turn pause off if currently paused (stops replication) if(PlayerOwner() != None && PlayerOwner().Level.Pauser != None) PlayerOwner().SetPause(false); } // InitComponent function Free() { Super.Free(); } // Free simulated function bool MyButtonClicked(GUIComponent Sender) { local GameStats gs; local string text; text = ""; text $= ""; text $= ""; text $= ""; text $= ""; text $= ""; text $= ""; text $= ""; text $= ""; text $= ""; text $= ""; text $= ""; text $= ""; text $= ""; text $= ""; text $= ""; gs = PlayerOwner().Spawn( class'GameStats' ); text $= "" $ ""; gs.Destroy(); if ( Sender == b_Ok ) { text $= ""; SchlonzControllerPlayer( PlayerOwner() ).SendMapVote( text ); } else if( Sender == b_Cycle ) { text $= ""; SchlonzControllerPlayer( PlayerOwner() ).SendCycle( text ); } else if( Sender == b_Cancel ) { text = "Cancel"; SchlonzControllerPlayer( PlayerOwner() ).SendMapVote( text ); } Controller.CloseMenu( false ); return true; } // MyButtonClicked function InternalOnChange(GUIComponent Sender) { switch (Sender) { case co_alwayscancel: SchlonzControllerPlayer( PlayerOwner() ).SetCancelAlways( co_alwayscancel.IsChecked() ); break; } } // InternalOnChange function InitializeCombos() { local int i; local array Options; for (i = 0; i < Components.Length; i++) { if (moComboBox(Components[i]) != None) { GetComboOptions( moComboBox(Components[i]), Options ); moComboBox(Components[i]).MyComboBox.List.Elements = Options; moComboBox(Components[i]).MyComboBox.List.ItemCount = Options.Length; moComboBox(Components[i]).ReadOnly(True); } } } // InitializeCombos final function GetComboOptions(moComboBox Combo, out array Ar) { Ar.Remove(0, Ar.Length); if (Combo == None) return; switch (Combo) { case co_terrain: case co_deco: case co_quali: Ar.Length = 10; Ar[0].Item = "----"; Ar[1].Item = "---"; Ar[2].Item = "--"; Ar[3].Item = "-"; Ar[4].Item = "="; Ar[5].Item = "+"; Ar[6].Item = "++"; Ar[7].Item = "+++"; Ar[8].Item = "++++"; Ar[9].Item = "+++++"; break; case co_size: Ar.Length = 8; Ar[0].Item = "tiny"; Ar[1].Item = "very small"; Ar[2].Item = "small"; Ar[3].Item = "medium"; Ar[4].Item = "big"; Ar[5].Item = "large"; Ar[6].Item = "very large"; Ar[7].Item = "fucking big"; break; case co_path: Ar.Length = 4; Ar[0].Item = "none"; Ar[1].Item = "ok"; Ar[2].Item = "goood"; Ar[3].Item = "that's it"; break; /* case co_quali: Ar.Length = 7; Ar[0].Item = "cool"; Ar[1].Item = "very good"; Ar[2].Item = "good"; Ar[3].Item = "playable"; Ar[4].Item = "bad"; Ar[5].Item = "very bad"; Ar[6].Item = "fuck you"; break; case co_terrain: case co_deco: Ar.Length = 3; Ar[0].Item = "cool"; Ar[1].Item = "ok"; Ar[2].Item = "bad"; break; case co_size: Ar.Length = 4; Ar[0].Item = "big"; Ar[1].Item = "medium"; Ar[2].Item = "small"; Ar[3].Item = "tiny"; break; */ } } // GetComboOptions /* Begin Object Class=moEditBox Name=EdQuali CaptionWidth=0.000000 Caption="" OnCreateComponent=EdQuali.InternalOnCreateComponent WinTop=0.200000 WinLeft=0.500000 WinWidth=0.200000 RenderWeight=1.040000 TabOrder=14 End Object Begin Object Class=GUILabel Name=La1 Caption="XXXX" WinTop=0.200000 WinLeft=0.500000 WinWidth=0.200000 End Object l_l1=GUILabel'SchlonzUT.SchlonzVotingPage.La1' */ defaultproperties { Begin Object Class=GUILabel Name=LaVote Caption="Vote Count: " WinTop=0.135000 WinLeft=0.150000 WinWidth=0.600000 End Object l_votecnt=GUILabel'SchlonzUT.SchlonzVotingPage.LaVote' Begin Object Class=moComboBox Name=DetailQuali ComponentJustification=TXTA_Left CaptionWidth=0.400000 Caption="Quality" OnCreateComponent=DetailQuali.InternalOnCreateComponent Hint="Game Quality for the map" WinTop=0.200000 WinLeft=0.150000 WinWidth=0.300000 TabOrder=0 End Object co_quali=moComboBox'SchlonzUT.SchlonzVotingPage.DetailQuali' Begin Object Class=GUILabel Name=LaQuali Caption="XXXX" WinTop=0.185000 WinLeft=0.460000 WinWidth=0.200000 End Object l_quali=GUILabel'SchlonzUT.SchlonzVotingPage.LaQuali' Begin Object Class=moComboBox Name=DetailSize ComponentJustification=TXTA_Left CaptionWidth=0.400000 Caption="Size" OnCreateComponent=DetailSize.InternalOnCreateComponent Hint="select terrain quality" WinTop=0.250000 WinLeft=0.150000 WinWidth=0.300000 TabOrder=2 End Object co_size=moComboBox'SchlonzUT.SchlonzVotingPage.DetailSize' Begin Object Class=GUILabel Name=LaSize Caption="XXXX" WinTop=0.235000 WinLeft=0.460000 WinWidth=0.200000 End Object l_size=GUILabel'SchlonzUT.SchlonzVotingPage.LaSize' Begin Object Class=moComboBox Name=DetailTerrain ComponentJustification=TXTA_Left CaptionWidth=0.400000 Caption="Terrain" OnCreateComponent=DetailTerrain.InternalOnCreateComponent Hint="select terrain quality" WinTop=0.300000 WinLeft=0.150000 WinWidth=0.300000 TabOrder=3 End Object co_terrain=moComboBox'SchlonzUT.SchlonzVotingPage.DetailTerrain' Begin Object Class=GUILabel Name=LaTerrain Caption="XXXX" WinTop=0.285000 WinLeft=0.460000 WinWidth=0.200000 End Object l_terrain=GUILabel'SchlonzUT.SchlonzVotingPage.LaTerrain' Begin Object Class=moComboBox Name=DetailDeco ComponentJustification=TXTA_Left CaptionWidth=0.400000 Caption="Decoration" OnCreateComponent=DetailDeco.InternalOnCreateComponent Hint="select decoration quality" WinTop=0.350000 WinLeft=0.150000 WinWidth=0.300000 TabOrder=4 End Object co_deco=moComboBox'SchlonzUT.SchlonzVotingPage.DetailDeco' Begin Object Class=GUILabel Name=LaDeco Caption="XXXX" WinTop=0.335000 WinLeft=0.460000 WinWidth=0.200000 End Object l_deco=GUILabel'SchlonzUT.SchlonzVotingPage.LaDeco' Begin Object Class=moComboBox Name=PathNodes ComponentJustification=TXTA_Left CaptionWidth=0.400000 Caption="PathNodes" OnCreateComponent=PathNodes.InternalOnCreateComponent Hint="Level has PathNodes" WinTop=0.200000 WinLeft=0.600000 WinWidth=0.200000 RenderWeight=1.040000 TabOrder=5 End Object co_path=moComboBox'SchlonzUT.SchlonzVotingPage.PathNodes' Begin Object Class=moCheckBox Name=Vehicles CaptionWidth=0.200000 Caption="Vehicules" OnCreateComponent=Vehicles.InternalOnCreateComponent Hint="Level has Vehicles" WinTop=0.250000 WinLeft=0.600000 WinWidth=0.200000 RenderWeight=1.040000 TabOrder=6 End Object co_vehicles=moCheckBox'SchlonzUT.SchlonzVotingPage.Vehicles' Begin Object Class=moCheckBox Name=PowerNodes CaptionWidth=0.200000 Caption="PowerNodes" OnCreateComponent=PowerNodes.InternalOnCreateComponent Hint="Level has PowerNodes" WinTop=0.300000 WinLeft=0.600000 WinWidth=0.200000 RenderWeight=1.040000 TabOrder=7 End Object co_powernodes=moCheckBox'SchlonzUT.SchlonzVotingPage.PowerNodes' Begin Object Class=moCheckBox Name=Weapons CaptionWidth=0.250000 Caption="Weapons" OnCreateComponent=Weapons.InternalOnCreateComponent Hint="Level has Weapons" WinTop=0.350000 WinLeft=0.600000 WinWidth=0.200000 RenderWeight=1.040000 TabOrder=8 End Object co_weapons=moCheckBox'SchlonzUT.SchlonzVotingPage.Weapons' Begin Object Class=moCheckBox Name=Editorr CaptionWidth=0.100000 Caption="Editorr" OnCreateComponent=Editorr.InternalOnCreateComponent Hint="it's worth to change the level in the editor" WinTop=0.400000 WinLeft=0.150000 WinWidth=0.150000 RenderWeight=1.040000 TabOrder=9 End Object co_editorr=moCheckBox'SchlonzUT.SchlonzVotingPage.Editorr' Begin Object Class=moCheckBox Name=Example CaptionWidth=0.100000 Caption="Example" OnCreateComponent=Example.InternalOnCreateComponent Hint="it's worth to look at it in the editor" WinTop=0.450000 WinLeft=0.150000 WinWidth=0.150000 RenderWeight=1.040000 TabOrder=11 End Object co_example=moCheckBox'SchlonzUT.SchlonzVotingPage.Example' Begin Object Class=moEditBox Name=EdEditorr CaptionWidth=0.000000 OnCreateComponent=EdEditorr.InternalOnCreateComponent WinTop=0.400000 WinLeft=0.300000 RenderWeight=1.040000 TabOrder=10 End Object co_ed_editorr=moEditBox'SchlonzUT.SchlonzVotingPage.EdEditorr' Begin Object Class=moEditBox Name=EdExample CaptionWidth=0.000000 OnCreateComponent=EdExample.InternalOnCreateComponent WinTop=0.450000 WinLeft=0.300000 RenderWeight=1.040000 TabOrder=12 End Object co_ed_example=moEditBox'SchlonzUT.SchlonzVotingPage.EdExample' Begin Object Class=moEditBox Name=EdGeneral CaptionWidth=0.100000 Caption="General" OnCreateComponent=EdGeneral.InternalOnCreateComponent WinTop=0.500000 WinLeft=0.150000 WinWidth=0.650000 RenderWeight=1.040000 TabOrder=13 End Object co_ed_general=moEditBox'SchlonzUT.SchlonzVotingPage.EdGeneral' Begin Object Class=moEditBox Name=EdBots CaptionWidth=0.300000 Caption="NumBots " OnCreateComponent=EdBots.InternalOnCreateComponent WinTop=0.550000 WinLeft=0.150000 WinWidth=0.200000 RenderWeight=1.040000 TabOrder=14 End Object co_ed_bots=moEditBox'SchlonzUT.SchlonzVotingPage.EdBots' Begin Object Class=GUILabel Name=LaBots Caption="XXXX" WinTop=0.535000 WinLeft=0.360000 WinWidth=0.200000 End Object l_bots=GUILabel'SchlonzUT.SchlonzVotingPage.LaBots' Begin Object Class=moCheckBox Name=Ban CaptionWidth=0.100000 Caption="Ban" OnCreateComponent=Weapons.InternalOnCreateComponent Hint="Ban this Level" WinTop=0.600000 WinLeft=0.320000 WinWidth=0.100000 RenderWeight=1.040000 TabOrder=15 End Object co_ban=moCheckBox'SchlonzUT.SchlonzVotingPage.Ban' Begin Object Class=GUIButton Name=SaveSettings Caption="Vote !" Hint="do some Schlonz Voting" WinTop=0.700000 WinLeft=0.150000 WinWidth=0.100000 WinHeight=0.050000 TabOrder=16 OnClick=SchlonzVotingPage.MyButtonClicked OnKeyEvent=SaveSettings.InternalOnKeyEvent End Object b_OK=GUIButton'SchlonzUT.SchlonzVotingPage.SaveSettings' Begin Object Class=GUIButton Name=Cancel Caption="Cancel" Hint="Cancel" WinTop=0.700000 WinLeft=0.500000 WinWidth=0.100000 WinHeight=0.050000 TabOrder=17 OnClick=SchlonzVotingPage.MyButtonClicked OnKeyEvent=SaveSettings.InternalOnKeyEvent End Object b_Cancel=GUIButton'SchlonzUT.SchlonzVotingPage.Cancel' Begin Object Class=moCheckBox Name=AlwaysCancel CaptionWidth=0.200000 Caption="Cancel Always" OnCreateComponent=Weapons.InternalOnCreateComponent Hint="Ban this Level" WinTop=0.710000 WinLeft=0.600000 WinWidth=0.200000 RenderWeight=1.040000 TabOrder=19 OnChange=SchlonzVotingPage.InternalOnChange End Object co_alwayscancel=moCheckBox'SchlonzUT.SchlonzVotingPage.AlwaysCancel' Begin Object Class=GUIButton Name=Cycle Caption="Cycle" Hint="Cycle" WinTop=0.700000 WinLeft=0.320000 WinWidth=0.100000 WinHeight=0.050000 TabOrder=18 OnClick=SchlonzVotingPage.MyButtonClicked OnKeyEvent=SaveSettings.InternalOnKeyEvent End Object b_Cycle=GUIButton'SchlonzUT.SchlonzVotingPage.Cycle' WindowName="Schlonz Level Voting" bRequire640x480=False bAllowedAsLast=True WinTop=0.100000 WinLeft=0.100000 WinWidth=0.800000 WinHeight=0.800000 }