index 71e1c1d6a11049ce166fda9a1c76385721b710a8..a0bebb99bd2912ada915778f7aef692159bd35d9 100644 (file)
unit f_addresource;
-{$MODE Delphi}
+{$INCLUDE ../shared/a_modes.inc}
interface
implementation
uses
- f_main, WADSTRUCT, g_language;
+ 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);
if SectionList <> nil then
for i := 0 to High(SectionList) do
if SectionList[i] <> '' then
- cbSectionsList.Items.Add(SectionList[i])
+ cbSectionsList.Items.Add(win2utf(SectionList[i]))
else
cbSectionsList.Items.Add('..');
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);
SectionName := '';
// Читаем ресурсы выбранной секции:
- ResourceList := WAD.GetResourcesList(SectionName);
+ ResourceList := WAD.GetResourcesList(utf2win(SectionName));
WAD.Free();
if ResourceList <> nil then
for i := 0 to High(ResourceList) do
- lbResourcesList.Items.Add(ResourceList[i]);
+ lbResourcesList.Items.Add(win2utf(ResourceList[i]));
end;
procedure TAddResourceForm.lbResourcesListClick(Sender: TObject);
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);