Advertisement
Guest User

movementKeys

a guest
Jan 4th, 2016
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.07 KB | None | 0 0
  1. --------------------------------------------------------------------------------
  2. -- This is an official Reflex script. Do not modify.
  3. --
  4. -- If you wish to customize this widget, please:
  5. --  * clone this file to a new file
  6. --  * rename the widget MyWidget
  7. --  * set this widget to not visible (via options menu)
  8. --  * set your new widget to visible (via options menu)
  9. --
  10. --------------------------------------------------------------------------------
  11.  
  12. MovementKeysSpecOnly =
  13. {
  14. };
  15.  
  16. registerWidget("MovementKeysSpecOnly");
  17.  
  18. -------------------------------------------------------------------------
  19. -------------------------------------------------------------------------
  20.  
  21. function MovementKeysSpecOnly:initialize()
  22.    
  23.  
  24. end
  25.  
  26. -------------------------------------------------------------------------
  27. -------------------------------------------------------------------------
  28.  
  29. function MovementKeysSpecOnly:draw()
  30.  
  31.   if not shouldShowHUD() then return end
  32.  
  33.   local localPl = getLocalPlayer()
  34.   local specPl = getPlayer()
  35.  
  36.   if (localPl.state ~= PLAYER_STATE_SPECTATOR and localPl.state ~= PLAYER_STATE_QUEUED) then return end
  37.       local leftArrowIcon = "internal/ui/icons/keyLeft"
  38.       local upArrowIcon = "internal/ui/icons/keyForward"
  39.       local rightArrowIcon = "internal/ui/icons/keyRight"
  40.       local downArrowIcon = "internal/ui/icons/keyBack"
  41.       local jumpIcon = "internal/ui/icons/keyJump"
  42.  
  43.       local arrowIconSize = 10
  44.       local arrowIconColor = Color(255,255,255,255)
  45.  
  46.       if specPl.buttons.left then
  47.         nvgFillColor(arrowIconColor);
  48.         nvgSvg(leftArrowIcon, -30, 0, arrowIconSize);
  49.       end
  50.       if specPl.buttons.forward then
  51.         nvgFillColor(arrowIconColor);
  52.         nvgSvg(upArrowIcon, 0, -30, arrowIconSize);
  53.       end
  54.       if specPl.buttons.right then
  55.         nvgFillColor(arrowIconColor);
  56.         nvgSvg(rightArrowIcon, 30, 0, arrowIconSize);
  57.       end
  58.       if specPl.buttons.back then
  59.         nvgFillColor(arrowIconColor);
  60.         nvgSvg(downArrowIcon, 0, 30, arrowIconSize);
  61.       end
  62.       if specPl.buttons.jump then
  63.         nvgFillColor(arrowIconColor);
  64.         nvgSvg(jumpIcon, 30, 30, arrowIconSize);
  65.       end
  66. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement