Complain when pasting save data with missing elements
This commit is contained in:
parent
324745f24d
commit
b4d7d276a2
@ -1358,6 +1358,10 @@ void GameModel::SetPlaceSave(std::unique_ptr<GameSave> save)
|
||||
transformedPlaceSave.reset();
|
||||
placeSave = std::move(save);
|
||||
notifyPlaceSaveChanged();
|
||||
if (placeSave && placeSave->missingElements)
|
||||
{
|
||||
Log("Paste content has missing custom elements", false);
|
||||
}
|
||||
}
|
||||
|
||||
void GameModel::TransformPlaceSave(Mat2<int> transform, Vec2<int> nudge)
|
||||
|
@ -575,7 +575,7 @@ void PreviewView::NotifySaveChanged(PreviewModel * sender)
|
||||
savePreview = SaveRenderer::Ref().Render(save->GetGameSave(), false, true);
|
||||
if (savePreview)
|
||||
savePreview->ResizeToFit(RES / 2, true);
|
||||
missingElementsButton->Visible = missingElements.identifiers.size() || missingElements.ids.size();
|
||||
missingElementsButton->Visible = missingElements;
|
||||
UpdateLoadStatus();
|
||||
}
|
||||
else if (!sender->GetCanOpen())
|
||||
|
@ -7,4 +7,9 @@ struct MissingElements
|
||||
{
|
||||
std::map<ByteString, int> identifiers;
|
||||
std::set<int> ids;
|
||||
|
||||
operator bool() const
|
||||
{
|
||||
return identifiers.size() || ids.size();
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user