interop.lua 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. local S=physio_stress.intllib
  2. function physio_stress.hud_init(player,col)
  3. return
  4. end
  5. function physio_stress.hud_update(player, col, value)
  6. return
  7. end
  8. if minetest.get_modpath("hudbars") then
  9. hb.register_hudbar('exhaustion', 0xffffff, S("Exhaustion"), {
  10. bar = 'physio_stress_hudbars_bar.png^[colorize:#aa7788',
  11. icon = 'physio_stress_exhaust_16.png'
  12. }, 20, 20, false)
  13. if physio_stress.attributes.saturation then
  14. hb.register_hudbar('saturation', 0xffffff, S("Saturation"), {
  15. bar = 'physio_stress_hudbars_bar.png^[colorize:#ffff00',
  16. icon = 'physio_stress_hunger.png'
  17. }, physio_stress.saturationmax, physio_stress.saturationmax, false)
  18. end
  19. if physio_stress.attributes.thirst then
  20. hb.register_hudbar('thirst', 0xffffff, S("Thirst"), {
  21. bar = 'physio_stress_hudbars_bar.png^[colorize:#0000ff',
  22. icon = 'physio_stress_thirst.png'
  23. }, physio_stress.thirstmax, physio_stress.thirstmax, false)
  24. end
  25. function physio_stress.hud_init(player,col)
  26. if col == nil then
  27. return
  28. end
  29. hb.init_hudbar(player, col ,physio_stress.hud_clamp(xpfw.player_get_attribute(player, col)),20, false)
  30. end
  31. function physio_stress.hud_update(player, col, value)
  32. if col == nil then
  33. return
  34. end
  35. if value == nil then
  36. return
  37. end
  38. hb.change_hudbar(player, col, physio_stress.hud_clamp(value), 20)
  39. end
  40. end