hud.cpp 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. Minetest
  3. Copyright (C) 2010-2018 celeron55, Perttu Ahola <celeron55@gmail.com>
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU Lesser General Public License as published by
  6. the Free Software Foundation; either version 2.1 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public License along
  13. with this program; if not, write to the Free Software Foundation, Inc.,
  14. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  15. */
  16. #include "hud.h"
  17. #include <cmath>
  18. const struct EnumString es_HudElementType[] =
  19. {
  20. {HUD_ELEM_IMAGE, "image"},
  21. {HUD_ELEM_TEXT, "text"},
  22. {HUD_ELEM_STATBAR, "statbar"},
  23. {HUD_ELEM_INVENTORY, "inventory"},
  24. {HUD_ELEM_WAYPOINT, "waypoint"},
  25. {HUD_ELEM_IMAGE_WAYPOINT, "image_waypoint"},
  26. {HUD_ELEM_COMPASS, "compass"},
  27. {HUD_ELEM_MINIMAP, "minimap"},
  28. {0, NULL},
  29. };
  30. const struct EnumString es_HudElementStat[] =
  31. {
  32. {HUD_STAT_POS, "position"},
  33. {HUD_STAT_POS, "pos"}, /* Deprecated, only for compatibility's sake */
  34. {HUD_STAT_NAME, "name"},
  35. {HUD_STAT_SCALE, "scale"},
  36. {HUD_STAT_TEXT, "text"},
  37. {HUD_STAT_NUMBER, "number"},
  38. {HUD_STAT_ITEM, "item"},
  39. {HUD_STAT_ITEM, "precision"},
  40. {HUD_STAT_DIR, "direction"},
  41. {HUD_STAT_ALIGN, "alignment"},
  42. {HUD_STAT_OFFSET, "offset"},
  43. {HUD_STAT_WORLD_POS, "world_pos"},
  44. {HUD_STAT_SIZE, "size"},
  45. {HUD_STAT_Z_INDEX, "z_index"},
  46. {HUD_STAT_TEXT2, "text2"},
  47. {HUD_STAT_STYLE, "style"},
  48. {0, NULL},
  49. };
  50. const struct EnumString es_HudBuiltinElement[] =
  51. {
  52. {HUD_FLAG_HOTBAR_VISIBLE, "hotbar"},
  53. {HUD_FLAG_HEALTHBAR_VISIBLE, "healthbar"},
  54. {HUD_FLAG_CROSSHAIR_VISIBLE, "crosshair"},
  55. {HUD_FLAG_WIELDITEM_VISIBLE, "wielditem"},
  56. {HUD_FLAG_BREATHBAR_VISIBLE, "breathbar"},
  57. {HUD_FLAG_MINIMAP_VISIBLE, "minimap"},
  58. {HUD_FLAG_MINIMAP_RADAR_VISIBLE, "minimap_radar"},
  59. {HUD_FLAG_BASIC_DEBUG, "basic_debug"},
  60. {HUD_FLAG_CHAT_VISIBLE, "chat"},
  61. {0, NULL},
  62. };