DEADSOFTWARE

i10n: use resourcestring and gettext for localization
[d2df-editor.git] / src / editor / f_addresource.pas
index 69b214e75e6a48b451335859dd9465950be05890..103d9b031f3165cb39920cd042a8f4d56c5dcf3f 100644 (file)
@@ -45,12 +45,12 @@ var
 implementation
 
 uses
-  f_main, WADSTRUCT, g_language, utils, sfs;
+  f_main, WADSTRUCT, g_language, utils, sfs, g_options;
 
 {$R *.lfm}
 
 const
-  STANDART_WAD = 'Standart.wad';
+  STANDART_WAD = 'standart.wad';
 
 procedure TAddResourceForm.FormActivate(Sender: TObject);
   var
@@ -64,15 +64,14 @@ begin
   FFullResourceName := '';
   FResourceSelected := False;
 
-  ChDir(EditorDir);
-  if FindFirst(EditorDir + 'wads/*.*', faAnyFile, SR) = 0 then
+  if FindFirst(WadsDir + DirectorySeparator + '*.*', faAnyFile, SR) = 0 then
   repeat
     if (SR.name <> '.') and (SR.name <> '..') then
       cbWADList.Items.Add(SR.Name);
   until FindNext(SR) <> 0;
   FindClose(SR);
 
-// "Standart.wad" в начало списка:
+// "standart.wad" в начало списка:
   if cbWADList.Items.IndexOf(STANDART_WAD) > 0 then
   begin
     cbWADList.Items.Delete(cbWADList.Items.IndexOf(STANDART_WAD));
@@ -81,15 +80,15 @@ begin
 
 // WAD карты:
   if OpenedMap <> '' then
-    cbWADList.Items.Add(_lc[I_WAD_SPECIAL_MAP]);
+    cbWADList.Items.Add(MsgWadSpecialMap);
 end;
 
 procedure TAddResourceForm.bOKClick(Sender: TObject);
 begin
   if FResourceName = '' then
   begin
-    MessageBox(0, PChar(_lc[I_MSG_CHOOSE_RES]),
-               PChar(_lc[I_MSG_ERROR]), MB_OK + MB_ICONERROR);
+    Application.MessageBox(PChar(MsgMsgChooseRes),
+               PChar(MsgMsgError), MB_OK + MB_ICONERROR);
     Exit;
   end;
 
@@ -108,8 +107,8 @@ procedure TAddResourceForm.cbWADListChange(Sender: TObject);
     i: Integer;
     FileName, Section, sn, rn: String;
 begin
-  if cbWADList.Text <> _lc[I_WAD_SPECIAL_MAP] then
-    FileName := EditorDir + 'wads/' + cbWADList.Text (* Resource wad *)
+  if cbWADList.Text <> MsgWadSpecialMap then
+    FileName := WadsDir + DirectorySeparator + cbWADList.Text (* Resource wad *)
   else
     g_ProcessResourceStr(OpenedMap, FileName, sn, rn); (* Map wad *)
 
@@ -138,8 +137,8 @@ procedure TAddResourceForm.cbSectionsListChange(Sender: TObject);
     i: Integer;
     FileName, Section, SectionName, sn, rn: String;
 begin
-  if cbWADList.Text <> _lc[I_WAD_SPECIAL_MAP] then
-    FileName := EditorDir + 'wads/' + cbWADList.Text (* Resource wad *)
+  if cbWADList.Text <> MsgWadSpecialMap then
+    FileName := WadsDir + DirectorySeparator + cbWADList.Text (* Resource wad *)
   else
     g_ProcessResourceStr(OpenedMap, FileName, sn, rn); (* Map wad *)
 
@@ -180,7 +179,7 @@ begin
 
   g_ProcessResourceStr(OpenedMap, @fn, nil, nil);
   if FileName <> '' then
-    FFullResourceName := EditorDir + 'wads/' + FResourceName
+    FFullResourceName := WadsDir + DirectorySeparator + FResourceName
   else
     FFullResourceName := fn + FResourceName
 end;