summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e147a7b)
raw | patch | inline | side by side (parent: e147a7b)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Mon, 22 May 2023 15:30:53 +0000 (18:30 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Mon, 22 May 2023 15:30:53 +0000 (18:30 +0300) |
src/editor/f_main.lfm | patch | blob | history | |
src/editor/f_main.pas | patch | blob | history |
diff --git a/src/editor/f_main.lfm b/src/editor/f_main.lfm
index b568cbc3d243b405e8bc1b8e86009c85b9ecba7d..0a88de2374e93363b72069983e42638a63aed5be 100644 (file)
--- a/src/editor/f_main.lfm
+++ b/src/editor/f_main.lfm
left = 64
top = 146
end
+ object MapTestTimer: TTimer
+ OnTimer = MapTestCheck
+ left = 192
+ top = 64
+ end
end
diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas
index 04d69f82c9e3f4610dde61af1675511577fdc741..ca323f69220c99e1b7d12e4918cea0edba16e6e7 100644 (file)
--- a/src/editor/f_main.pas
+++ b/src/editor/f_main.pas
// Панель применения свойств:
PanelPropApply: TPanel;
bApplyProperty: TButton;
+ MapTestTimer: TTimer;
// Редактор свойств объектов:
vleObjectProperty: TValueListEditor;
procedure RenderPanelPaint(Sender: TObject);
procedure RenderPanelResize(Sender: TObject);
procedure Splitter1Moved(Sender: TObject);
+ procedure MapTestCheck(Sender: TObject);
procedure vleObjectPropertyEditButtonClick(Sender: TObject);
procedure vleObjectPropertyApply(Sender: TObject);
procedure vleObjectPropertyGetPickList(Sender: TObject; const KeyName: String; Values: TStrings);
UndoBuffer: Array of Array of TUndoRec = nil;
+ MapTestProcess: TProcessUTF8;
+ MapTestFile: String;
{$R *.lfm}
FormResize(Sender);
end;
+procedure TMainForm.MapTestCheck(Sender: TObject);
+begin
+ if MapTestProcess <> nil then
+ begin
+ if MapTestProcess.Running = false then
+ begin
+ SysUtils.DeleteFile(MapTestFile);
+ MapTestFile := '';
+ FreeAndNil(MapTestProcess);
+ tbTestMap.Enabled := True;
+ end;
+ end;
+end;
+
procedure TMainForm.aMapOptionsExecute(Sender: TObject);
var
ResName: String;
proc: TProcessUTF8;
res: Boolean;
begin
+ // Ignore while map testing in progress
+ if MapTestProcess <> nil then
+ Exit;
+
// Сохраняем временную карту:
time := 0;
repeat
end;
if res then
begin
- Application.Minimize();
- proc.WaitOnExit();
- end;
- if (not res) or (proc.ExitCode < 0) then
+ tbTestMap.Enabled := False;
+ MapTestFile := newWAD;
+ MapTestProcess := proc;
+ end
+ else
begin
- MessageBox(0, 'FIXME',
- PChar(_lc[I_MSG_EXEC_ERROR]),
- MB_OK or MB_ICONERROR);
+ MessageBox(0, 'FIXME', PChar(_lc[I_MSG_EXEC_ERROR]), MB_OK or MB_ICONERROR);
+ SysUtils.DeleteFile(newWAD);
+ proc.Free();
end;
- proc.Free();
-
- SysUtils.DeleteFile(newWAD);
- Application.Restore();
end;
procedure TMainForm.sbVerticalScroll(Sender: TObject;