X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Feditor%2Ff_addresource.pas;h=913f19f30d7331e3a2894c6c236f1aee3fcdb75c;hb=233712fffbff81a4df04b7b026014e1e9981e9c1;hp=514cf5cdfa6e42c8f6ed9f3d535425d79801da33;hpb=3dc2fe6b3d29cd54425db8f590e922f2dce50e99;p=d2df-editor.git diff --git a/src/editor/f_addresource.pas b/src/editor/f_addresource.pas index 514cf5c..913f19f 100644 --- a/src/editor/f_addresource.pas +++ b/src/editor/f_addresource.pas @@ -45,17 +45,17 @@ var implementation uses - f_main, WADSTRUCT, g_language, utils; + f_main, WADSTRUCT, g_language, utils, g_options; {$R *.lfm} const - STANDART_WAD = 'Standart.wad'; + STANDART_WAD = 'standart.wad'; procedure TAddResourceForm.FormActivate(Sender: TObject); var SR: TSearchRec; - + begin cbWADList.Clear(); cbSectionsList.Clear(); @@ -65,14 +65,13 @@ begin FFullResourceName := ''; FResourceSelected := False; - ChDir(EditorDir); - if FindFirst(EditorDir+'wads/*.wad', faAnyFile, SR) = 0 then + if FindFirst(WadsDir + DirectorySeparator + '*.*', faReadOnly, SR) = 0 then repeat 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; @@ -113,8 +112,8 @@ begin WAD := TWADEditor_1.Create(); // Внешний WAD: - if cbWADList.Text <> _lc[I_WAD_SPECIAL_MAP] then - FileName := EditorDir+'wads/'+utf2win(cbWADList.Text) + if cbWADList.Text <> MsgWadSpecialMap then + FileName := WadsDir + DirectorySeparator + cbWADList.Text else // WAD карты: begin g_ProcessResourceStr(OpenedMap, fn, sn, rn); @@ -148,8 +147,8 @@ begin WAD := TWADEditor_1.Create(); // Внешний WAD: - if cbWADList.Text <> _lc[I_WAD_SPECIAL_MAP] then - FileName := EditorDir+'wads/'+utf2win(cbWADList.Text) + if cbWADList.Text <> MsgWadSpecialMap then + FileName := WadsDir + DirectorySeparator + cbWADList.Text else // WAD карты: begin g_ProcessResourceStr(OpenedMap, fn, sn, rn); @@ -160,12 +159,12 @@ begin WAD.ReadFile(FileName); if cbSectionsList.Text <> '..' then - SectionName := utf2win(cbSectionsList.Text) + SectionName := cbSectionsList.Text else SectionName := ''; // Читаем ресурсы выбранной секции: - ResourceList := WAD.GetResourcesList(SectionName); + ResourceList := WAD.GetResourcesList(utf2win(SectionName)); WAD.Free(); @@ -194,17 +193,17 @@ begin if cbSectionsList.Text = '..' then SectionName := '' else - SectionName := utf2win(cbSectionsList.Text); + SectionName := cbSectionsList.Text; if cbWADList.Text[1] <> '<' then - FileName := utf2win(cbWADList.Text) + FileName := cbWADList.Text else FileName := ''; - FResourceName := FileName+':'+SectionName+'\'+utf2win(lbResourcesList.Items[lbResourcesList.ItemIndex]); + FResourceName := FileName+':'+SectionName+'\'+lbResourcesList.Items[lbResourcesList.ItemIndex]; if FileName <> '' then - FFullResourceName := EditorDir+'wads/'+FResourceName + FFullResourceName := WadsDir + DirectorySeparator + FResourceName else begin g_ProcessResourceStr(OpenedMap, @fn, nil, nil);