mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 14:37:29 +08:00
[exgui] Implement Settings procedures
This commit is contained in:
parent
42ea994e41
commit
58a2f6d494
Binary file not shown.
@ -4,7 +4,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
Dialogs, StdCtrls, Buttons;
|
Dialogs, StdCtrls, Registry, Buttons;
|
||||||
|
|
||||||
type
|
type
|
||||||
TfmSettings = class(TForm)
|
TfmSettings = class(TForm)
|
||||||
@ -31,26 +31,50 @@ var
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
uses Main;
|
||||||
|
|
||||||
{$R *.dfm}
|
{$R *.dfm}
|
||||||
|
|
||||||
procedure TfmSettings.bnSaveClick(Sender: TObject);
|
procedure TfmSettings.bnSaveClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
Reg: TRegistry;
|
||||||
begin
|
begin
|
||||||
// TODO: TfmSettings.bnSaveClick
|
Reg:= TRegistry.Create;
|
||||||
|
Reg.RootKey:= HKEY_CURRENT_USER;
|
||||||
|
Reg.OpenKey('SOFTWARE\SAMP', true);
|
||||||
|
Reg.WriteBool('SaveServPasses', cbSaveServerPasswords.Checked);
|
||||||
|
Reg.WriteBool('SaveRconPasses', cbSaveRconPasswords.Checked);
|
||||||
|
Reg.CloseKey;
|
||||||
|
Reg.Free;
|
||||||
|
Close;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfmSettings.bnCancelClick(Sender: TObject);
|
procedure TfmSettings.bnCancelClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
// TODO: TfmSettings.bnCancelClick
|
Close;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfmSettings.FormCreate(Sender: TObject);
|
procedure TfmSettings.FormCreate(Sender: TObject);
|
||||||
|
var
|
||||||
|
Reg: TRegistry;
|
||||||
begin
|
begin
|
||||||
// TODO: TfmSettings.FormCreate
|
Reg:= TRegistry.Create;
|
||||||
|
Reg.RootKey:= HKEY_CURRENT_USER;
|
||||||
|
Reg.OpenKey('SOFTWARE\SAMP', true);
|
||||||
|
if Reg.ValueExists('SaveServPasses') then
|
||||||
|
cbSaveServerPasswords.Checked:= Reg.ReadBool('SaveServPasses');
|
||||||
|
if Reg.ValueExists('SaveRconPasses') then
|
||||||
|
cbSaveRconPasswords.Checked:= Reg.ReadBool('SaveRconPasses');
|
||||||
|
Reg.CloseKey;
|
||||||
|
Reg.Free;
|
||||||
|
|
||||||
|
edInstallLoc.Text:= ExtractFilePath(gta_sa_exe);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfmSettings.sbBrowseClick(Sender: TObject);
|
procedure TfmSettings.sbBrowseClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
// TODO: TfmSettings.sbBrowseClick
|
fmMain.GetGTAExe(Handle);
|
||||||
|
edInstallLoc.Text:= ExtractFilePath(gta_sa_exe);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user