diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas
index 00802bbdd83bed88d058252f8107dc09979495bd..22d9877b8f9c94bb8bf6a3d98f6f783b0dc5c731 100644 (file)
--- a/src/editor/f_main.pas
+++ b/src/editor/f_main.pas
MAPREADER, f_selectmap, f_savemap, WADEDITOR, MAPDEF,
g_map, f_saveminimap, f_addresource, CONFIG, f_packmap,
f_addresource_sound, f_maptest, f_choosetype,
- g_language, f_selectlang, ClipBrd, g_resources;
+ g_language, f_selectlang, ClipBrd, g_resources, g_options;
const
UNDO_DELETE_PANEL = 1;
config: TConfig;
begin
ID := 0;
- g_ReadResource(EditorDir + 'data/game.wad', 'FONTS', cfgres, cfgdata, cfglen);
+ g_ReadResource(GameWad, 'FONTS', cfgres, cfgdata, cfglen);
if cfgdata <> nil then
begin
- if not g_CreateTextureWAD('FONT_STD', EditorDir + 'data/game.wad:FONTS\' + texture) then
+ if not g_CreateTextureWAD('FONT_STD', GameWad + ':FONTS\' + texture) then
e_WriteLog('ERROR ERROR ERROR', MSG_WARNING);
config := TConfig.CreateMem(cfgdata, cfglen);
EditorDir := ExtractFilePath(Application.ExeName);
- e_InitLog(EditorDir+'Editor.log', WM_NEWFILE);
e_WriteLog('Doom 2D: Forever Editor version ' + EDITOR_VERSION, MSG_NOTIFY);
e_WriteLog('Build date: ' + EDITOR_BUILDDATE + ' ' + EDITOR_BUILDTIME, MSG_NOTIFY);
e_WriteLog('Build hash: ' + g_GetBuildHash(), MSG_NOTIFY);
OpenedMap := '';
OpenedWAD := '';
- config := TConfig.CreateFile(EditorDir+'Editor.cfg');
+ config := TConfig.CreateFile(CfgFileName);
if config.ReadInt('Editor', 'XPos', -1) = -1 then
Position := poDesktopCenter
config: TConfig;
i: Integer;
begin
- config := TConfig.CreateFile(EditorDir+'Editor.cfg');
+ config := TConfig.CreateFile(CfgFileName);
if WindowState <> wsMaximized then
begin
config.WriteStr('RecentFiles', IntToStr(i+1), '');
RecentFiles.Free();
- config.SaveFile(EditorDir+'Editor.cfg');
+ config.SaveFile(CfgFileName);
config.Free();
slInvalidTextures.Free;
if vleObjectProperty.Values[_lc[I_PROP_TR_MUSIC_ACT]] = _lc[I_PROP_TR_MUSIC_ON] then
Data.MusicAction := 1
else
- Data.MusicAction := 2;
+ Data.MusicAction := 0;
end;
TRIGGER_PUSH:
else gLanguage := LANGUAGE_RUSSIAN;
end;
- config := TConfig.CreateFile(EditorDir+'Editor.cfg');
+ config := TConfig.CreateFile(CfgFileName);
config.WriteStr('Editor', 'Language', gLanguage);
- config.SaveFile(EditorDir+'Editor.cfg');
+ config.SaveFile(CfgFileName);
config.Free();
end;
procedure TMainForm.miTestMapClick(Sender: TObject);
var
- newWAD, oldWAD, tempMap: String;
+ newWAD, oldWAD, tempMap, ext: String;
args: SSArray;
opt: LongWord;
time, i: Integer;
// Сохраняем временную карту:
time := 0;
repeat
- newWAD := ExtractFilePath(TestD2dExe) + Format('maps/temp%.4d.wad', [time]);
+ newWAD := ExtractFilePath(TestD2dExe) + Format('maps/temp%.4d', [time]);
Inc(time);
until not FileExists(newWAD);
if OpenedMap <> '' then
begin
oldWad := g_ExtractWadName(OpenedMap);
+ newWad := newWad + ExtractFileExt(oldWad);
if CopyFile(oldWad, newWad) = false then
e_WriteLog('MapTest: unable to copy [' + oldWad + '] to [' + newWad + ']', MSG_WARNING)
+ end
+ else
+ begin
+ newWad := newWad + '.wad'
end;
tempMap := newWAD + ':\' + TEST_MAP_NAME;
SaveMap(tempMap);