Advertisement
Guest User

Untitled

a guest
Oct 6th, 2011
434
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // SiegeHUD
  3. //
  4. // Implements some pause menu for testing.
  5. //=============================================================================
  6. class SiegeHUD extends GUICompatibleHUD;
  7.  
  8. var bool bPauseMenuIsOpen;
  9.  
  10.  
  11. simulated event PostBeginPlay()
  12. {
  13.     local GUIComponent InitComp;
  14.  
  15.     InitComp = self.FindComponentByName("ExitButton");
  16.     InitComp.OnMousePressed = ExitButtonPressed;
  17.  
  18.     super.PostBeginPlay();
  19. }
  20.  
  21.  
  22. exec function ShowMenu()
  23. {
  24.     TogglePauseMenu();
  25. }
  26.  
  27. function TogglePauseMenu()
  28. {
  29.     if (bPauseMenuIsOpen) // stop pause
  30.     {
  31.         bDrawGUIComponents = False;
  32.         bCaptureMouseInput = False;
  33.         PlayerOwner.SetPause(False);
  34.         bPauseMenuIsOpen = False;
  35.     }
  36.     else // start pause
  37.     {
  38.         PlayerOwner.SetPause(True);
  39.         bDrawGUIComponents = True;
  40.         bCaptureMouseInput = True;
  41.         bPauseMenuIsOpen = True;
  42.     }
  43. }
  44.  
  45.  
  46. function ExitButtonPressed(GUIComponent Component, byte ButtonNum)
  47. {
  48.     ConsoleCommand("open UDKFrontEndMap");
  49. }
  50.  
  51.  
  52. DefaultProperties
  53. {
  54.     bDrawGUIComponents = False
  55.  
  56.     Begin Object Class=GUIButtonComponent Name=ExitButton
  57.         PosX = 0.4
  58.         PosY = 0.4
  59.         PosXEnd = 0.6
  60.         PosYEnd = 0.6
  61.         bEnabled = True
  62.         bRelativePosX = True
  63.         bRelativePosY = True
  64.         bRelativeWidth = True
  65.         bRelativeHeight = True
  66.         bFitComponentToTexture = False
  67.  
  68.         // normal
  69.         DrawInfo(0) = (ComponentTexture=Texture2D'SI_GUI.ButtonTest', SubUVEnd=(X=256, Y=128))
  70.         CaptionInfo(0) = (CaptionColor=(R=0, G=0, B=0))
  71.  
  72.         // hover-selected
  73.         DrawInfo(1) = (ComponentTexture=Texture2D'SI_GUI.ButtonTest', SubUVEnd=(X=256, Y=128))
  74.         CaptionInfo(1) = (CaptionColor=(R=0 ,G=0 ,B=0))
  75.  
  76.         // pressed
  77.         DrawInfo(3) = (ComponentTexture=Texture2D'SI_GUI.ButtonTest', SubUVEnd=(X=256, Y=128))
  78.         CaptionInfo(3) = (CaptionColor=(R=0 ,G=0 ,B=0))
  79.     End Object
  80.     GuiComponents.Add(ExitButton)
  81. }
  82.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement