Advertisement
Guest User

Untitled

a guest
Apr 5th, 2020
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.14 KB | None | 0 0
  1. -- Init Menu
  2. Menu.Spacing()
  3. Menu.Separator()
  4. Menu.Spacing()
  5. Menu.Combo( "Show Buttons", "iShowButtons", {"None", "Normal", "Movement" }, 0);
  6. Menu.SliderFloat("Show Buttons Pos Y", "fShowButtonsY", 0, 10, "%.2f", 1.2)
  7.  
  8. -- Init Global
  9. local Screen = IEngine.GetScreenSize()
  10.  
  11. -- Customize
  12. local x = Globals.ScreenWidth() / 2
  13. local y = Globals.ScreenHeight() - 150
  14. local ButonSize = 50
  15. local Offset = 10
  16. local TextSize1 = 18
  17. local TextSize2 = 19
  18. local col1 = Color.new(100, 100, 100, 255)
  19. local col2 = Color.new(0, 0, 0, 255)
  20. local col0 = Color.new(255, 255, 255, 255)
  21. local col3 = Color.new(0, 0, 0, 255)
  22.  
  23. --
  24. local w = Offset * 2 + ButonSize * 3
  25. local h = Offset * 2 + ButonSize * 3
  26.  
  27. function RenderButton(VK_ID, x1, y1, w, h, Text)
  28.     if InputSys.IsKeyDown(VK_ID) then
  29.         Render.RectFilled(x1, y1, x1 + w, y1 + h, col2, 5)
  30.     else
  31.         Render.RectFilled(x1, y1, x1 + w, y1 + h, col1, 5)        
  32.     end
  33.  
  34.     Render.Text_1(Text, x1 + h / 2, y1 + h / 2 - TextSize1 / 2, TextSize1, col3, true, false)
  35. end
  36.  
  37. function RenderButton2(VK_ID, x1, y1, w, h, Text)
  38.     if InputSys.IsKeyDown(VK_ID) then
  39.         Render.Text_1(Text, x1 + h / 2, y1 + h / 2 - TextSize2 / 2, TextSize2, col0, true, true)
  40.     else
  41.         Render.Text_1("_", x1 + h / 2, y1 + h / 2 - TextSize2 / 2, TextSize2, col0, true, true)    
  42.     end
  43. end
  44.  
  45. function PaintTraverse()
  46.     if (not Menu.GetInt("iShowButtons")) then
  47.         return
  48.     end
  49.  
  50.     if (not Utils.IsLocalAlive()) then
  51.         return
  52.     end
  53.  
  54.     y = Globals.ScreenHeight() / Menu.GetFloat("fShowButtonsY")
  55.  
  56.     if (Menu.GetInt("iShowButtons") == 1) then
  57.         RenderButton(0x01, x - w / 2, y - h / 2, ButonSize, ButonSize, "M1")
  58.         RenderButton(0x57, x - w / 2 + ButonSize + Offset, y - h / 2, ButonSize, ButonSize, "W")
  59.         RenderButton(0x02, x - w / 2 + ButonSize * 2 + Offset * 2, y - h / 2, ButonSize, ButonSize, "M2")
  60.  
  61.         RenderButton(0x41, x - w / 2, y - h / 2 + ButonSize + Offset, ButonSize, ButonSize, "A")
  62.         RenderButton(0x53, x - w / 2 + ButonSize + Offset, y - h / 2 + ButonSize + Offset, ButonSize, ButonSize, "S")
  63.         RenderButton(0x44, x - w / 2 + ButonSize * 2 + Offset * 2, y - h / 2 + ButonSize + Offset, ButonSize, ButonSize, "D")
  64.  
  65.         RenderButton(0x10, x - w / 2, y - h / 2 + ButonSize * 2 + Offset * 2, ButonSize, ButonSize, "Shift")
  66.         RenderButton(0x20, x - w / 2 + ButonSize + Offset, y - h / 2 + ButonSize * 2 + Offset * 2, ButonSize, ButonSize, "Space")
  67.         RenderButton(0x11, x - w / 2 + ButonSize * 2 + Offset * 2, y - h / 2 + ButonSize * 2 + Offset * 2, ButonSize, ButonSize, "Ctrl")
  68.     elseif (Menu.GetInt("iShowButtons") == 2) then
  69.         RenderButton2(0x41, x - w / 3, y - h / 3, ButonSize, ButonSize, "a")
  70.         RenderButton2(0x57, x - w / 2 + ButonSize + Offset, y - h / 2, ButonSize, ButonSize, "w")
  71.         RenderButton2(0x44, x - w / 3 + ButonSize + Offset, y - h / 3, ButonSize, ButonSize, "d")
  72.    
  73.         RenderButton2(0x11, x - w / 2 + ButonSize + Offset, y - h / 200, ButonSize, ButonSize, "ctrl")
  74.         RenderButton2(0x53, x - w / 2 + ButonSize + Offset, y - h / 3, ButonSize, ButonSize, "s")
  75.         RenderButton2(0x20, x - w / 2 + ButonSize + Offset, y - h / 7, ButonSize, ButonSize, "space")
  76.     end
  77. end
  78. Hack.RegisterCallback("PaintTraverse", PaintTraverse)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement