1 Star 0 Fork 0

phy0292/cheat-engine

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
frmD3DHookSnapshotConfigUnit.pas 5.05 KB
一键复制 编辑 原始数据 按行查看 历史
Dark Byte 提交于 2020-12-22 08:53 +08:00 . some more fixes for dark mode
unit frmD3DHookSnapshotConfigUnit;
{$mode delphi}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, EditBtn,
StdCtrls, ExtCtrls, CEFuncProc, registry, commonTypeDefs, betterControls;
type
{ TfrmD3DHookSnapshotConfig }
TfrmD3DHookSnapshotConfig = class(TForm)
btnClearFullSnapshot: TButton;
btnClearSmallSnapshot: TButton;
cbAlsoOutputPng: TCheckBox;
cbProgressive: TCheckBox;
cbClearDepth: TCheckBox;
dirSnapshot: TDirectoryEdit;
edtFullSnapshot: TEdit;
edtSmallSnapshot: TEdit;
gbPictureFormat: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
mbCancel: TButton;
mbOk: TButton;
Panel1: TPanel;
Panel2: TPanel;
Panel3: TPanel;
rbFormatPNG: TRadioButton;
rbFormatBMP: TRadioButton;
procedure btnClearFullSnapshotClick(Sender: TObject);
procedure btnClearSmallSnapshotClick(Sender: TObject);
procedure cbClearDepthChange(Sender: TObject);
procedure cbProgressiveChange(Sender: TObject);
procedure edtFullSnapshotKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure edtSmallSnapshotKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure FormCreate(Sender: TObject);
procedure mbOkClick(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
fullsnapshotkey: integer;
smallsnapshotkey: integer;
end;
implementation
{$R *.lfm}
{ TfrmD3DHookSnapshotConfig }
procedure TfrmD3DHookSnapshotConfig.btnClearFullSnapshotClick(Sender: TObject);
begin
fullsnapshotkey:=0;
edtFullSnapshot.text:='';
end;
procedure TfrmD3DHookSnapshotConfig.btnClearSmallSnapshotClick(Sender: TObject);
begin
smallsnapshotkey:=0;
edtSmallSnapshot.text:='';
end;
procedure TfrmD3DHookSnapshotConfig.cbClearDepthChange(Sender: TObject);
begin
if cbClearDepth.checked then
cbProgressive.checked:=false;
cbProgressive.enabled:=not cbClearDepth.checked;
end;
procedure TfrmD3DHookSnapshotConfig.cbProgressiveChange(Sender: TObject);
begin
edtSmallSnapshot.enabled:=not cbProgressive.checked;
btnClearSmallSnapshot.enabled:=not cbProgressive.checked;
end;
procedure TfrmD3DHookSnapshotConfig.edtFullSnapshotKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
var k: Tkeycombo;
begin
fullsnapshotkey:=key;
k[0]:=fullsnapshotkey;
k[1]:=0;
edtFullSnapshot.text:=ConvertKeyComboToString(k);
end;
procedure TfrmD3DHookSnapshotConfig.edtSmallSnapshotKeyDown(Sender: TObject;
var Key: Word; Shift: TShiftState);
var k: Tkeycombo;
begin
smallsnapshotkey:=key;
k[0]:=smallsnapshotkey;
k[1]:=0;
edtSmallSnapshot.text:=ConvertKeyComboToString(k);
end;
procedure TfrmD3DHookSnapshotConfig.FormCreate(Sender: TObject);
var reg: TRegistry;
k: Tkeycombo;
begin
reg:=tregistry.create;
try
Reg.RootKey := HKEY_CURRENT_USER;
if Reg.OpenKey('\Software\Cheat Engine\D3DHook',false) then
begin
if reg.ValueExists('Snapshot Folder') then
dirSnapshot.text:=reg.ReadString('Snapshot Folder');
if reg.ValueExists('Snapshot Progressive') then
cbProgressive.checked:=reg.ReadBool('Snapshot Progressive');
if reg.ValueExists('Snapshot ClearDepth') then
cbClearDepth.Checked:=reg.readBool('Snapshot ClearDepth');
if reg.ValueExists('Full Snapshot Key') then
fullsnapshotkey:=reg.ReadInteger('Full Snapshot Key');
if reg.ValueExists('Small Snapshot Key') then
smallsnapshotkey:=reg.ReadInteger('Small Snapshot Key');
if reg.ValueExists('Also save PNG') then
cbAlsoOutputPng.Checked:=reg.readBool('Also save PNG');
if reg.ValueExists('Snapshot picture format') then
begin
if reg.ReadInteger('Snapshot picture format')=0 then
rbFormatPNG.checked:=true
else
rbFormatBMP.checked:=true;
end;
k[1]:=0;
k[0]:=fullsnapshotkey;
edtFullSnapshot.text:=ConvertKeyComboToString(k);
k[0]:=smallsnapshotkey;
edtSmallSnapshot.text:=ConvertKeyComboToString(k);
end;
finally
reg.free;
end;
if dirSnapshot.text='' then
dirSnapshot.Text:=GetTempDir;
end;
procedure TfrmD3DHookSnapshotConfig.mbOkClick(Sender: TObject);
var reg: TRegistry;
begin
reg:=tregistry.create;
try
Reg.RootKey := HKEY_CURRENT_USER;
if Reg.OpenKey('\Software\Cheat Engine\D3DHook',true) then
begin
reg.WriteString('Snapshot Folder', dirSnapshot.Text);
reg.WriteBool('Snapshot Progressive', cbProgressive.checked);
reg.WriteBool('Snapshot ClearDepth', cbClearDepth.checked);
reg.WriteInteger('Full Snapshot Key', fullsnapshotkey);
reg.WriteInteger('Small Snapshot Key', smallsnapshotkey);
reg.writeBool('Also save PNG', cbAlsoOutputPng.Checked);
reg.WriteInteger('Snapshot picture format', ifthen<integer>(rbFormatPNG.checked,0,1));
end;
finally
reg.Free;
end;
modalresult:=mrok;
end;
end.
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/phy0292/cheat-engine.git
git@gitee.com:phy0292/cheat-engine.git
phy0292
cheat-engine
cheat-engine
master

搜索帮助