add NewLevel action

This commit is contained in:
SweetId
2023-10-16 21:14:26 -04:00
parent 8dd179e784
commit f2f4c3b036
8 changed files with 84 additions and 4 deletions

View File

@@ -3,6 +3,7 @@
#include <NazaraEditor/Core/Core.hpp>
#include <NazaraEditor/Core/Application/Action.hpp>
#include <NazaraEditor/Core/Application/ActionStack.hpp>
#include <NazaraEditor/Core/Application/Actions/EditorAction_Level_New.hpp>
#include <NazaraEditor/Core/Application/Actions/EditorAction_Log_Clear.hpp>
#include <NazaraEditor/Core/Application/Actions/EditorAction_Log_CopyToClipboard.hpp>
#include <NazaraEditor/Core/Application/BaseApplication.hpp>

View File

@@ -0,0 +1,15 @@
#pragma once
#include <NazaraEditor/Core/Application/Action.hpp>
namespace Nz
{
class NAZARAEDITOR_CORE_API EditorAction_Level_New final
: public EditorAction
{
EDITORACTION_BODY(EditorAction_Level_New, false);
public:
void Execute() override;
};
}

View File

@@ -39,10 +39,11 @@ namespace Nz
void SetResourceFolder(const std::filesystem::path& path) { m_resourceFolder = path; }
std::filesystem::path GetResourceFolder() const { return m_resourceFolder; }
Nz::Level& GetLevel();
bool NewLevel();
bool CloseLevel();
bool OpenLevel(const std::filesystem::path& path);
virtual bool NewLevel();
virtual bool CloseLevel() { return false; }
virtual bool OpenLevel(const std::filesystem::path& /*path*/) { return false; }
entt::handle CreateEntity(const std::string& name);

View File

@@ -7,6 +7,7 @@ namespace NzEditor
class Application
: public Nz::EditorBaseApplication
{
public:
virtual bool NewLevel() override;
};
}