fixed typos and added FindClose to search function
This commit is contained in:
parent
f0ee52f892
commit
550dbae0c7
Binary file not shown.
|
@ -32,9 +32,9 @@ begin
|
||||||
Result := TStringList.Create;
|
Result := TStringList.Create;
|
||||||
|
|
||||||
// Find all files
|
// Find all files
|
||||||
if FindFirst(Mask, Attr, eSearch) = 0 then begin
|
if (FindFirst(Mask, Attr, eSearch) = 0) then begin
|
||||||
repeat
|
repeat
|
||||||
if eSearch.Name[1] <> '.' then begin
|
if (eSearch.Name[1] <> '.') then begin
|
||||||
if ShowPath then begin
|
if ShowPath then begin
|
||||||
if ((eSearch.Attr and Attr) = eSearch.Attr) and ((eSearch.Attr and faDirectory) <> eSearch.Attr) then
|
if ((eSearch.Attr and Attr) = eSearch.Attr) and ((eSearch.Attr and faDirectory) <> eSearch.Attr) then
|
||||||
Result.Add(ExtractFilePath(Mask) + eSearch.Name)
|
Result.Add(ExtractFilePath(Mask) + eSearch.Name)
|
||||||
|
@ -55,8 +55,10 @@ begin
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
until FindNext(eSearch) <> 0;
|
until (FindNext(eSearch) <> 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
SysUtils.FindClose(eSearch);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetSteamAppsDir: String;
|
function GetSteamAppsDir: String;
|
||||||
|
|
|
@ -325,7 +325,7 @@ begin
|
||||||
frmMain.ggeItem.MaxValue := DirList.Count;
|
frmMain.ggeItem.MaxValue := DirList.Count;
|
||||||
|
|
||||||
if (SteamInstall) and (GetProcessID('Steam.exe') <> -1) then begin
|
if (SteamInstall) and (GetProcessID('Steam.exe') <> -1) then begin
|
||||||
if MessageBox(frmMain.Handle, 'Steam is still running. It is necersarry to shut it down before you install AMX Mod X. Shut it down now?', PChar(frmMain.Caption), MB_ICONQUESTION + MB_YESNO) = mrYes then begin
|
if MessageBox(frmMain.Handle, 'Steam is still running. It is necessary to shut it down before you install AMX Mod X. Shut it down now?', PChar(frmMain.Caption), MB_ICONQUESTION + MB_YESNO) = mrYes then begin
|
||||||
AddStatus('Shutting down Steam...', clBlack, False);
|
AddStatus('Shutting down Steam...', clBlack, False);
|
||||||
if GetProcessID('Steam.exe') = -1 then
|
if GetProcessID('Steam.exe') = -1 then
|
||||||
AddDone
|
AddDone
|
||||||
|
|
|
@ -317,7 +317,7 @@ begin
|
||||||
ChosenMod := modNone;
|
ChosenMod := modNone;
|
||||||
ePath := LowerCase(GetModPathName(trvMods.Selected.Text));
|
ePath := LowerCase(GetModPathName(trvMods.Selected.Text));
|
||||||
if gMultiAccount then
|
if gMultiAccount then
|
||||||
SteamPath := GetSteamAppsDir + trvMods.Selected.Parent.Text + '\dedicated server\'; // setting this path for a user with only one account is not neccessary
|
SteamPath := GetSteamAppsDir + trvMods.Selected.Parent.Text + '\dedicated server\'; // setting this path for a user with only one account is not necessary
|
||||||
// ask for additional mods...
|
// ask for additional mods...
|
||||||
if (ePath = 'cstrike') or (ePath = 'czero') then begin
|
if (ePath = 'cstrike') or (ePath = 'czero') then begin
|
||||||
if MessageBox(Handle, 'Install Counter-Strike addon?', PChar(Application.Title), MB_ICONQUESTION + MB_YESNO) = mrYes then
|
if MessageBox(Handle, 'Install Counter-Strike addon?', PChar(Application.Title), MB_ICONQUESTION + MB_YESNO) = mrYes then
|
||||||
|
@ -367,7 +367,7 @@ begin
|
||||||
if frbListenServer.Checked then begin
|
if frbListenServer.Checked then begin
|
||||||
ChosenMod := modNone;
|
ChosenMod := modNone;
|
||||||
if gMultiAccount then
|
if gMultiAccount then
|
||||||
SteamPath := GetSteamAppsDir + trvMods.Selected.Parent.Text + '\'; // setting this path for a user with only one account is not neccessary
|
SteamPath := GetSteamAppsDir + trvMods.Selected.Parent.Text + '\'; // setting this path for a user with only one account is not necessary
|
||||||
ePath := trvMods.Selected.Text;
|
ePath := trvMods.Selected.Text;
|
||||||
if DirectoryExists(SteamPath + ePath + '\' + GetModPathName(ePath)) then
|
if DirectoryExists(SteamPath + ePath + '\' + GetModPathName(ePath)) then
|
||||||
ePath := SteamPath + ePath + '\' + GetModPathName(ePath)
|
ePath := SteamPath + ePath + '\' + GetModPathName(ePath)
|
||||||
|
@ -530,7 +530,7 @@ begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if trvMods.Items.Count = 0 then
|
if trvMods.Items.Count = 0 then
|
||||||
MessageBox(Handle, 'You haven''t installed any Steam games yet. It is neccessary to do that if you want to install AMX Mod X on a listen server.', 'Error', MB_ICONERROR)
|
MessageBox(Handle, 'You haven''t installed any Steam games yet. It is necessary to do that if you want to install AMX Mod X on a listen server.', 'Error', MB_ICONERROR)
|
||||||
else begin
|
else begin
|
||||||
jspSelectMod.Show;
|
jspSelectMod.Show;
|
||||||
trvMods.Selected := nil;
|
trvMods.Selected := nil;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user