Advertisement
aleosiss

Untitled

Feb 9th, 2019
1,387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Courtesy of bountygiver
  2. exec function RT_TestPanelLocation(int X, int Y, optional int Width = -1, optional int Height = -1, optional name PanelName = 'TestDebugPanel')
  3. {
  4.     local UIScreen Screen;
  5.     local UIBGBox BGPanel;
  6.     local UIPanel Panel;
  7.  
  8.     Screen = `SCREENSTACK.GetCurrentScreen();
  9.  
  10.     `RTLOG("Using " $ Screen.MCName $ " as the base for the TestPanel!");
  11.  
  12.     Panel = Screen.GetChildByName(PanelName, false);
  13.     if(Width == -1 || Height == -1) {
  14.         Width = 32;
  15.         Height = 32;
  16.     }
  17.  
  18.  
  19.     if (Panel != none)
  20.     {
  21.         Panel.SetPosition(X, Y);
  22.         Panel.SetSize(Width, Height);
  23.     }
  24.     else
  25.     {
  26.         `RTLOG("Couldn't find a " $ PanelName $ ", creating one!");
  27.         BGPanel = Screen.Spawn(class'UIBGBox', Screen);
  28.         BGPanel.InitBG(PanelName, X, Y, Width, Height);
  29.         BGPanel.SetBGColorState(eUIState_Cash);
  30.         BGPanel.AnimateIn(0);
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement