From 06a4c5dd51d1f8a7792884f994e06151f7517759 Mon Sep 17 00:00:00 2001 From: Sverre Rabbelier Date: Sat, 19 Apr 2008 13:48:54 +0200 Subject: [PATCH] Made EditorDetail a full-fledged editor. --- src/Core/Editors/EditorDetail.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/Core/Editors/EditorDetail.cpp b/src/Core/Editors/EditorDetail.cpp index 7524b56..7d6b7ac 100644 --- a/src/Core/Editors/EditorDetail.cpp +++ b/src/Core/Editors/EditorDetail.cpp @@ -136,6 +136,10 @@ void EditorDetail::OnFocus() std::string EditorDetail::lookup(const std::string& action) { + std::string name = OLCEditor::lookup(action); + if(name.size() != 0) + return name; + const DetailCommand* act = (DetailCommand*)m_commands.getObject(action); if(act) return act->getName(); @@ -147,9 +151,13 @@ void EditorDetail::dispatch(const std::string& action, const std::string& argume { const DetailCommand* act = (DetailCommand*)m_commands.getObject(action); - Assert(act); + if(!act) + { + OLCEditor::dispatch(action, argument); + return; + } - if(!m_detail) + if(!m_detail && act->needObject()) { m_sock->Send("You need to be editing a detail first.\n"); m_sock->Send("(Use the 'edit' command.)\n"); @@ -316,6 +324,11 @@ void EditorDetail::setParent(const std::string& argument) Assert(area || chunk || room); + m_parentArea.reset(); + m_parentRoom.reset(); + m_parentChunk.reset(); + + if(area) { try { -- 2.11.4.GIT