Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Fixed bugs for description and comments

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Source
View previous topic :: View next topic  
Author Message
maplecheck
Expert Cheater
Reputation: 0

Joined: 22 Jan 2006
Posts: 139

PostPosted: Mon Mar 07, 2011 1:22 am    Post subject: Fixed bugs for description and comments Reply with quote

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
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25791
Location: The netherlands

PostPosted: Mon Mar 07, 2011 4:50 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
maplecheck
Expert Cheater
Reputation: 0

Joined: 22 Jan 2006
Posts: 139

PostPosted: Mon Mar 07, 2011 5:39 am    Post subject: Reply with quote

yes, I tested the tableconverter as well.
works fine with 5.x and 6.0 cheat tables
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25791
Location: The netherlands

PostPosted: Mon Mar 07, 2011 6:55 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
maplecheck
Expert Cheater
Reputation: 0

Joined: 22 Jan 2006
Posts: 139

PostPosted: Mon Mar 07, 2011 9:42 am    Post subject: Reply with quote

Code:
cheatEntry.AppendChild(doc.CreateElement('Description')).TextContent:=utf8toansi('"'+description+'"');


I tested this code, also can works fine.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Source All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites