mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-06 00:53:52 +00:00
feat(editor): project management UI in File menu
- File > Project submenu: New/Save/Load project, add zones - "Add Current Zone to Project" captures loaded map/tile info - Project path editable in the menu - Zone count shown for quick reference - Foundation for multi-zone custom expansion workflow: create project → add zones → edit each → export all as WCP
This commit is contained in:
parent
1d2f25f169
commit
18939af73d
2 changed files with 38 additions and 0 deletions
|
|
@ -9,6 +9,7 @@
|
||||||
#include "npc_spawner.hpp"
|
#include "npc_spawner.hpp"
|
||||||
#include "npc_presets.hpp"
|
#include "npc_presets.hpp"
|
||||||
#include "quest_editor.hpp"
|
#include "quest_editor.hpp"
|
||||||
|
#include "editor_project.hpp"
|
||||||
#include "zone_manifest.hpp"
|
#include "zone_manifest.hpp"
|
||||||
#include "asset_browser.hpp"
|
#include "asset_browser.hpp"
|
||||||
#include "core/window.hpp"
|
#include "core/window.hpp"
|
||||||
|
|
@ -117,6 +118,10 @@ private:
|
||||||
NpcSpawner npcSpawner_;
|
NpcSpawner npcSpawner_;
|
||||||
NpcPresets npcPresets_;
|
NpcPresets npcPresets_;
|
||||||
QuestEditor questEditor_;
|
QuestEditor questEditor_;
|
||||||
|
EditorProject project_;
|
||||||
|
public:
|
||||||
|
EditorProject& getProject() { return project_; }
|
||||||
|
private:
|
||||||
AssetBrowser assetBrowser_;
|
AssetBrowser assetBrowser_;
|
||||||
|
|
||||||
pipeline::ADTTerrain terrain_;
|
pipeline::ADTTerrain terrain_;
|
||||||
|
|
|
||||||
|
|
@ -129,6 +129,39 @@ void EditorUI::processActions(EditorApp& app) {
|
||||||
void EditorUI::renderMenuBar(EditorApp& app) {
|
void EditorUI::renderMenuBar(EditorApp& app) {
|
||||||
if (ImGui::BeginMainMenuBar()) {
|
if (ImGui::BeginMainMenuBar()) {
|
||||||
if (ImGui::BeginMenu("File")) {
|
if (ImGui::BeginMenu("File")) {
|
||||||
|
if (ImGui::BeginMenu("Project")) {
|
||||||
|
static char projPathBuf[256] = "projects/MyExpansion/project.json";
|
||||||
|
if (ImGui::MenuItem("New Project...")) {
|
||||||
|
app.getProject().name = "MyExpansion";
|
||||||
|
app.getProject().author = "Kelsi Davis";
|
||||||
|
app.getProject().zones.clear();
|
||||||
|
app.showToast("New project created");
|
||||||
|
}
|
||||||
|
if (ImGui::MenuItem("Save Project")) {
|
||||||
|
app.getProject().save(projPathBuf);
|
||||||
|
app.showToast("Project saved");
|
||||||
|
}
|
||||||
|
if (ImGui::MenuItem("Load Project")) {
|
||||||
|
if (app.getProject().load(projPathBuf))
|
||||||
|
app.showToast("Project loaded: " + app.getProject().name);
|
||||||
|
else
|
||||||
|
app.showToast("Failed to load project");
|
||||||
|
}
|
||||||
|
if (ImGui::MenuItem("Add Current Zone to Project") && app.hasTerrainLoaded()) {
|
||||||
|
ProjectZone pz;
|
||||||
|
pz.mapName = app.getLoadedMap();
|
||||||
|
pz.tileX = app.getLoadedTileX();
|
||||||
|
pz.tileY = app.getLoadedTileY();
|
||||||
|
app.getProject().zones.push_back(pz);
|
||||||
|
app.showToast("Zone added to project (" +
|
||||||
|
std::to_string(app.getProject().zones.size()) + " zones)");
|
||||||
|
}
|
||||||
|
ImGui::Separator();
|
||||||
|
ImGui::InputText("Path##proj", projPathBuf, sizeof(projPathBuf));
|
||||||
|
ImGui::Text("Zones: %zu", app.getProject().zones.size());
|
||||||
|
ImGui::EndMenu();
|
||||||
|
}
|
||||||
|
ImGui::Separator();
|
||||||
if (ImGui::MenuItem("New Terrain...", "Ctrl+N")) showNewDialog_ = true;
|
if (ImGui::MenuItem("New Terrain...", "Ctrl+N")) showNewDialog_ = true;
|
||||||
if (ImGui::MenuItem("Load ADT...", "Ctrl+O")) showLoadDialog_ = true;
|
if (ImGui::MenuItem("Load ADT...", "Ctrl+O")) showLoadDialog_ = true;
|
||||||
if (ImGui::BeginMenu("Import Heightmap", app.hasTerrainLoaded())) {
|
if (ImGui::BeginMenu("Import Heightmap", app.hasTerrainLoaded())) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue