💿🐜 Antkeeper source code https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.2 KiB

  1. /*
  2. * Copyright (C) 2020 Christopher J. Howard
  3. *
  4. * This file is part of Antkeeper source code.
  5. *
  6. * Antkeeper source code is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * Antkeeper source code is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with Antkeeper source code. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef ANTKEEPER_UI_SYSTEM_HPP
  20. #define ANTKEEPER_UI_SYSTEM_HPP
  21. #include "event/event-handler.hpp"
  22. #include "event/input-events.hpp"
  23. #include "scene/scene.hpp"
  24. #include "scene/camera.hpp"
  25. #include "scene/directional-light.hpp"
  26. #include "scene/ambient-light.hpp"
  27. #include "scene/model-instance.hpp"
  28. #include "scene/billboard.hpp"
  29. #include "renderer/material.hpp"
  30. #include "math/math.hpp"
  31. class control;
  32. class scene;
  33. class resource_manager;
  34. class ui_system:
  35. public event_handler<mouse_moved_event>
  36. {
  37. public:
  38. ui_system(::resource_manager* resource_manager);
  39. void update(float dt);
  40. void set_viewport(const float4& viewport);
  41. void set_tool_menu_control(control* control);
  42. void set_camera(::camera* camera);
  43. void set_scene(::scene* scene);
  44. private:
  45. virtual void handle_event(const mouse_moved_event& event);
  46. void update_projection();
  47. void open_tool_menu();
  48. void close_tool_menu();
  49. void open_elevator_menu();
  50. void close_elevator_menu();
  51. resource_manager* resource_manager;
  52. scene* scene;
  53. camera* camera;
  54. ambient_light indirect_light;
  55. directional_light direct_light;
  56. model_instance tool_selector_ant;
  57. billboard tool_selector_bg;
  58. material modal_bg_material;
  59. billboard modal_bg;
  60. billboard underground_bg;
  61. model_instance energy_symbol;
  62. float2 mouse_position;
  63. float4 viewport;
  64. float2 viewport_center;
  65. float2 tool_selection_vector;
  66. control* tool_menu_control;
  67. };
  68. #endif // ANTKEEPER_UI_SYSTEM_HPP