mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-06 17:13:51 +00:00
feat(editor): NPC scatter tool, adjacent tile creation, multi-tile prep
- Scatter tool: place N creatures in a radius around cursor position with random rotation and uniform disk distribution - File > Add Adjacent Tile: creates and exports a blank tile N/S/E/W of current (foundation for multi-tile zone editing) - Scatter UI: count slider (1-30), radius slider (10-200) - Scatter places all copies with same stats/behavior as template
This commit is contained in:
parent
6e24e08818
commit
48026421c9
5 changed files with 67 additions and 0 deletions
|
|
@ -73,6 +73,13 @@ void EditorUI::renderMenuBar(EditorApp& app) {
|
|||
app.quickSave();
|
||||
if (ImGui::MenuItem("Export Zone...", nullptr, false, app.hasTerrainLoaded()))
|
||||
showSaveDialog_ = true;
|
||||
if (ImGui::BeginMenu("Add Adjacent Tile", app.hasTerrainLoaded())) {
|
||||
if (ImGui::MenuItem("North (+X)")) app.addAdjacentTile(1, 0);
|
||||
if (ImGui::MenuItem("South (-X)")) app.addAdjacentTile(-1, 0);
|
||||
if (ImGui::MenuItem("East (+Y)")) app.addAdjacentTile(0, 1);
|
||||
if (ImGui::MenuItem("West (-Y)")) app.addAdjacentTile(0, -1);
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
ImGui::Separator();
|
||||
if (ImGui::MenuItem("Quit", "Alt+F4")) app.requestQuit();
|
||||
ImGui::EndMenu();
|
||||
|
|
@ -537,6 +544,25 @@ void EditorUI::renderNpcPanel(EditorApp& app) {
|
|||
if (ImGui::Button("Deselect##npc")) spawner.clearSelection();
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
// Scatter tool
|
||||
if (ImGui::CollapsingHeader("Scatter Tool")) {
|
||||
static int scatterCount = 5;
|
||||
static float scatterRadius = 50.0f;
|
||||
ImGui::SliderInt("Count", &scatterCount, 1, 30);
|
||||
ImGui::SliderFloat("Radius##scatter", &scatterRadius, 10.0f, 200.0f);
|
||||
auto& brush = app.getTerrainEditor().brush();
|
||||
if (ImGui::Button("Scatter at Cursor", ImVec2(-1, 0))) {
|
||||
if (brush.isActive() && !tmpl.modelPath.empty()) {
|
||||
spawner.scatter(tmpl, brush.getPosition(), scatterRadius, scatterCount);
|
||||
app.markObjectsDirty();
|
||||
}
|
||||
}
|
||||
ImGui::TextColored(ImVec4(0.6f, 0.6f, 0.6f, 1),
|
||||
"Places %d copies in %.0f radius", scatterCount, scatterRadius);
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
static char npcPath[256] = "output/creatures.json";
|
||||
ImGui::InputText("File##npc", npcPath, sizeof(npcPath));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue