summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7bc9ae2)
raw | patch | inline | side by side (parent: 7bc9ae2)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Wed, 29 Mar 2023 14:24:23 +0000 (17:24 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Wed, 29 Mar 2023 14:24:23 +0000 (17:24 +0300) |
src/editor/Editor.lpr | patch | blob | history | |
src/editor/f_main.pas | patch | blob | history | |
src/editor/f_maptest.pas | patch | blob | history | |
src/editor/f_options.pas | patch | blob | history |
diff --git a/src/editor/Editor.lpr b/src/editor/Editor.lpr
index 421a095601225ce80cbc610fc7e1f90fd9b0f996..052fbb8208ff350fd50036d09ce796b92bd4459e 100644 (file)
--- a/src/editor/Editor.lpr
+++ b/src/editor/Editor.lpr
ImagingTypes,
Imaging,
ImagingUtility,
+ g_options in 'g_options.pas',
g_language in 'g_language.pas',
f_selectlang in 'f_selectlang.pas' {SelectLanguageForm};
Inc(i);
LogFileName := ParamStr(i);
end;
+ end
+ else if p = '--config' then
+ begin
+ if i + 1 <= ParamCount then
+ begin
+ Inc(i);
+ CfgFileName := ParamStr(i);
+ end;
end;
Inc(i);
end;
Application.AddOnExceptionHandler(THandlerObject.ExceptionHandler, True);
Application.Initialize();
+ EditorDir := ExtractFilePath(Application.ExeName);
+ CfgFileName := EditorDir + DirectorySeparator + 'Editor.cfg';
+
CheckParamOptions;
InitLogs;
diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas
index b7e3dd36a663217c2c78d8166f2e32f606aae8cd..34a7287afeadcaa5549b3ddf1305d68d8faac0bb 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;
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;
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;
index ed08dc7f3f514b9ef3a95baca2657e927f9a19ac..f22f5fd38cae93ac41bcc9faff9502d574e9f089 100644 (file)
--- a/src/editor/f_maptest.pas
+++ b/src/editor/f_maptest.pas
implementation
uses
- f_main, CONFIG;
+ f_main, g_options, CONFIG;
{$R *.lfm}
n: Integer;
begin
- config := TConfig.CreateFile(EditorDir+'Editor.cfg');
+ config := TConfig.CreateFile(CfgFileName);
if rbTDM.Checked then
s := 'TDM'
config.WriteStr('TestRun', 'Args', edD2DArgs.Text);
TestD2DArgs := edD2DArgs.Text;
- config.SaveFile(EditorDir+'Editor.cfg');
+ config.SaveFile(CfgFileName);
config.Free();
Close();
end;
config: TConfig;
begin
- config := TConfig.CreateFile(EditorDir+'Editor.cfg');
+ config := TConfig.CreateFile(CfgFileName);
TestGameMode := config.ReadStr('TestRun', 'GameMode', 'DM');
TestLimTime := config.ReadStr('TestRun', 'LimTime', '0');
index 91cc695d1e442dc03753e43b1de29ff63e8443a9..feffc4b02ee4064d0366689e4828cad70d01cae5 100644 (file)
--- a/src/editor/f_options.pas
+++ b/src/editor/f_options.pas
implementation
uses
- f_main, StdConvs, CONFIG, g_language, g_resources;
+ f_main, StdConvs, CONFIG, g_language, g_resources, g_options;
{$R *.lfm}
else
DotSize := 1;
- config := TConfig.CreateFile(EditorDir+'Editor.cfg');
+ config := TConfig.CreateFile(CfgFileName);
config.WriteInt('Editor', 'DotColor', DotColor);
config.WriteBool('Editor', 'DotEnable', DotEnable);
MainForm.RefreshRecentMenu();
end;
- config.SaveFile(EditorDir+'Editor.cfg');
+ config.SaveFile(CfgFileName);
config.Free();
Close();
end;