index edca4ed817570b631ebabe9260132922159974da..a0bebb99bd2912ada915778f7aef692159bd35d9 100644 (file)
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();
FFullResourceName := '';
FResourceSelected := False;
- ChDir(EditorDir);
- if FindFirst(EditorDir+'wads/*.wad', faAnyFile, SR) = 0 then
+ if FindFirst(WadsDir + DirectorySeparator + '*.*', faAnyFile, 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));
// 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;
WAD := TWADEditor_1.Create();
// Внешний WAD:
- if cbWADList.Text <> _lc[I_WAD_SPECIAL_MAP] then
- FileName := EditorDir+'wads/'+cbWADList.Text
+ if cbWADList.Text <> MsgWadSpecialMap then
+ FileName := WadsDir + DirectorySeparator + cbWADList.Text
else // WAD карты:
begin
g_ProcessResourceStr(OpenedMap, fn, sn, rn);
WAD := TWADEditor_1.Create();
// Внешний WAD:
- if cbWADList.Text <> _lc[I_WAD_SPECIAL_MAP] then
- FileName := EditorDir+'wads/'+cbWADList.Text
+ if cbWADList.Text <> MsgWadSpecialMap then
+ FileName := WadsDir + DirectorySeparator + cbWADList.Text
else // WAD карты:
begin
g_ProcessResourceStr(OpenedMap, fn, sn, rn);
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();
if cbSectionsList.Text = '..' then
SectionName := ''
else
- SectionName := utf2win(cbSectionsList.Text);
+ SectionName := cbSectionsList.Text;
if cbWADList.Text[1] <> '<' then
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);