mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
move CEditorMap::HandleMapDrop
to CEditor
This commit is contained in:
parent
12d0608dfd
commit
59df1d86d4
|
@ -7838,7 +7838,17 @@ bool CEditor::Save(const char *pFilename)
|
|||
|
||||
bool CEditor::HandleMapDrop(const char *pFileName, int StorageType)
|
||||
{
|
||||
return m_Map.HandleMapDrop(pFileName, IStorage::TYPE_ALL_OR_ABSOLUTE);
|
||||
if(HasUnsavedData())
|
||||
{
|
||||
str_copy(m_aFileNamePending, pFileName);
|
||||
m_PopupEventType = CEditor::POPEVENT_LOADDROP;
|
||||
m_PopupEventActivated = true;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Load(pFileName, IStorage::TYPE_ALL_OR_ABSOLUTE);
|
||||
}
|
||||
}
|
||||
|
||||
bool CEditor::Load(const char *pFileName, int StorageType)
|
||||
|
|
|
@ -473,7 +473,6 @@ public:
|
|||
// io
|
||||
bool Save(const char *pFilename);
|
||||
bool Load(const char *pFilename, int StorageType, const std::function<void(const char *pErrorMessage)> &ErrorHandler);
|
||||
bool HandleMapDrop(const char *pFilename, int StorageType);
|
||||
void PerformSanityChecks(const std::function<void(const char *pErrorMessage)> &ErrorHandler);
|
||||
|
||||
// DDRace
|
||||
|
|
|
@ -179,18 +179,3 @@ void CEditorMap::MakeTuneLayer(const std::shared_ptr<CLayer> &pLayer)
|
|||
m_pTuneLayer = std::static_pointer_cast<CLayerTune>(pLayer);
|
||||
m_pTuneLayer->m_pEditor = m_pEditor;
|
||||
}
|
||||
|
||||
bool CEditorMap::HandleMapDrop(const char *pFileName, int StorageType)
|
||||
{
|
||||
if(m_pEditor->HasUnsavedData())
|
||||
{
|
||||
str_copy(m_pEditor->m_aFileNamePending, pFileName);
|
||||
m_pEditor->m_PopupEventType = CEditor::POPEVENT_LOADDROP;
|
||||
m_pEditor->m_PopupEventActivated = true;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return m_pEditor->Load(pFileName, IStorage::TYPE_ALL_OR_ABSOLUTE);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue