Advertisement
Guest User

termGetColors

a guest
Aug 26th, 2015
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. if _CC_VERSION == nil then
  2. print("Patching term.getTextColor() and term.getBackgroundColor() in due to pre1.74 CC.")
  3. sleep(0.1)
  4. oldTermSetTextColor = term.setTextColor
  5. oldTermSetBackColor = term.setBackgroundColor
  6. currentTermGetTextColor = colors.white
  7. currentTermGetBackColor = colors.black
  8. function term.setTextColor(color)
  9. oldTermSetTextColor(color)
  10. currentTermGetTextColor = color
  11. end
  12. function term.setBackgroundColor(color)
  13. oldTermSetBackColor(color)
  14. currentTermGetBackColor = color
  15. end
  16. function term.getTextColor()
  17. return currentTermGetTextColor
  18. end
  19. function term.getBackgroundColor()
  20. return currentTermGetBackColor
  21. end
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement