1
0
mirror of https://github.com/alliedmodders/metamod-source.git synced 2025-02-26 19:54:14 +01:00

"Select mod directory"-dialog has now an OrangeBox checkbox, changed upgrade confirmation (now upgrades when clicking on Yes)

--HG--
branch : sourcemm-1.4.3
extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/branches/sourcemm-1.4.3%40623
This commit is contained in:
Christian Hammacher 2008-01-21 18:39:25 +00:00
parent 06e52049fd
commit 87b42d68e8
5 changed files with 29 additions and 24 deletions

Binary file not shown.

View File

@ -263,8 +263,8 @@ begin
CopyConfig := True;
AddStatus('Creating directories...', clBlack);
if DirectoryExists(ePath + 'addons\metamod\bin') then begin
case MessageBox(frmMain.Handle, 'A Metamod:Source installation was already detected. If you choose to reinstall, your configuration files will be erased. Click Yes to continue, No to Upgrade, or Cancel to abort the install.', PChar(frmMain.Caption), MB_ICONQUESTION + MB_YESNOCANCEL) of
mrNo: CopyConfig := False;
case MessageBox(frmMain.Handle, 'A Metamod:Source installation was already detected. If you choose to reinstall, your configuration files will be erased. Click Yes to upgrade, No to reinstall, or Cancel to abort the installation.', PChar(frmMain.Caption), MB_ICONQUESTION + MB_YESNOCANCEL) of
mrYes: CopyConfig := False;
mrCancel: begin
Application.Terminate;
exit;
@ -464,8 +464,8 @@ begin
eStr.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'metamod.vdf');
frmMain.ggeItem.Progress := 2;
if (((Pos('server.dll', eStr.Text) <> 0) and (OS = osWindows)) or ((Pos('server_i486.so', eStr.Text) <> 0) and (OS = osLinux))) then begin
case MessageBox(frmMain.Handle, 'A Metamod:Source installation was already detected. If you choose to reinstall, your configuration files will be erased. Click Yes to continue, No to Upgrade, or Cancel to abort the install.', PChar(frmMain.Caption), MB_ICONQUESTION + MB_YESNOCANCEL) of
mrNo: CopyConfig := False;
case MessageBox(frmMain.Handle, 'A Metamod:Source installation was already detected. If you choose to reinstall, your configuration files will be erased. Click Yes to upgrade, No to reinstall, or Cancel to abort the installation.', PChar(frmMain.Caption), MB_ICONQUESTION + MB_YESNOCANCEL) of
mrYes: CopyConfig := False;
mrCancel: begin
Application.Terminate;
eStr.Free;
@ -526,6 +526,11 @@ begin
if (CommentFound) then
AddSkipped
else begin
// delete empty lines first
for i := eStr.Count -1 downto 0 do begin
if (Trim(eStr[i]) = '') then
eStr.Delete(i);
end;
// see http://svn.alliedmods.net/viewvc.cgi/metamodsource/orangebox/addons/metamod/metaplugins.ini?revision=1099&root=Packages
eStr.Insert(0, ';List one plugin per line. Each line should contain the path to the plugin''s binary.');
eStr.Insert(1, ';Any line starting with a '';'' character is a comment line, and is ignored.');

Binary file not shown.

View File

@ -5,7 +5,7 @@ interface
uses
SysUtils, Windows, Messages, Classes, Graphics, Controls,
StdCtrls, ExtCtrls, Forms, FileCtrl, ComCtrls, ShellCtrls,
TFlatComboBoxUnit, TFlatButtonUnit;
TFlatComboBoxUnit, TFlatButtonUnit, TFlatCheckBoxUnit;
type
TfrmSelectModPath = class(TForm)
@ -14,6 +14,8 @@ type
trvDirectory: TShellTreeView;
cmdOK: TFlatButton;
cmdCancel: TFlatButton;
chkUsesOrangebox: TFlatCheckBox;
procedure trvDirectoryClick(Sender: TObject);
end;
var
@ -23,4 +25,11 @@ implementation
{$R *.DFM}
procedure TfrmSelectModPath.trvDirectoryClick(Sender: TObject);
begin
// !! OrangeBox Check !!
if (trvDirectory.Selected <> nil) then
chkUsesOrangebox.Checked := (chkUsesOrangebox.Checked) or (trvDirectory.Selected.Text = 'tf');
end;
end.

View File

@ -185,9 +185,9 @@ begin
end
else
eStr.Free;
// check for orangebox directory
// check for orangebox directory (!! OrangeBox Check !!)
Source := True;
if (AnsiSameText(trvDirectories.Selected.Text, 'tf')) then begin
if (AnsiSameText(trvDirectories.Selected.Text, 'tf')) or (Pos('orangebox', LowerCase(ePath)) <> 0) then begin
case MessageBox(Handle, 'It looks like your server is using the OrangeBox engine. Would you like to install the appropriate binaries for it?', PChar(Application.Title), MB_ICONQUESTION + MB_YESNOCANCEL) of
mrYes: Source := False;
mrNo: Source := True;
@ -221,11 +221,11 @@ begin
if frbDedicatedServer.Checked then begin
Source := True;
ePath := trvMods.Selected.Text;
if ePath = 'Counter-Strike:Source' then
if (ePath = 'Counter-Strike:Source') then
ePath := trvMods.Selected.Parent.Text + '\source dedicated server\cstrike'
else if ePath = 'Day of Defeat:Source' then
else if (ePath = 'Day of Defeat:Source') then
ePath := trvMods.Selected.Parent.Text + '\source dedicated server\dod'
else if ePath = 'Half-Life 2 Deathmatch' then
else if (ePath = 'Half-Life 2 Deathmatch') then
ePath := trvMods.Selected.Parent.Text + '\source dedicated server\hl2mp'
else begin
{ get games }
@ -318,9 +318,7 @@ begin
end;
{ Custom mod below }
end
else if jplWizard.ActivePage <> jspInstallMethod then
jplWizard.NextPage
else begin
else if (jplWizard.ActivePage = jspInstallMethod) then begin
if frbDedicatedServer.Checked then begin // Dedicated Server
eRegistry := TRegistry.Create(KEY_READ);
try
@ -438,23 +436,16 @@ begin
{ Custom mod }
if frmSelectModPath.ShowModal = mrOk then begin
ePath := frmSelectModPath.trvDirectory.SelectedFolder.PathName;
{ check if this is an orangebox game }
Source := True;
if (AnsiSameText(ExtractFileName(ePath), 'tf')) then begin
case MessageBox(Handle, 'It looks like your server is using the OrangeBox engine. Would you like to install the appropriate binaries for it?', PChar(Application.Title), MB_ICONQUESTION + MB_YESNOCANCEL) of
mrYes: Source := False;
mrNo: Source := True;
mrCancel: exit;
end;
end;
{ install now }
jspInstallProgress.Show;
InstallCustom(IncludeTrailingPathDelimiter(ePath), osWindows, Source);
InstallCustom(IncludeTrailingPathDelimiter(ePath), osWindows, not frmSelectModPath.chkUsesOrangebox.Checked);
end;
end
else if frbFTP.Checked then // FTP
jspFTP.Show;
end;
end
else
jplWizard.NextPage
end;
procedure TfrmMain.CheckNext(Sender: TObject);