ignored.lua 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. local vMod = vm_lighting_wand
  2. local _ignored_name = {}
  3. local _ignored_group = {}
  4. local _ignored_drawtype = {}
  5. local _ignored_onlighting = {} -- a check just before placing the light
  6. -- Add ignored
  7. vMod.add_ignored_group = function(name)
  8. _ignored_group[name] = true
  9. end
  10. vMod.add_ignored_name = function(name)
  11. _ignored_name[name] = true
  12. end
  13. vMod.add_ignored_drawtype = function(name)
  14. _ignored_drawtype[name] = true
  15. end
  16. vMod.add_ignored_onlighting = function(name)
  17. _ignored_onlighting[name] = true
  18. end
  19. -- Remove ignored
  20. vMod.remove_ignored_name = function(name)
  21. _ignored_name[name] = nil
  22. end
  23. vMod.remove_ignored_drawtype = function(name)
  24. _ignored_drawtype[name] = nil
  25. end
  26. vMod.remove_ignored_group = function(name)
  27. _ignored_group[name] = nil
  28. end
  29. vMod.remove_ignored_onlighting = function(name)
  30. _ignored_onlighting[name] = nil
  31. end
  32. -- test ignored
  33. vMod.is_ignored_name = function(name)
  34. return _ignored_name[name]
  35. end
  36. vMod.is_ignored_group = function(name)
  37. return _ignored_group[name]
  38. end
  39. vMod.is_ignored_drawtype = function(name)
  40. return _ignored_drawtype[name]
  41. end
  42. vMod.is_ignored_onlighting = function(name)
  43. return _ignored_onlighting[name]
  44. end
  45. -- defaults
  46. vMod.add_ignored_name("ignore")
  47. vMod.add_ignored_name("unknown")
  48. vMod.add_ignored_drawtype("airlike")
  49. vMod.add_ignored_group(vMod.modname .. "_ignored")