diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas
index 21758243722bf2ee7f371fb9eb0750fad41f7afc..5fbd3607212f2c5d05c74a6a5ea1283fcbba5bb9 100644 (file)
--- a/src/editor/f_main.pas
+++ b/src/editor/f_main.pas
miMapOptions: TMenuItem;
miLine6: TMenuItem;
miOptions: TMenuItem;
- miLine7: TMenuItem;
- miMapTestSettings: TMenuItem;
// "Справка":
miMenuHelp: TMenuItem;
miAbout: TMenuItem;
miLayerP7: TMenuItem;
miLayerP8: TMenuItem;
miLayerP9: TMenuItem;
- // Всплывающее меню для кнопки теста карты:
- pmMapTest: TPopupMenu;
- miMapTestPMSet: TMenuItem;
// Панель карты:
PanelMap: TPanel;
procedure bClearTextureClick(Sender: TObject);
procedure miPackMapClick(Sender: TObject);
procedure aRecentFileExecute(Sender: TObject);
- procedure miMapTestSettingsClick(Sender: TObject);
procedure miTestMapClick(Sender: TObject);
procedure sbVerticalScroll(Sender: TObject; ScrollCode: TScrollCode;
var ScrollPos: Integer);
f_activationtype, f_keys, wadreader, fileutil,
MAPREADER, f_selectmap, f_savemap, WADEDITOR, MAPDEF,
g_map, f_saveminimap, f_addresource, CONFIG, f_packmap,
- f_addresource_sound, f_maptest, f_choosetype,
+ f_addresource_sound, f_choosetype,
g_language, f_selectlang, ClipBrd, g_resources, g_options;
const
procedure ErrorMessageBox(str: String);
begin
- MessageBox(0, PChar(str), PChar(_lc[I_MSG_ERROR]),
+ Application.MessageBox(PChar(str), PChar(_lc[I_MSG_ERROR]),
MB_ICONINFORMATION or MB_OK or MB_DEFBUTTON1);
end;
s := g_ExtractFilePathName(RecentFiles[n]);
OpenMap(fn, s)
end
- else if MessageBox(0, PChar(_lc[I_MSG_DEL_RECENT_PROMT]), PChar(_lc[I_MSG_DEL_RECENT]), MB_ICONQUESTION or MB_YESNO) = idYes then
+ else if Application.MessageBox(PChar(_lc[I_MSG_DEL_RECENT_PROMT]), PChar(_lc[I_MSG_DEL_RECENT]), MB_ICONQUESTION or MB_YESNO) = idYes then
begin
RecentFiles.Delete(n);
RefreshRecentMenu();
Compress := config.ReadBool('Editor', 'Compress', True);
Backup := config.ReadBool('Editor', 'Backup', True);
+ TestGameMode := config.ReadStr('TestRun', 'GameMode', 'DM');
+ TestLimTime := config.ReadStr('TestRun', 'LimTime', '0');
+ TestLimScore := config.ReadStr('TestRun', 'LimScore', '0');
+ TestOptionsTwoPlayers := config.ReadBool('TestRun', 'TwoPlayers', False);
+ TestOptionsTeamDamage := config.ReadBool('TestRun', 'TeamDamage', False);
+ TestOptionsAllowExit := config.ReadBool('TestRun', 'AllowExit', True);
+ TestOptionsWeaponStay := config.ReadBool('TestRun', 'WeaponStay', False);
+ TestOptionsMonstersDM := config.ReadBool('TestRun', 'MonstersDM', False);
+ TestMapOnce := config.ReadBool('TestRun', 'MapOnce', False);
+ {$IF DEFINED(DARWIN)}
+ TestD2dExe := config.ReadStr('TestRun', 'ExeDrawin', GameExeFile);
+ {$ELSEIF DEFINED(WINDOWS)}
+ TestD2dExe := config.ReadStr('TestRun', 'ExeWindows', GameExeFile);
+ {$ELSE}
+ TestD2dExe := config.ReadStr('TestRun', 'ExeUnix', GameExeFile);
+ {$ENDIF}
+ TestD2DArgs := config.ReadStr('TestRun', 'Args', '');
+
RecentCount := config.ReadInt('Editor', 'RecentCount', 5);
if RecentCount > 10 then
RecentCount := 10;
procedure TMainForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
- CanClose := MessageBox(0, PChar(_lc[I_MSG_EXIT_PROMT]),
+ CanClose := Application.MessageBox(PChar(_lc[I_MSG_EXIT_PROMT]),
PChar(_lc[I_MSG_EXIT]),
MB_ICONQUESTION or MB_YESNO or
MB_DEFBUTTON1) = idYes;
if OpenedMap = '' then
Exit;
- if MessageBox(0, PChar(_lc[I_MSG_REOPEN_MAP_PROMT]),
+ if Application.MessageBox(PChar(_lc[I_MSG_REOPEN_MAP_PROMT]),
PChar(_lc[I_MENU_FILE_REOPEN]), MB_ICONQUESTION or MB_YESNO) <> idYes then
Exit;
if i = -1 then
Exit;
- if MessageBox(0, PChar(Format(_lc[I_MSG_DEL_TEXTURE_PROMT],
+ if Application.MessageBox(PChar(Format(_lc[I_MSG_DEL_TEXTURE_PROMT],
[SelectedTexture()])),
PChar(_lc[I_MSG_DEL_TEXTURE]),
MB_ICONQUESTION or MB_YESNO or
procedure TMainForm.aNewMapExecute(Sender: TObject);
begin
- if (MessageBox(0, PChar(_lc[I_MSG_CLEAR_MAP_PROMT]),
- PChar(_lc[I_MSG_CLEAR_MAP]),
- MB_ICONQUESTION or MB_YESNO or
- MB_DEFBUTTON1) = mrYes) then
+ if Application.MessageBox(PChar(_lc[I_MSG_CLEAR_MAP_PROMT]), PChar(_lc[I_MSG_CLEAR_MAP]), MB_ICONQUESTION or MB_YESNO or MB_DEFBUTTON1) = mrYes then
FullClear();
end;
Exit;
MapName := SelectMapForm.lbMapList.Items[SelectMapForm.lbMapList.ItemIndex];
- if MessageBox(0, PChar(Format(_lc[I_MSG_DELETE_MAP_PROMT], [MapName, OpenDialog.FileName])), PChar(_lc[I_MSG_DELETE_MAP]), MB_ICONQUESTION or MB_YESNO or MB_DEFBUTTON2) <> mrYes then
+ if Application.MessageBox(PChar(Format(_lc[I_MSG_DELETE_MAP_PROMT], [MapName, OpenDialog.FileName])), PChar(_lc[I_MSG_DELETE_MAP]), MB_ICONQUESTION or MB_YESNO or MB_DEFBUTTON2) <> mrYes then
Exit;
g_DeleteResource(FileName, '', MapName, res);
if res <> 0 then
begin
- MessageBox(0, PChar('Cant delete map res=' + IntToStr(res)), PChar('Map not deleted!'), MB_ICONINFORMATION or MB_OK or MB_DEFBUTTON1);
+ Application.MessageBox(PChar('Cant delete map res=' + IntToStr(res)), PChar('Map not deleted!'), MB_ICONINFORMATION or MB_OK or MB_DEFBUTTON1);
Exit
end;
- MessageBox(
- 0,
+ Application.MessageBox(
PChar(Format(_lc[I_MSG_MAP_DELETED_PROMT], [MapName])),
PChar(_lc[I_MSG_MAP_DELETED]),
MB_ICONINFORMATION or MB_OK or MB_DEFBUTTON1
PackMapForm.ShowModal();
end;
-procedure TMainForm.miMapTestSettingsClick(Sender: TObject);
-begin
- MapTestForm.ShowModal();
-end;
-
type SSArray = array of String;
function ParseString (Str: AnsiString): SSArray;
// Сохраняем временную карту:
time := 0;
repeat
- newWAD := ExtractFilePath(TestD2dExe) + Format('maps/temp%.4d', [time]);
+ newWAD := Format('%s/temp%.4d', [MapsDir, time]);
Inc(time);
until not FileExists(newWAD);
if OpenedMap <> '' then
end;
tempMap := newWAD + ':\' + TEST_MAP_NAME;
SaveMap(tempMap);
- tempMap := ExtractRelativePath(ExtractFilePath(TestD2dExe) + 'maps/', tempMap);
// Опции игры:
opt := 32 + 64;
// Запускаем:
proc := TProcessUTF8.Create(nil);
proc.Executable := TestD2dExe;
+ {$IFDEF DARWIN}
+ // TODO: get real executable name from Info.plist
+ if LowerCase(ExtractFileExt(TestD2dExe)) = '.app' then
+ proc.Executable := TestD2dExe + DirectorySeparator + 'Contents' + DirectorySeparator + 'MacOS' + DirectorySeparator + 'Doom2DF';
+ {$ENDIF}
proc.Parameters.Add('-map');
proc.Parameters.Add(tempMap);
proc.Parameters.Add('-gm');