View previous topic :: View next topic |
Author |
Message |
maplecheck Expert Cheater
Reputation: 0
Joined: 22 Jan 2006 Posts: 139
|
Posted: Mon Mar 07, 2011 1:22 am Post subject: Fixed bugs for description and comments |
|
|
fixed this bugs
http://cheatengine.org/mantis/view.php?id=249
open memoryrecordunit.pas file.
Code: |
procedure TMemoryRecord.setXMLnode(CheatEntry: TDOMNode);
var
tempsa:ansistring;
begin
....................
tempnode:=CheatEntry.FindNode('Description');
if tempnode<>nil then
begin
tempsa:=tempnode.TextContent;
Description:= ansitoutf8(tempsa);
end;
|
open opensave.pas file
Code: |
procedure SaveXML(Filename: string);
............
............
for i:=0 to AdvancedOptions.numberofcodes-1 do
begin
CodeRecord:=CodeRecords.AppendChild(doc.CreateElement('CodeEntry'));
CodeRecord.AppendChild(doc.CreateElement('Description')).TextContent:=utf8toansi(advancedoptions.codelist2.Items[i].SubItems[0]);
........
........
if comments.memo1.Lines.Count>0 then
begin
comment:=CheatTable.AppendChild(doc.CreateElement('Comments'));
comment.TextContent:=utf8toansi(comments.Memo1.text);
end;
if comments.mLuaScript.lines.count>0 then
begin
luascript:=CheatTable.AppendChild(doc.CreateElement('LuaScript'));
luascript.TextContent:=utf8toansi(comments.mLuaScript.text);
end;
|
Code: |
change tempdescription to widestring type
procedure LoadXML(doc: TXMLDocument; merge: boolean);
...
...
tempsa:=tempdescription;
temps:=ansitoutf8(tempsa);
li.SubItems.Add(temps);
...
...
Commentsunit.Comments.Memo1.clear;
if comments<>nil then
begin
tempsa:=comments.textcontent;
temps:=ansitoutf8(tempsa);
s:='';
for i:=1 to length(temps) do
begin
if not (temps[i] in [#13,#10]) then
s:=s+temps[i]
else
begin
if s<>'' then
begin
//new line
Commentsunit.Comments.Memo1.Lines.add(s);
s:='';
end;
end;
end;
if s<>'' then
Commentsunit.Comments.Memo1.Lines.add(s);
end;
Commentsunit.Comments.mLuaScript.clear;
if luaScript<>nil then
begin
tempsa:=luaScript.textcontent;
temps:=ansitoutf8(tempsa);
s:='';
for i:=1 to length(temps) do
begin
if not (temps[i] in [#13,#10]) then
s:=s+temps[i]
else
begin
if s<>'' then
begin
//new line
Commentsunit.Comments.mLuaScript.Lines.add(s);
s:='';
end;
end;
end;
if s<>'' then
Commentsunit.Comments.mLuaScript.Lines.add(s);
end;
|
open tableconverter.pas file
Code: |
function ConvertCheatTableToXML(filename: string): TXMLDocument;
...
...
t:=cheatEntry.AppendChild(doc.CreateElement('Description'));
t.TextContent:=x;
...
...
|
tested and works fine.
with Lazarus 0.9.31[/code]
Last edited by maplecheck on Mon Mar 07, 2011 10:02 am; edited 3 times in total |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25791 Location: The netherlands
|
Posted: Mon Mar 07, 2011 4:50 am Post subject: |
|
|
you tested the tableconverter as well? Because that only affects 5.x cheat tables
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
maplecheck Expert Cheater
Reputation: 0
Joined: 22 Jan 2006 Posts: 139
|
Posted: Mon Mar 07, 2011 5:39 am Post subject: |
|
|
yes, I tested the tableconverter as well.
works fine with 5.x and 6.0 cheat tables
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25791 Location: The netherlands
|
Posted: Mon Mar 07, 2011 6:55 am Post subject: |
|
|
since there is no way for me to test, couldn't you just do this?
Code: |
cheatEntry.AppendChild(doc.CreateElement('Description')).TextContent:=utf8toansi('"'+description+'"');
|
Or will that result into something bad?
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
maplecheck Expert Cheater
Reputation: 0
Joined: 22 Jan 2006 Posts: 139
|
Posted: Mon Mar 07, 2011 9:42 am Post subject: |
|
|
Code: | cheatEntry.AppendChild(doc.CreateElement('Description')).TextContent:=utf8toansi('"'+description+'"');
|
I tested this code, also can works fine.
|
|
Back to top |
|
 |
|