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:
parent
06e52049fd
commit
87b42d68e8
Binary file not shown.
@ -263,8 +263,8 @@ begin
|
|||||||
CopyConfig := True;
|
CopyConfig := True;
|
||||||
AddStatus('Creating directories...', clBlack);
|
AddStatus('Creating directories...', clBlack);
|
||||||
if DirectoryExists(ePath + 'addons\metamod\bin') then begin
|
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
|
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
|
||||||
mrNo: CopyConfig := False;
|
mrYes: CopyConfig := False;
|
||||||
mrCancel: begin
|
mrCancel: begin
|
||||||
Application.Terminate;
|
Application.Terminate;
|
||||||
exit;
|
exit;
|
||||||
@ -464,8 +464,8 @@ begin
|
|||||||
eStr.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'metamod.vdf');
|
eStr.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'metamod.vdf');
|
||||||
frmMain.ggeItem.Progress := 2;
|
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
|
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
|
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
|
||||||
mrNo: CopyConfig := False;
|
mrYes: CopyConfig := False;
|
||||||
mrCancel: begin
|
mrCancel: begin
|
||||||
Application.Terminate;
|
Application.Terminate;
|
||||||
eStr.Free;
|
eStr.Free;
|
||||||
@ -526,6 +526,11 @@ begin
|
|||||||
if (CommentFound) then
|
if (CommentFound) then
|
||||||
AddSkipped
|
AddSkipped
|
||||||
else begin
|
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
|
// 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(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.');
|
eStr.Insert(1, ';Any line starting with a '';'' character is a comment line, and is ignored.');
|
||||||
|
Binary file not shown.
@ -5,7 +5,7 @@ interface
|
|||||||
uses
|
uses
|
||||||
SysUtils, Windows, Messages, Classes, Graphics, Controls,
|
SysUtils, Windows, Messages, Classes, Graphics, Controls,
|
||||||
StdCtrls, ExtCtrls, Forms, FileCtrl, ComCtrls, ShellCtrls,
|
StdCtrls, ExtCtrls, Forms, FileCtrl, ComCtrls, ShellCtrls,
|
||||||
TFlatComboBoxUnit, TFlatButtonUnit;
|
TFlatComboBoxUnit, TFlatButtonUnit, TFlatCheckBoxUnit;
|
||||||
|
|
||||||
type
|
type
|
||||||
TfrmSelectModPath = class(TForm)
|
TfrmSelectModPath = class(TForm)
|
||||||
@ -14,6 +14,8 @@ type
|
|||||||
trvDirectory: TShellTreeView;
|
trvDirectory: TShellTreeView;
|
||||||
cmdOK: TFlatButton;
|
cmdOK: TFlatButton;
|
||||||
cmdCancel: TFlatButton;
|
cmdCancel: TFlatButton;
|
||||||
|
chkUsesOrangebox: TFlatCheckBox;
|
||||||
|
procedure trvDirectoryClick(Sender: TObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
@ -23,4 +25,11 @@ implementation
|
|||||||
|
|
||||||
{$R *.DFM}
|
{$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.
|
end.
|
||||||
|
@ -185,9 +185,9 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
eStr.Free;
|
eStr.Free;
|
||||||
// check for orangebox directory
|
// check for orangebox directory (!! OrangeBox Check !!)
|
||||||
Source := True;
|
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
|
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;
|
mrYes: Source := False;
|
||||||
mrNo: Source := True;
|
mrNo: Source := True;
|
||||||
@ -221,11 +221,11 @@ begin
|
|||||||
if frbDedicatedServer.Checked then begin
|
if frbDedicatedServer.Checked then begin
|
||||||
Source := True;
|
Source := True;
|
||||||
ePath := trvMods.Selected.Text;
|
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'
|
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'
|
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'
|
ePath := trvMods.Selected.Parent.Text + '\source dedicated server\hl2mp'
|
||||||
else begin
|
else begin
|
||||||
{ get games }
|
{ get games }
|
||||||
@ -318,9 +318,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
{ Custom mod below }
|
{ Custom mod below }
|
||||||
end
|
end
|
||||||
else if jplWizard.ActivePage <> jspInstallMethod then
|
else if (jplWizard.ActivePage = jspInstallMethod) then begin
|
||||||
jplWizard.NextPage
|
|
||||||
else begin
|
|
||||||
if frbDedicatedServer.Checked then begin // Dedicated Server
|
if frbDedicatedServer.Checked then begin // Dedicated Server
|
||||||
eRegistry := TRegistry.Create(KEY_READ);
|
eRegistry := TRegistry.Create(KEY_READ);
|
||||||
try
|
try
|
||||||
@ -438,23 +436,16 @@ begin
|
|||||||
{ Custom mod }
|
{ Custom mod }
|
||||||
if frmSelectModPath.ShowModal = mrOk then begin
|
if frmSelectModPath.ShowModal = mrOk then begin
|
||||||
ePath := frmSelectModPath.trvDirectory.SelectedFolder.PathName;
|
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 }
|
{ install now }
|
||||||
jspInstallProgress.Show;
|
jspInstallProgress.Show;
|
||||||
InstallCustom(IncludeTrailingPathDelimiter(ePath), osWindows, Source);
|
InstallCustom(IncludeTrailingPathDelimiter(ePath), osWindows, not frmSelectModPath.chkUsesOrangebox.Checked);
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else if frbFTP.Checked then // FTP
|
else if frbFTP.Checked then // FTP
|
||||||
jspFTP.Show;
|
jspFTP.Show;
|
||||||
end;
|
end
|
||||||
|
else
|
||||||
|
jplWizard.NextPage
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrmMain.CheckNext(Sender: TObject);
|
procedure TfrmMain.CheckNext(Sender: TObject);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user