📄 opensave.pas
字号:
while true do
begin
trainer.ReadBuffer(temp,4);
case temp of
0: begin
//tbutton
with tbutton2.create(frmTrainerDesigner) do
begin
trainer.ReadBuffer(temp,sizeof(integer));
left:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
top:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
width:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
height:=temp;
//caption
trainer.ReadBuffer(temp,4);
getmem(x,temp+1);
trainer.ReadBuffer(x^,temp);
x[temp]:=#0;
caption:=x;
freemem(x);
//wordwrap
trainer.ReadBuffer(tempb,sizeof(boolean));
wordwrap:=tempb;
//onclick
trainer.ReadBuffer(temp,sizeof(tag));
tag:=temp;
parent:=frmTrainerDesigner;
//command
trainer.ReadBuffer(temp,4);
getmem(x,temp+1);
trainer.ReadBuffer(x^,temp);
x[temp]:=#0;
command:=x;
freemem(x);
onmousedown:=frmTrainerDesigner.MouseDown;
onmousemove:=frmTrainerDesigner.MouseMove;
onmouseup:=frmTrainerDesigner.MouseUp;
end;
end;
1: begin
//cheatlist
with tcheatlist.create(frmTrainerDesigner) do
begin
trainer.ReadBuffer(temp,sizeof(integer));
left:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
top:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
width:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
height:=temp;
trainer.ReadBuffer(tempc,sizeof(tcolor));
activationcolor:=tempc;
trainer.ReadBuffer(tempc,sizeof(tcolor));
color:=tempc;
trainer.ReadBuffer(tempc,sizeof(tcolor));
textcolor:=tempc;
trainer.ReadBuffer(tempi,sizeof(integer));
hotkeyleft:=tempi;
trainer.ReadBuffer(tempi,sizeof(integer));
descriptionleft:=tempi;
trainer.ReadBuffer(tempi,sizeof(integer));
editleft:=tempi;
trainer.ReadBuffer(tempi,sizeof(integer));
editwidth:=tempi;
trainer.ReadBuffer(tempbc,sizeof(tbevelcut));
bevelinner:=tempbc;
trainer.ReadBuffer(tempbc,sizeof(tbevelcut));
bevelouter:=tempbc;
trainer.ReadBuffer(tempi,sizeof(integer));
bevelwidth:=tempi;
trainer.ReadBuffer(tempbk,sizeof(tbevelkind));
bevelkind:=tempbk;
trainer.ReadBuffer(tempb,sizeof(boolean));
hascheckbox:=tempb;
trainer.ReadBuffer(tempb,sizeof(boolean));
showhotkeys:=tempb;
parent:=frmTrainerDesigner;
onmousedown:=frmTrainerDesigner.MouseDown;
onmousemove:=frmTrainerDesigner.MouseMove;
onmouseup:=frmTrainerDesigner.MouseUp;
end;
end;
2: begin
//tcheat
with tcheat.create(frmTrainerDesigner) do
begin
trainer.ReadBuffer(temp,sizeof(integer));
left:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
top:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
width:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
height:=temp;
trainer.ReadBuffer(cheatnr,sizeof(integer));
trainer.ReadBuffer(tempc,sizeof(tcolor));
activationcolor:=tempc;
trainer.ReadBuffer(tempc,sizeof(tcolor));
color:=tempc;
trainer.ReadBuffer(tempc,sizeof(tcolor));
textcolor:=tempc;
trainer.ReadBuffer(tempi,sizeof(integer));
hotkeyleft:=tempi;
trainer.ReadBuffer(tempi,sizeof(integer));
descriptionleft:=tempi;
trainer.ReadBuffer(tempi,sizeof(integer));
editleft:=tempi;
trainer.ReadBuffer(tempi,sizeof(integer));
editwidth:=tempi;
trainer.ReadBuffer(tempb,sizeof(boolean));
hascheckbox:=tempb;
trainer.ReadBuffer(tempb,sizeof(boolean));
showhotkey:=tempb;
parent:=frmTrainerDesigner;
onmousedown:=frmTrainerDesigner.MouseDown;
onmousemove:=frmTrainerDesigner.MouseMove;
onmouseup:=frmTrainerDesigner.MouseUp;
end;
end;
3: begin
//timage
with timage2.create(frmTrainerDesigner) do
begin
trainer.ReadBuffer(temp,sizeof(integer));
left:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
top:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
width:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
height:=temp;
trainer.ReadBuffer(tempcursor,sizeof(tcursor));
cursor:=tempcursor;
trainer.ReadBuffer(tempb,sizeof(tempb));
stretch:=tempb;
trainer.ReadBuffer(tempb,sizeof(tempb));
transparent:=tempb;
trainer.ReadBuffer(tempi,sizeof(integer));
tag:=tempi;
trainer.ReadBuffer(temp,4);
if temp>0 then
begin
picture.Bitmap.LoadFromStream(trainer);
end;
//command
trainer.ReadBuffer(temp,4);
getmem(x,temp+1);
trainer.ReadBuffer(x^,temp);
x[temp]:=#0;
command:=x;
freemem(x);
parent:=frmTrainerDesigner;
onmousedown:=frmTrainerDesigner.MouseDown;
onmousemove:=frmTrainerDesigner.MouseMove;
onmouseup:=frmTrainerDesigner.MouseUp;
end;
end;
4: begin
with tlabel2.Create(frmTrainerDesigner) do
begin
trainer.ReadBuffer(temp,sizeof(integer));
left:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
top:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
width:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
height:=temp;
//caption
trainer.ReadBuffer(temp,4);
getmem(x,temp+1);
trainer.ReadBuffer(x^,temp);
x[temp]:=#0;
caption:=x;
freemem(x);
//wordwrap
trainer.ReadBuffer(tempb,sizeof(boolean));
wordwrap:=tempb;
//color
trainer.ReadBuffer(tempc,sizeof(tcolor));
font.Color:=tempc;
//command
trainer.ReadBuffer(temp,4);
getmem(x,temp+1);
trainer.ReadBuffer(x^,temp);
x[temp]:=#0;
command:=x;
freemem(x);
//cursor
trainer.ReadBuffer(tempcursor,sizeof(tcursor));
cursor:=tempcursor;
//tag
trainer.ReadBuffer(tempi,sizeof(integer));
tag:=tempi;
trainer.ReadBuffer(tempb,sizeof(tempb));
if tempb then
Font.Style:=[fsUnderline]
else
Font.Style:=[];
parent:=frmTrainerDesigner;
onmousedown:=frmTrainerDesigner.MouseDown;
onmousemove:=frmTrainerDesigner.MouseMove;
onmouseup:=frmTrainerDesigner.MouseUp;
end;
end;
$ffffffff: break;
else raise exception.Create(strunknowncomponent+Inttostr(temp));
end;
end;
end;
end;
//fill in the list of cheats
for i:=0 to length(frmMemoryModifier.trainerdata)-1 do
begin
frmMemoryModifier.recordview.Items.Add.caption:=frmMemoryModifier.trainerdata[i].description;
frmMemoryModifier.recordview.Items[frmMemoryModifier.recordview.Items.count-1].SubItems.add(frmMemoryModifier.trainerdata[i].hotkeytext);
end;
frmMemoryTrainerPreview.UpdateScreen;
if frmtrainerdesigner<>nil then frmtrainerdesigner.updatecheats
end;
procedure LoadTrainer5(trainer:TFilestream);
var temp: dword;
tempb: boolean;
tempc: tcolor;
tempi: integer;
tempbc: tbevelcut;
tempbk: tbevelkind;
tempcursor: tcursor;
i,j,k:integer;
x: pchar;
image: pointer;
// trainerdata1: array of TTrainerData1;
begin
with frmMemoryModifier do
begin
//size of trainerdata
trainer.ReadBuffer(temp,4);
setlength(frmMemoryModifier.trainerdata,temp);
for i:=0 to length(trainerdata)-1 do
begin
//description
trainer.ReadBuffer(temp,4);
getmem(x,temp+1);
trainer.ReadBuffer(x^,temp);
x[temp]:=#0;
trainerdata[i].description:=x;
freemem(x);
//hotkeytext
trainer.ReadBuffer(temp,4);
getmem(x,temp+1);
trainer.ReadBuffer(x^,temp);
x[temp]:=#0;
trainerdata[i].hotkeytext:=x;
freemem(x);
trainer.readbuffer(trainerdata[i].hotkey,2);
trainer.readBuffer(trainerdata[i].hotshift,sizeof(trainerdata[i].hotshift));
trainer.ReadBuffer(temp,4);
setlength(trainerdata[i].codeentrys,temp);
//opcodes of this cheat
for j:=0 to length(trainerdata[i].codeentrys)-1 do
begin
//address
trainer.ReadBuffer(trainerdata[i].codeentrys[j].address,4);
//original opcode
trainer.ReadBuffer(temp,4);
setlength(trainerdata[i].codeentrys[j].originalopcode,temp);
trainer.ReadBuffer(pointer(trainerdata[i].codeentrys[j].originalopcode)^,temp);
end;
//address entrys
trainer.ReadBuffer(temp,4);
setlength(trainerdata[i].addressentrys,temp);
for j:=0 to length(trainerdata[i].addressentrys)-1 do
begin
trainer.ReadBuffer(trainerdata[i].addressentrys[j].address,sizeof(trainerdata[i].addressentrys[j].address));
trainer.ReadBuffer(trainerdata[i].addressentrys[j].ispointer,sizeof(trainerdata[i].addressentrys[j].ispointer));
trainer.ReadBuffer(tempi,4);
setlength(trainerdata[i].addressentrys[j].pointers,tempi);
for k:=0 to tempi-1 do
begin
trainer.readBuffer(trainerdata[i].addressentrys[j].pointers[k].address,sizeof(trainerdata[i].addressentrys[j].pointers[k].address));
trainer.readBuffer(trainerdata[i].addressentrys[j].pointers[k].offset,sizeof(trainerdata[i].addressentrys[j].pointers[k].offset));
end;
trainer.ReadBuffer(trainerdata[i].addressentrys[j].bit,sizeof(trainerdata[i].addressentrys[j].bit));
trainer.ReadBuffer(trainerdata[i].addressentrys[j].memtyp,sizeof(trainerdata[i].addressentrys[j].memtyp));
trainer.Readbuffer(trainerdata[i].addressentrys[j].frozen,sizeof(trainerdata[i].addressentrys[j].frozen));
trainer.Readbuffer(trainerdata[i].addressentrys[j].frozendirection,sizeof(trainerdata[i].addressentrys[j].frozendirection));
trainer.Readbuffer(trainerdata[i].addressentrys[j].setvalue,sizeof(trainerdata[i].addressentrys[j].setvalue));
trainer.ReadBuffer(trainerdata[i].addressentrys[j].userinput,sizeof(trainerdata[i].addressentrys[j].userinput));
trainer.ReadBuffer(temp,4);
getmem(x,temp+1);
trainer.ReadBuffer(x^,temp);
x[temp]:=#0;
trainerdata[i].addressentrys[j].value:=x;
freemem(x);
// trainer.Readbuffer(trainerdata[i].addressentrys[j].value,50);
if trainerdata[i].addressentrys[j].userinput then
begin
trainerdata[i].hasedit:=true;
trainerdata[i].editvalue:=trainerdata[i].addressentrys[j].value;
end;
end;
end;
//title
trainer.ReadBuffer(temp,4);
getmem(x,temp+1);
trainer.ReadBuffer(x^,temp);
x[temp]:=#0;
edittitle.Text:=x;
freemem(x);
//launch filename
trainer.ReadBuffer(temp,4);
getmem(x,temp+1);
trainer.ReadBuffer(x^,temp);
x[temp]:=#0;
edit2.Text:=x;
freemem(x);
//autolaunch
trainer.ReadBuffer(tempb,sizeof(tempb));
checkbox2.Checked:=tempb;
//popup on keypress
trainer.ReadBuffer(tempb,sizeof(tempb));
checkbox1.Checked:=tempb;
//process name
trainer.ReadBuffer(temp,4);
getmem(x,temp+1);
trainer.ReadBuffer(x^,temp);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -