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 


How to remove right margin/vertical line in lua code editor?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
sportyspice
Newbie cheater
Reputation: 0

Joined: 06 Apr 2017
Posts: 10

PostPosted: Sat Apr 08, 2017 6:40 pm    Post subject: How to remove right margin/vertical line in lua code editor? Reply with quote

I'm not sure what I did, but suddenly an annoying vertical line/right margin appeared in my lua editor. I'd really like to get rid of it.
It shows both in the "Lua script: Cheat Table" window, and also in any other custom "LUA Script" window I open.

I'd attach a screenshot but the forum won't let me cause I'm a new user.
Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 62

Joined: 01 Oct 2008
Posts: 958

PostPosted: Sat Apr 08, 2017 7:13 pm    Post subject: Reply with quote

It seems the property RightEdge of TSynEdit Class control (seems sub class of Memo Class) the line:
The follow code change this property for currently opened TfrmAutoInject form where TSynEdit located.
Code:

for i=0,GetFormCount()-1 do
  local fm = GetForm(i)
  if fm.ClassName=="TfrmAutoInject" then
    local syn = fm.Assemblescreen
    syn.RightEdge = 400 -- column?
    syn.RightEdgeColor = 0xff -- red
  end
end



The following code change the right edge for newly opened TfrmAutoInject to a Global value, save the following text in a *.lua file and place this lua file inside autorun directory of installed CE directory to have the effect automatically.
Code:

GlobalRightEdge      = 400
GlobalRightEdgeColor = 0xff -- red

function SynEditRightEdge(frm)
  if frm.ClassName=="TfrmAutoInject" then
    local timer = createTimer(frm)
    timer.Interval = 100
    timer.OnTimer = function(tm)
      if frm.Assemblescreen then
        if GlobalRightEdge then
          frm.Assemblescreen.RightEdge = GlobalRightEdge
        end
        if GlobalRightEdgeColor then
          frm.Assemblescreen.RightEdgeColor = GlobalRightEdgeColor
        end
        tm.Destroy()
      end
    end
  end
end

if SynEditRightEdge_ID then
  unregisterFormAddNotification(SynEditRightEdge_ID)
end
SynEditRightEdge_ID = registerFormAddNotification(SynEditRightEdge)

_________________
- Retarded.
Back to top
View user's profile Send private message
sportyspice
Newbie cheater
Reputation: 0

Joined: 06 Apr 2017
Posts: 10

PostPosted: Sat Apr 08, 2017 7:28 pm    Post subject: Reply with quote

Thank you, that worked perfectly.
I just set it to -1 instead of 400 though.

**EDIT: Actually, with your autonrun script it only removes it from new Lua Script windows, but doesn't remove it from the main Lua Cheat Table window. If I execute the first script you posted manually, then it gets removed but I don't want to do that every time I run cheat engine.

**EDIT2: I just put the original short script you posted in the autorun folder and that worked perfectly, removing the lines from all windows. Cheers!
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 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