ui.hpp 640 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #pragma once
  2. #include "saura/core/server/server.hpp"
  3. #include <cstdint>
  4. #include <imgui.h>
  5. #include <memory>
  6. #include <string>
  7. #include <vector>
  8. namespace saura {
  9. struct Entity {
  10. std::string uuid;
  11. uint32_t local_tmp_id;
  12. std::string title;
  13. std::string url;
  14. struct {
  15. ImVec2 min;
  16. ImVec2 max;
  17. } rect;
  18. };
  19. struct ServerInfo {
  20. bool is_connect;
  21. };
  22. class UI {
  23. private:
  24. Entity *current_ent;
  25. std::vector<Entity> entities;
  26. ServerInfo server_info;
  27. struct {
  28. std::weak_ptr<ServerAPI> server_api_ctx;
  29. } deps;
  30. public:
  31. UI(std::shared_ptr<ServerAPI> server_api_ctx);
  32. ~UI();
  33. void draw();
  34. };
  35. } // namespace saura