mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-06 00:53:52 +00:00
feat(editor): object save/load JSON, working duplicate, export objects
- Object placer save/load: objects.json persists placed M2/WMO objects across sessions (path, position, rotation, scale, type) - Fixed Duplicate button in Object panel: now actually creates a copy with correct path/type/scale instead of being a no-op stub - Export Zone now saves objects.json alongside ADT/WDT/creatures/manifest - Object JSON loader parses all fields for full round-trip
This commit is contained in:
parent
8341fb6dc9
commit
8c9407e0f5
4 changed files with 104 additions and 5 deletions
|
|
@ -565,12 +565,17 @@ void EditorUI::renderObjectPanel(EditorApp& app) {
|
|||
ImGui::SameLine();
|
||||
if (ImGui::Button("Delete", ImVec2(100, 0))) placer.deleteSelected();
|
||||
if (ImGui::Button("Duplicate", ImVec2(100, 0))) {
|
||||
PlacedObject copy = *sel;
|
||||
copy.uniqueId = 0;
|
||||
copy.position += glm::vec3(5.0f, 5.0f, 0.0f);
|
||||
copy.selected = false;
|
||||
std::string dupPath = sel->path;
|
||||
glm::vec3 dupPos = sel->position + glm::vec3(10.0f, 10.0f, 0.0f);
|
||||
glm::vec3 dupRot = sel->rotation;
|
||||
float dupScale = sel->scale;
|
||||
auto dupType = sel->type;
|
||||
placer.clearSelection();
|
||||
// Can't easily push from here, but move slightly signals intent
|
||||
placer.setActivePath(dupPath, dupType);
|
||||
placer.setPlacementScale(dupScale);
|
||||
placer.setPlacementRotationY(dupRot.y);
|
||||
placer.placeObject(dupPos);
|
||||
app.markObjectsDirty();
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Deselect", ImVec2(100, 0)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue