//============================================================================= // SiegeHUD // // Implements some pause menu for testing. //============================================================================= class SiegeHUD extends GUICompatibleHUD; var bool bPauseMenuIsOpen; simulated event PostBeginPlay() { local GUIComponent InitComp; InitComp = self.FindComponentByName("ExitButton"); InitComp.OnMousePressed = ExitButtonPressed; super.PostBeginPlay(); } exec function ShowMenu() { TogglePauseMenu(); } function TogglePauseMenu() { if (bPauseMenuIsOpen) // stop pause { bDrawGUIComponents = False; bCaptureMouseInput = False; PlayerOwner.SetPause(False); bPauseMenuIsOpen = False; } else // start pause { PlayerOwner.SetPause(True); bDrawGUIComponents = True; bCaptureMouseInput = True; bPauseMenuIsOpen = True; } } function ExitButtonPressed(GUIComponent Component, byte ButtonNum) { ConsoleCommand("open UDKFrontEndMap"); } DefaultProperties { bDrawGUIComponents = False Begin Object Class=GUIButtonComponent Name=ExitButton PosX = 0.4 PosY = 0.4 PosXEnd = 0.6 PosYEnd = 0.6 bEnabled = True bRelativePosX = True bRelativePosY = True bRelativeWidth = True bRelativeHeight = True bFitComponentToTexture = False // normal DrawInfo(0) = (ComponentTexture=Texture2D'SI_GUI.ButtonTest', SubUVEnd=(X=256, Y=128)) CaptionInfo(0) = (CaptionColor=(R=0, G=0, B=0)) // hover-selected DrawInfo(1) = (ComponentTexture=Texture2D'SI_GUI.ButtonTest', SubUVEnd=(X=256, Y=128)) CaptionInfo(1) = (CaptionColor=(R=0 ,G=0 ,B=0)) // pressed DrawInfo(3) = (ComponentTexture=Texture2D'SI_GUI.ButtonTest', SubUVEnd=(X=256, Y=128)) CaptionInfo(3) = (CaptionColor=(R=0 ,G=0 ,B=0)) End Object GuiComponents.Add(ExitButton) }