Advertisement
Guest User

Reflex MovementKey widget

a guest
Jan 4th, 2016
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.06 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.   if (pls ~= PLAYER_STATE_SPECTATOR and pls ~= PLAYER_STATE_QUEUED) then return end
  34.  
  35.   local localPl = getLocalPlayer()
  36.   local specPl = getPlayer()
  37.  
  38.   local leftArrowIcon = "internal/ui/icons/keyLeft"
  39.   local upArrowIcon = "internal/ui/icons/keyForward"
  40.   local rightArrowIcon = "internal/ui/icons/keyRight"
  41.   local downArrowIcon = "internal/ui/icons/keyBack"
  42.   local jumpIcon = "internal/ui/icons/keyJump"
  43.  
  44.   local arrowIconSize = 10
  45.   local arrowIconColor = Color(255,255,255,255)
  46.  
  47.   if specPl.buttons.left then
  48.     nvgFillColor(arrowIconColor);
  49.     nvgSvg(leftArrowIcon, -30, 0, arrowIconSize);
  50.   end
  51.   if specPl.buttons.forward then
  52.     nvgFillColor(arrowIconColor);
  53.     nvgSvg(upArrowIcon, 0, -30, arrowIconSize);
  54.   end
  55.   if specPl.buttons.right then
  56.     nvgFillColor(arrowIconColor);
  57.     nvgSvg(rightArrowIcon, 30, 0, arrowIconSize);
  58.   end
  59.   if specPl.buttons.back then
  60.     nvgFillColor(arrowIconColor);
  61.     nvgSvg(downArrowIcon, 0, 30, arrowIconSize);
  62.   end
  63.   if specPl.buttons.jump then
  64.     nvgFillColor(arrowIconColor);
  65.     nvgSvg(jumpIcon, 30, 30, arrowIconSize);
  66.   end
  67.  
  68. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement