mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-06 17:13:51 +00:00
feat(editor): click on existing NPC marker selects it instead of placing duplicate
Plain left-click within 4u of an existing NPC now selects that NPC rather than dropping a new spawn on top. Shift+click forces placement at the cursor even if it overlaps an existing NPC, preserving the rapid-placement workflow.
This commit is contained in:
parent
7fcc923d2e
commit
f097763875
1 changed files with 10 additions and 4 deletions
|
|
@ -516,10 +516,16 @@ void EditorApp::processEvents() {
|
|||
static_cast<float>(ext.height));
|
||||
glm::vec3 hitPos;
|
||||
if (terrainEditor_.raycastTerrain(ray, hitPos)) {
|
||||
auto& tmpl = npcSpawner_.getTemplate();
|
||||
tmpl.position = hitPos;
|
||||
npcSpawner_.placeCreature(tmpl);
|
||||
objectsDirty_ = true;
|
||||
// Plain left-click near an existing NPC selects it instead of
|
||||
// placing a duplicate. Shift+click forces placement.
|
||||
bool forcePlace = (event.key.keysym.mod & KMOD_SHIFT) != 0;
|
||||
int hit = forcePlace ? -1 : npcSpawner_.selectAt(hitPos, 4.0f);
|
||||
if (hit < 0) {
|
||||
auto& tmpl = npcSpawner_.getTemplate();
|
||||
tmpl.position = hitPos;
|
||||
npcSpawner_.placeCreature(tmpl);
|
||||
objectsDirty_ = true;
|
||||
}
|
||||
}
|
||||
} else if (mode_ == EditorMode::Water) {
|
||||
painting_ = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue