TazGraph Project v0.1.0
Loading...
Searching...
No Matches
EditorIMGUI.h
1#pragma once
2
3#include "../Map/Map.h"
4#include <algorithm>
5#include <vector>
6#include <string>
7#include <filesystem>
8#include "ImGuiInterface/ImGuiInterface.h"
9#include "imguiComboAutoselect/imgui_combo_autoselect.h"
10#include "BaseFPSLimiter/BaseFPSLimiter.h"
11
12#include "CustomFunctions/CustomFunctions.h"
13#include "./EditorLayoutUtils.h"
14
15namespace fs = std::filesystem;
16
17// it is to provide the ImgUI functions for the whole project
19private:
20 std::vector<std::string> _fileNames;
21 char _newFileName[126] = "";
22 std::vector<std::string> _pollingFileNames;
23 ImGui::ComboAutoSelectData _data;
24 int _currentOrientationIndex = 0;
25
26 bool _filesLoaded = false;
27
28 bool _isSaving = false;
29 bool _isStartingNew = false;
30 bool _isLoading = false;
31 bool _goingBack = false;
32
33 CustomFunctions _customFunctions;
34
35 // Note: Switch this to true to enable dockspace
36 bool _dockingEnabled = true;
37 int _lastEntityDisplayed = 0;
38public:
39 float cameraRotationZ = 0;
40 int newNodesCount = 0;
41 int newLinksCount = 0;
42
43 float interpolation = 0.0f;
44 float interpolation_speed = 0.01f;
45 bool interpolation_running = false;
46
47
48 bool isMouseInSecondColumn = false;
49
50
51
52 int last_activeLayout = 0;
53 int activeLayout = 0;
54
56
58
59 bool isSaving();
60 void setNewMap(bool startingNew);
61 bool isStartingNew();
62 bool isLoading();
63 void setLoading(bool loading);
64 bool isGoingBack();
65 void SetGoingBack(bool goingBack);
66
67 void updateFileNamesInAssets();
68
69 void updatePollingFileNamesInAssets();
70
71 bool* getDockspaceRef();
72 void MenuBar();
73
74 bool isMouseOnWidget(const std::string& widgetName);
75 void LeftColumnUIElement(bool& renderDebug, bool& clusterLayout, glm::vec2 mouseCoords, glm::vec2 mouseCoords2, Manager& manager, Entity* selectedEntity, float(&backgroundColor)[4], int cell_size);
76 void RightColumnUIElement(Manager& manager, float* nodeRadius);
77 void FPSCounter(const BaseFPSLimiter& baseFPSLimiter);
78 void ReloadAccessibleFiles();
79 void SavingUI(Map* map);
80 void NewMapUI();
81 char* LoadingUI();
82 void MainMenuUI(std::function<void()> onStartSimulator, std::function<void()> onLoadSimulator, std::function<void()> onExitSimulator);
83 void ShowAllEntities(Manager& manager, float& m_nodeRadius);
84 void availableFunctions();
85 void SceneViewport(uint32_t textureId, ImVec2& storedWindowPos, ImVec2& storedWindowSize);
86 void scriptResultsVisualization(Manager& manager, std::vector<std::pair<Entity*, glm::vec3>>& m_selectedEntities);
87 std::string SceneTabs(const std::vector<std::string>& graphNames, std::string& currentActive);
88 void ShowFunctionExecutionResults();
89 void updateIsMouseInSecondColumn();
90 void ShowEntityComponents(glm::vec2 mousePos, Entity* displayedEntity, Manager& manager);
91 void ShowSceneControl(glm::vec2 mousePos, Manager& manager);
92 void StartPollingComponent(Entity* entity, const std::string& fileName);
93};
Definition BaseFPSLimiter.h:5
Definition CustomFunctions.h:6
Definition EditorIMGUI.h:18
Definition GECS.h:140
Definition ImGuiInterface.h:14
Definition GECSManager.h:14
Definition Map.h:14