forked from Mirrors/openclonk
editor: Store the selected objects only in EditCursor
parent
58a257f763
commit
3ef004506c
|
@ -919,7 +919,7 @@ void C4ControlEMMoveObject::Execute() const
|
|||
if (fLocalCall)
|
||||
{
|
||||
Console.EditCursor.SetHold(true);
|
||||
Console.PropertyDlg.Update(Console.EditCursor.GetSelection());
|
||||
Console.EditCursor.OnSelectionChanged();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -342,7 +342,6 @@ bool C4Console::FileRecord()
|
|||
void C4Console::ClearPointers(C4Object *pObj)
|
||||
{
|
||||
EditCursor.ClearPointers(pObj);
|
||||
PropertyDlg.ClearPointers(pObj);
|
||||
}
|
||||
|
||||
void C4Console::Default()
|
||||
|
|
|
@ -76,13 +76,11 @@ void C4PropertyDlg::Default()
|
|||
state->Default();
|
||||
Active = false;
|
||||
//idSelectedDef=C4ID::None;
|
||||
Selection.Default();
|
||||
}
|
||||
|
||||
void C4PropertyDlg::Clear()
|
||||
{
|
||||
state->Clear();
|
||||
Selection.Clear();
|
||||
Console.ClearDlg(this);
|
||||
Active = false;
|
||||
}
|
||||
|
|
|
@ -494,7 +494,7 @@ void C4EditCursor::FrameSelection()
|
|||
if (Inside(cobj->GetX(),Min(X,X2),Max(X,X2)) && Inside(cobj->GetY(),Min(Y,Y2),Max(Y,Y2)))
|
||||
Selection.Add(cobj, C4ObjectList::stNone);
|
||||
}
|
||||
Console.PropertyDlg.Update(Selection);
|
||||
OnSelectionChanged();
|
||||
}
|
||||
|
||||
bool C4EditCursor::In(const char *szText)
|
||||
|
@ -668,7 +668,7 @@ void C4EditCursor::GrabContents()
|
|||
C4Object *pFrom;
|
||||
if (!( pFrom = Selection.GetObject() )) return;
|
||||
Selection.Copy(pFrom->Contents);
|
||||
Console.PropertyDlg.Update(Selection);
|
||||
OnSelectionChanged();
|
||||
Hold=true;
|
||||
|
||||
// Exit all objects
|
||||
|
|
|
@ -44,29 +44,18 @@ bool C4PropertyDlg::Open()
|
|||
return true;
|
||||
}
|
||||
|
||||
bool C4PropertyDlg::Update(C4ObjectList &rSelection)
|
||||
void C4PropertyDlg::Update(C4ObjectList &rSelection)
|
||||
{
|
||||
if (!Active) return false;
|
||||
// Set new selection
|
||||
Selection.Copy(rSelection);
|
||||
// Update input control
|
||||
UpdateInputCtrl(Selection.GetObject());
|
||||
// Update contents
|
||||
return Update();
|
||||
}
|
||||
if (!Active) return;
|
||||
C4Object * pObj = rSelection.GetObject();
|
||||
|
||||
bool C4PropertyDlg::Update()
|
||||
{
|
||||
if (!Active) return false;
|
||||
// Update info edit control
|
||||
Console.PropertyDlgUpdate(this, Selection.GetDataString());
|
||||
return true;
|
||||
}
|
||||
Console.PropertyDlgUpdate(this, rSelection.GetDataString());
|
||||
|
||||
void C4PropertyDlg::UpdateInputCtrl(C4Object *pObj)
|
||||
{
|
||||
// Store selected def
|
||||
idSelectedDef=pObj->id;
|
||||
|
||||
// Update input control
|
||||
// add global and standard functions
|
||||
std::vector<char*> functions;
|
||||
for (C4AulFunc *pFn = ::ScriptEngine.GetFirstFunc(); pFn; pFn = ::ScriptEngine.GetNextFunc(pFn))
|
||||
|
@ -100,10 +89,6 @@ void C4PropertyDlg::UpdateInputCtrl(C4Object *pObj)
|
|||
|
||||
void C4PropertyDlg::Execute()
|
||||
{
|
||||
if (!::Game.iTick35) Update();
|
||||
}
|
||||
|
||||
void C4PropertyDlg::ClearPointers(C4Object *pObj)
|
||||
{
|
||||
Selection.ClearPointers(pObj);
|
||||
if (!::Game.iTick35)
|
||||
Console.PropertyDlgUpdate(this, Console.EditCursor.GetSelection().GetDataString());
|
||||
}
|
||||
|
|
|
@ -41,15 +41,11 @@ public:
|
|||
void Default();
|
||||
void Clear();
|
||||
void Execute();
|
||||
void ClearPointers(C4Object *pObj);
|
||||
void UpdateInputCtrl(C4Object *pObj);
|
||||
bool Open();
|
||||
bool Update();
|
||||
bool Update(C4ObjectList &rSelection);
|
||||
void Update(C4ObjectList &rSelection);
|
||||
bool Active;
|
||||
public: // ToolsDlg fields are public as well...
|
||||
C4ID idSelectedDef;
|
||||
C4ObjectList Selection;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue