mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-06 00:53:52 +00:00
fix(editor): object ID reset on load, zone name validation
- ObjectPlacer::loadFromFile() now resets uniqueIdCounter_ and clears selectedIndices_ to prevent ID collisions on repeated loads - Zone rename validates against path traversal and special characters (rejects slashes, dots, colons, control chars, empty strings) - UI shows error toast for invalid zone names
This commit is contained in:
parent
16a34afbf6
commit
acb519a243
3 changed files with 16 additions and 3 deletions
|
|
@ -2254,8 +2254,10 @@ void EditorUI::renderPropertiesPanel(EditorApp& app) {
|
|||
ImGui::SetNextItemWidth(140);
|
||||
if (ImGui::InputText("##mapname", renameBuf, sizeof(renameBuf),
|
||||
ImGuiInputTextFlags_EnterReturnsTrue)) {
|
||||
app.setMapName(renameBuf);
|
||||
app.showToast("Zone renamed: " + std::string(renameBuf));
|
||||
if (app.setMapName(renameBuf))
|
||||
app.showToast("Zone renamed: " + std::string(renameBuf));
|
||||
else
|
||||
app.showToast("Invalid name (no slashes or special chars)");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::Text("[%d, %d]", app.getLoadedTileX(), app.getLoadedTileY());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue