瀏覽代碼

small todos

vlod 3 年之前
父節點
當前提交
420364539d

+ 3 - 10
Pika/core/pikaEditor/containersWindow/containersWindow.cpp

@@ -111,7 +111,6 @@ void pika::ContainersWindow::update(pika::LogManager &logManager, bool &open, pi
 								ImGui::Text("Static Memory requirement: ");
 								ImGui::SameLine();
 								pika::pikaImgui::displayMemorySizeValue(c.containerStructBaseSize);
-								//todo select memory unit
 
 								ImGui::Text("Default Heap Memory requirement: ");
 								ImGui::SameLine();
@@ -208,10 +207,6 @@ void pika::ContainersWindow::update(pika::LogManager &logManager, bool &open, pi
 				ImGui::PushID(pikaImgui::EditorImguiIds::containersWindow + 3);
 				ImGui::BeginGroup();
 				{
-
-					static char filter[256] = {}; //todo move
-
-
 					
 					containerIds.reserve(containerManager.runningContainers.size());
 					containerNames.reserve(containerManager.runningContainers.size());
@@ -227,7 +222,8 @@ void pika::ContainersWindow::update(pika::LogManager &logManager, bool &open, pi
 					contentSize.y -= ImGui::GetFrameHeightWithSpacing();
 					contentSize.x /= 2;
 
-					ImGui::ListWithFilter("##list box container info", &itemCurrentCreatedContainers, filter, sizeof(filter),
+					ImGui::ListWithFilter("##list box container info", &itemCurrentCreatedContainers, 
+						filterContainerInfo, sizeof(filterContainerInfo),
 						containerNames, contentSize);
 
 
@@ -327,7 +323,6 @@ void pika::ContainersWindow::update(pika::LogManager &logManager, bool &open, pi
 
 							ImGui::Separator();
 
-							static char snapshotName[50] = {};
 
 
 							if (ImGui::Button(ICON_FK_CAMERA))
@@ -355,7 +350,6 @@ void pika::ContainersWindow::update(pika::LogManager &logManager, bool &open, pi
 
 							ImGui::SameLine();
 
-							//todo move
 
 							ImGui::InputText("snapshot name", snapshotName, sizeof(snapshotName));
 
@@ -365,7 +359,6 @@ void pika::ContainersWindow::update(pika::LogManager &logManager, bool &open, pi
 
 						#pragma region snapshots
 							{
-								static char filter[256] = {}; //todo move
 								static int currentSelectedSnapshot = 0;
 
 								auto snapshots = pika::getAvailableSnapshots(
@@ -376,7 +369,7 @@ void pika::ContainersWindow::update(pika::LogManager &logManager, bool &open, pi
 								contentSize.x /= 2;
 
 								ImGui::ListWithFilter("##list box snapshots", &currentSelectedSnapshot,
-									filter, sizeof(filter),
+									filterSnapshots, sizeof(filterSnapshots),
 									snapshots, contentSize);
 
 								ImGui::SameLine();

+ 3 - 0
Pika/core/pikaEditor/containersWindow/containersWindow.h

@@ -20,6 +20,9 @@ namespace pika
 		static constexpr char *NAME = "Containers manager";
 		static constexpr char *ICON_NAME = ICON_FK_MICROCHIP " Containers manager";
 
+		char filterContainerInfo[50] = {};
+		char filterSnapshots[50] = {};
+		char snapshotName[50] = {};
 
 		int itemCurrentAvailableCOntainers = 0;
 		int itemCurrentCreatedContainers = 0;

+ 3 - 3
Pika/core/pikaEditor/editShortcuts/editShortcuts.cpp

@@ -2,8 +2,9 @@
 #include <imgui.h>
 #include <pikaImgui/pikaImgui.h>
 
-void pika::EditShortcutsWindow::init()
+void pika::EditShortcutsWindow::init(pika::pikaImgui::ImGuiIdsManager &imguiIdManager)
 {
+	imguiId = imguiIdManager.getImguiIds();
 }
 
 void pika::EditShortcutsWindow::update(pika::ShortcutManager &shortcutManager, bool &open)
@@ -23,8 +24,7 @@ void pika::EditShortcutsWindow::update(pika::ShortcutManager &shortcutManager, b
 		
 		ImGui::Text("Edit shortcuts\n");
 
-		//todo unique id
-		if (ImGui::BeginChild(12, {}, true))
+		if (ImGui::BeginChild(imguiId, {}, true))
 		{
 
 

+ 3 - 1
Pika/core/pikaEditor/editShortcuts/editShortcuts.h

@@ -1,6 +1,7 @@
 #pragma once
 #include <IconsForkAwesome.h>
 #include <shortcutApi/shortcutApi.h>
+#include <pikaImgui/pikaImgui.h>
 
 namespace pika
 {
@@ -9,7 +10,7 @@ namespace pika
 	{
 
 
-		void init();
+		void init(pika::pikaImgui::ImGuiIdsManager &imguiIdManager);
 
 		void update(pika::ShortcutManager &shortcutManager, bool &open);
 
@@ -17,6 +18,7 @@ namespace pika
 		static constexpr char *NAME = "Edit Shortcuts...";
 		static constexpr char *ICON_NAME = ICON_FK_PENCIL_SQUARE " Edit Shortcuts...";
 
+		int imguiId = 0;
 	};
 
 

+ 17 - 6
Pika/core/pikaEditor/editor/editor.cpp

@@ -15,8 +15,9 @@
 #define EDIT_SHORTCUTS ICON_FK_PENCIL_SQUARE " Edit shortcuts window"
 #define CONTAINERS_SHORTCUTS ICON_FK_MICROCHIP " Containers window"
 #define RELOAD_DLL_SHORTCUTS ICON_FK_REFRESH " Reload dll"
+#define TRANSPARENT_EDITOR_WINDOW ICON_FK_EYE "Transparent Editor window"
 
-void pika::Editor::init(pika::ShortcutManager &shortcutManager)
+void pika::Editor::init(pika::ShortcutManager &shortcutManager, pika::pikaImgui::ImGuiIdsManager &imguiIDManager)
 {
 
 	shortcutManager.registerShortcut(DOCK_MAIN_WINDOW_SHORTCUT, "Ctrl+Alt+D", &optionsFlags.hideMainWindow);
@@ -24,10 +25,11 @@ void pika::Editor::init(pika::ShortcutManager &shortcutManager)
 	shortcutManager.registerShortcut(EDIT_SHORTCUTS, "", &windowFlags.editShortcutsWindow);
 	shortcutManager.registerShortcut(CONTAINERS_SHORTCUTS, "Ctrl+M", &windowFlags.containerManager);
 	shortcutManager.registerShortcut(RELOAD_DLL_SHORTCUTS, "Ctrl+Alt+R", &shouldReloadDll);
+	shortcutManager.registerShortcut(TRANSPARENT_EDITOR_WINDOW, "Ctrl+Alt+T", &windowFlags.transparentWindow);
 
 
 	logWindow.init();
-	editShortcutsWindow.init();
+	editShortcutsWindow.init(imguiIDManager);
 	containersWindow.init();
 }
 
@@ -148,10 +150,9 @@ void pika::Editor::update(const pika::Input &input,
 
 					pika::pikaImgui::displayMemorySizeToggle();
 
-					//todo
-					//ImGui::MenuItem(pika::EditShortcutsWindow::ICON_NAME,
-					//	shortcutManager.getShortcut(EDIT_SHORTCUTS), &windowFlags.editShortcutsWindow);
-					//transparentWindow
+					ImGui::MenuItem(TRANSPARENT_EDITOR_WINDOW,
+						shortcutManager.getShortcut(TRANSPARENT_EDITOR_WINDOW), 
+						&windowFlags.transparentWindow);
 
 					ImGui::EndMenu();
 				}
@@ -169,6 +170,16 @@ void pika::Editor::update(const pika::Input &input,
 
 	}
 
+	if (windowFlags.transparentWindow)
+	{
+		ImGuiStyle &style = ::ImGui::GetStyle();
+		style.Colors[ImGuiCol_WindowBg].w = 0.f;
+	}
+	else
+	{
+		ImGuiStyle &style = ::ImGui::GetStyle();
+		style.Colors[ImGuiCol_WindowBg].w = 1.f;
+	}
 
 #pragma region log window
 	if (windowFlags.logsWindow)

+ 2 - 3
Pika/core/pikaEditor/editor/editor.h

@@ -19,7 +19,7 @@ namespace pika
 	struct Editor
 	{
 
-		void init(pika::ShortcutManager &shortcutManager);
+		void init(pika::ShortcutManager &shortcutManager, pika::pikaImgui::ImGuiIdsManager &imguiIDManager);
 
 		void update(const pika::Input &input, pika::ShortcutManager &shortcutManager
 			,pika::LogManager &logs, pika::PushNotificationManager &pushNotificationManager,
@@ -35,6 +35,7 @@ namespace pika
 			bool logsWindow = 0;
 			bool editShortcutsWindow = 0;
 			bool containerManager = 0;
+			bool transparentWindow = 1;
 		}windowFlags;
 
 		pika::LogWindow logWindow;
@@ -44,8 +45,6 @@ namespace pika
 		bool lastHideWindowState = optionsFlags.hideMainWindow;
 
 		bool shouldReloadDll = 0;
-
-		bool transparentWindow = 1;
 	};
 
 

+ 2 - 2
Pika/core/pikaRuntime/pikaMain.cpp

@@ -139,8 +139,8 @@ int main()
 
 #pragma region editor
 #if !PIKA_SHOULD_REMOVE_EDITOR
-	pika::Editor editor; //todo remove editor in production
-	editor.init(shortcutManager);
+	pika::Editor editor; 
+	editor.init(shortcutManager, imguiIdsManager);
 #endif
 #pragma endregion
 

+ 2 - 6
Pika/resources/logs.txt

@@ -1,6 +1,2 @@
-#2022-10-10 11:37:38: Created container: Gameplay
-#2022-10-10 11:37:48: Successfully created snapshot.
-#2022-10-10 11:37:59: Loaded snapshot
-#2022-10-10 11:37:59: Loaded snapshot
-#2022-10-10 11:38:08: Loaded snapshot
-#2022-10-10 11:38:34: Destroyed continer: Gameplay #1
+#2022-10-10 13:39:59: Created container: Gameplay
+#2022-10-10 13:40:02: Destroyed continer: Gameplay #1