summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9f94488)
raw | patch | inline | side by side (parent: 9f94488)
author | Dmitry D. Chernov <blackdoomer@yandex.ru> | |
Sun, 17 Sep 2023 20:07:29 +0000 (06:07 +1000) | ||
committer | Dmitry D. Chernov <blackdoomer@yandex.ru> | |
Sun, 17 Sep 2023 20:10:47 +0000 (06:10 +1000) |
src/editor/f_main.pas | patch | blob | history |
diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas
index e5389bd8ad9171f61439cb5d23e0e246b89a963f..e4e0643b38045f34c23e8ea78a81895c00965736 100644 (file)
--- a/src/editor/f_main.pas
+++ b/src/editor/f_main.pas
end;
UndoBuffer[i, ii].AddID := ID;
-
MainForm.miUndo.Enabled := UndoBuffer <> nil;
end;
+procedure DiscardUndoBuffer();
+var
+ i, k: Integer;
+begin
+ for i := 0 to High(UndoBuffer) do
+ for k := 0 to High(UndoBuffer[i]) do
+ with UndoBuffer[i][k] do
+ if UndoType = UNDO_DELETE_PANEL then
+ Dispose(Panel);
+
+ UndoBuffer := nil;
+end;
+
procedure FullClear();
begin
RemoveSelectFromObjects();
ClearMap();
LoadSky(gMapInfo.SkyName);
- UndoBuffer := nil;
+ DiscardUndoBuffer();
slInvalidTextures.Clear();
MapCheckForm.lbErrorList.Clear();
MapCheckForm.mErrorDescription.Clear();
config.SaveFile(CfgFileName);
config.Free();
- slInvalidTextures.Free;
+ slInvalidTextures.Free();
+ DiscardUndoBuffer();
end;
procedure TMainForm.FormDropFiles(Sender: TObject;
end;
// Удалить выделенные объекты:
- if (Key = VK_DELETE) and (SelectedObjects <> nil) and
- RenderPanel.Focused() then
+ if (Key = VK_DELETE) and (SelectedObjects <> nil) and RenderPanel.Focused() then
DeleteSelectedObjects();
// Снять выделение:
UNDO_DELETE_PANEL:
begin
AddPanel(Panel^);
- Panel := nil;
+ Dispose(Panel);
end;
UNDO_DELETE_ITEM: AddItem(Item);
UNDO_DELETE_AREA: AddArea(Area);
end;
SetLength(UndoBuffer, Length(UndoBuffer)-1);
-
RemoveSelectFromObjects();
-
miUndo.Enabled := UndoBuffer <> nil;
end;