From 58a2f6d4947c450350517127d0061bd3831a2499 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Sat, 16 Dec 2023 23:29:31 +0800 Subject: [PATCH] [exgui] Implement Settings procedures --- exgui/Settings.dfm | Bin 3630 -> 1960 bytes exgui/Settings.pas | 34 +++++++++++++++++++++++++++++----- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/exgui/Settings.dfm b/exgui/Settings.dfm index d66b388a57cf949650ec93cb7dd2c657881dd9c9..29c6004fbab41c244073cc5cdee34346d185b84b 100644 GIT binary patch literal 1960 zcmcIlJ#5oJ6u#PR?8GT5po+j0F~I;TONVZa+q8w!MzuxR=*7M^R^4-CU;o5}#Ml9e zj$J!4fW*Ln#DFTXFjiveikLDXODyKu&$(FTS4c$fPG{fuz3=_VFG+>i&HL7@Z7(d% zS!81DxkiZHYEBsT`j*9n@c2el861Zf*}70a4XJj}Ro@V!5ri%aEwS%2O>ajt9`%C_ z&7@u71-zv9JycEKV_eKLZ=)mBSH!^QRnHY2^&1&613w70vg0=dZ&HUA>Tx&Nwb`C9vI~?@zLvA6CA!5*+5;B4lv8A8u^QyU zvhSK9qk=7`8R&W|h`cmt?Ls%OoRBeYLd0;h%n_#nKitCeXv^DUe$-;&0(UyfS|tr2 zmmVdW-Pjfa@^5pC?y#(8ik_A185zlvR_>K@_*Gf0;S{XRuywlai?VLhb{3jKGzh`> zoK4L@huH&>GJ2bvlsn8vp@)AIDj|HJFeDX5`@V9GvOO0D+ucU6XKb`vG>Uei;ZY$Y zMaP8HFC@=MeL`ePMqP6113871>_ysUekt4Upu4d&Zl#sGd*64bj7o3UEz0ZD+=aG9 z^#vXY>iab9S$#2ZvcnW1Rom(^=3)o*sND#I-3WW2z9X5&THb>z{T_@DH^EW4GUxAi zJGW=3pp_|=kV#mL`{|zkCSl!xHI}a-QiBux;Qo?<3tteDkmP?`?f4Y!FNFYnbe25r zB`YT}oNpeT)DGUl{wq3Q?!JzXlH@Q>9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=+$ByX#@-^rd`4H( zW|tsI+(^0UG28<4Ml&{E1Ug7DGUM@O_$xKI&(KIeS=Top$NU~I0$vU4F^K7i-=XHx zamR)lJ|kpqFsdIGgV`z?pAjNuf{UbFwa<;MBBL1(8YPD_`LHUh2t9Q8uKknQwdb8tpPNJQh||v>Yf5Q|Q4Mt( zRA}JfMOEWJF4%_Rbf+@hE4#eVxY9b;)?J7Gn?lvsf>)QadHTI3a|&!K^$05V`1cDZ CnTN6f diff --git a/exgui/Settings.pas b/exgui/Settings.pas index c50bffe..90c8935 100644 --- a/exgui/Settings.pas +++ b/exgui/Settings.pas @@ -4,7 +4,7 @@ interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, - Dialogs, StdCtrls, Buttons; + Dialogs, StdCtrls, Registry, Buttons; type TfmSettings = class(TForm) @@ -31,26 +31,50 @@ var implementation +uses Main; + {$R *.dfm} procedure TfmSettings.bnSaveClick(Sender: TObject); +var + Reg: TRegistry; 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; procedure TfmSettings.bnCancelClick(Sender: TObject); begin - // TODO: TfmSettings.bnCancelClick + Close; end; procedure TfmSettings.FormCreate(Sender: TObject); +var + Reg: TRegistry; 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; procedure TfmSettings.sbBrowseClick(Sender: TObject); begin - // TODO: TfmSettings.sbBrowseClick + fmMain.GetGTAExe(Handle); + edInstallLoc.Text:= ExtractFilePath(gta_sa_exe); end; end.