📄 opensave.pas
字号:
x[temp]:=#0;
combobox1.Text:=x;
freemem(x);
//hotkeytext
trainer.ReadBuffer(temp,4);
getmem(x,temp+1);
trainer.ReadBuffer(x^,temp);
x[temp]:=#0;
edithotkey.Text:=x;
freemem(x);
//hotkey+shiftstate
trainer.ReadBuffer(laststate,sizeof(laststate));
trainer.ReadBuffer(lastshiftstate,sizeof(lastshiftstate));
//abouttext
trainer.ReadBuffer(temp,4);
getmem(x,temp+1);
trainer.ReadBuffer(x^,temp);
x[temp]:=#0;
memo1.Text:=x;
freemem(x);
//freeze interval
trainer.ReadBuffer(tempi,sizeof(tempi));
editFreezeInterval.text:=inttostr(tempi);
trainer.ReadBuffer(temp,4);
if temp=$666 then
begin
//default
//leftside image
trainer.ReadBuffer(temp,4); //size of the image
if temp>0 then
begin
//getmem(image,temp);
//trainer.ReadBuffer(image^,temp);
frmMemorytrainerpreview.Image1.Picture.Bitmap.LoadFromStream(trainer);
end;
//windowwidth
trainer.readbuffer(temp,sizeof(frmMemorytrainerpreview.Width));
frmMemorytrainerpreview.Width:=temp;
//windowheight
trainer.readbuffer(temp,sizeof(frmMemorytrainerpreview.height));
frmMemorytrainerpreview.height:=temp;
//leftsidewidth
trainer.readbuffer(temp,sizeof(frmMemorytrainerpreview.Panel1.Width));
frmMemorytrainerpreview.Panel1.Width:=temp;
//leftsideheight
trainer.readbuffer(temp,sizeof(frmMemorytrainerpreview.Panel1.height));
frmMemorytrainerpreview.Panel1.height:=temp;
end
else
begin
//user defined
frmMemoryModifier.dontshowdefault:=true; //obsolete
frmMemoryModifier.Button7.Click;
//windowwidth
trainer.readbuffer(temp,4);
frmTrainerDesigner.Width:=temp;
//windowheight
trainer.readbuffer(temp,4);
frmTrainerDesigner.height:=temp;
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;
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;
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 LoadTrainer4(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);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -