summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 66487b9)
raw | patch | inline | side by side (parent: 66487b9)
author | binarymaster <x86corez@gmail.com> | |
Tue, 26 Sep 2017 19:31:01 +0000 (22:31 +0300) | ||
committer | binarymaster <x86corez@gmail.com> | |
Tue, 26 Sep 2017 19:31:01 +0000 (22:31 +0300) |
src/editor/f_main.pas | patch | blob | history |
diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas
index 2216151be62ac733692ba26562c2dfebd06c9a35..99820355f52210d9bc9db7cdf758a2ec5a50502b 100644 (file)
--- a/src/editor/f_main.pas
+++ b/src/editor/f_main.pas
LCLIntf, LCLType, LMessages, SysUtils, Variants, Classes, Graphics,
Controls, Forms, Dialogs, ImgList, StdCtrls, Buttons,
ComCtrls, ValEdit, Types, ToolWin, Menus, ExtCtrls,
- CheckLst, Grids, OpenGLContext, utils;
+ CheckLst, Grids, OpenGLContext, utils, UTF8Process;
type
config.WriteInt('Editor', 'YPos', Top);
config.WriteInt('Editor', 'Width', Width);
config.WriteInt('Editor', 'Height', Height);
+ end
+ else
+ begin
+ config.WriteInt('Editor', 'XPos', RestoredLeft);
+ config.WriteInt('Editor', 'YPos', RestoredTop);
+ config.WriteInt('Editor', 'Width', RestoredWidth);
+ config.WriteInt('Editor', 'Height', RestoredHeight);
end;
config.WriteBool('Editor', 'Maximize', WindowState = wsMaximized);
config.WriteBool('Editor', 'Minimap', ShowMap);
cmd, mapWAD, mapToRun: String;
opt: LongWord;
time: Integer;
+ proc: TProcessUTF8;
+ res: Boolean;
begin
// Сохраняем временную карту:
time := 0;
cmd := cmd + ' --tempdelete';
// Запускаем:
- Application.Minimize();
- if ExecuteProcess(TestD2dExe, cmd) < 0 then
+ proc := TProcessUTF8.Create(nil);
+ proc.Executable := TestD2dExe;
+ proc.Parameters.Add(cmd);
+ res := True;
+ try
+ proc.Execute();
+ except
+ res := False;
+ end;
+ if res then
+ begin
+ Application.Minimize();
+ proc.WaitOnExit();
+ end;
+ if (not res) or (proc.ExitCode < 0) then
begin
MessageBox(0, 'FIXME',
PChar(_lc[I_MSG_EXEC_ERROR]),
MB_OK or MB_ICONERROR);
end;
+ proc.Free();
SysUtils.DeleteFile(mapWAD);
Application.Restore();