mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-15 20:08:54 +03:00
Added command buffer implementation in the editor layer
This commit is contained in:
@@ -54,6 +54,7 @@
|
||||
#include <src/Resource/StaticResources.h>
|
||||
#include <src/Scripting/ScriptingEngineNet.h>
|
||||
#include <src/Threading/JobSystem.h>
|
||||
#include "../Commands/Commands/Commands.h"
|
||||
|
||||
namespace Nuake {
|
||||
|
||||
@@ -62,7 +63,8 @@ namespace Nuake {
|
||||
ImFont* boldFont;
|
||||
ImFont* EditorInterface::bigIconFont;
|
||||
|
||||
EditorInterface::EditorInterface()
|
||||
EditorInterface::EditorInterface(CommandBuffer& commandBuffer) :
|
||||
mCommandBuffer(&commandBuffer)
|
||||
{
|
||||
Logger::Log("Creating editor windows", "window", CRITICAL);
|
||||
filesystem = new FileSystemUI(this);
|
||||
@@ -2111,12 +2113,12 @@ namespace Nuake {
|
||||
}
|
||||
if (ImGui::MenuItem("Save", "CTRL+S"))
|
||||
{
|
||||
Engine::GetProject()->Save();
|
||||
Engine::GetCurrentScene()->Save();
|
||||
PushCommand(SaveProjectCommand(Engine::GetProject()));
|
||||
|
||||
Selection = EditorSelection();
|
||||
|
||||
SetStatusMessage("Project saved.");
|
||||
|
||||
Selection = EditorSelection();
|
||||
}
|
||||
if (ImGui::MenuItem("Save as...", "CTRL+SHIFT+S"))
|
||||
{
|
||||
@@ -2455,6 +2457,11 @@ namespace Nuake {
|
||||
return entityTypeName;
|
||||
}
|
||||
|
||||
void EditorInterface::PushCommand(ICommand&& command)
|
||||
{
|
||||
mCommandBuffer->PushCommand(command);
|
||||
}
|
||||
|
||||
bool EditorInterface::LoadProject(const std::string& projectPath)
|
||||
{
|
||||
FileSystem::SetRootDirectory(FileSystem::GetParentPath(projectPath));
|
||||
|
||||
Reference in New Issue
Block a user