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 


Help Changing Panel1 Color

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Zephiles
Advanced Cheater
Reputation: 0

Joined: 04 Feb 2016
Posts: 56

PostPosted: Sun Nov 27, 2016 12:44 am    Post subject: Help Changing Panel1 Color Reply with quote

Basically what I want to do is change the color of the background where the addresses are stored. This seems to be stored in Panel1, but changing the color of this panel doesn't work. Can someone give me a proper way to do this?
Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 30

Joined: 01 Oct 2008
Posts: 700

PostPosted: Sun Nov 27, 2016 4:18 am    Post subject: Reply with quote

Should be this one (tested on ce 6.6, not sure older version):
Code:

GetAddressList().Control[0].BackgroundColor = 0xff88


Code:

GetPropertyList result with 'Color'

GetAddressList()
    CheckboxActiveColor
    checkboxActiveSelectedColor
    CheckboxColor
    CheckboxSelectedColor
    Color
    DecreaseArrowColor
    ExpandSignColor
    IncreaseArrowColor
    ParentColor
    SelectedBackgroundColor
    SelectedSecondaryBackgroundColor

GetAddressList().Control[0]
    BackgroundColor
    Color
    ExpandSignColor
    ParentColor
    SelectionColor
    SelectionFontColor
    SelectionFontColorUsed
    SeparatorColor
    TreeLineColor


btw, there is a related AddressList Extension for ce 6.5 (yet to update to 6.6) http://forum.cheatengine.org/viewtopic.php?t=593563&postdays=0&postorder=asc&start=0

bye~

_________________
- Retarded.
Back to top
View user's profile Send private message
Zephiles
Advanced Cheater
Reputation: 0

Joined: 04 Feb 2016
Posts: 56

PostPosted: Sun Nov 27, 2016 5:59 pm    Post subject: Reply with quote

Alright that works, but unfortunately I can't do what I'm trying to do with those properties. Basically what I want to do is invert the colors of all of the elements in the panel. So for example, the background would be black and the addresses (the full line, not just the text) would be white. When an address is selected, it would turn white, with the text turning black. Is something like this easily doable?
Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 30

Joined: 01 Oct 2008
Posts: 700

PostPosted: Mon Nov 28, 2016 1:59 am    Post subject: Reply with quote

hi,
the background color seems have 2 part,
for with a memory record,
GetAddressList().Control[0].BackgroundColor = 0xff88
and not with a memory record
GetAddressList().Control[0].Color = 0xff88

--

It seems the behaviors that, some record is not colored full line but only description text, is related to record type?
Only 'Value' type is colored full line(?),
'script type' and 'group header' is render differently,
ie. description text have a separated color background from other part of the line as you said.

I've no idea how to deal with it~

bye~

_________________
- Retarded.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 68

Joined: 06 Jul 2014
Posts: 2171

PostPosted: Mon Nov 28, 2016 12:37 pm    Post subject: Reply with quote

Code:
local al = getAddressList()
local tv = al.Control[0]
local enabled = false
local penMode,memrecInvert
if cheatEngineIs64Bit() then
  penMode = getAddress('cheatengine-x86_64.exe+1CB17C',true)
  memrecInvert = getAddress('cheatengine-x86_64.exe+1CB229',true)
else
  penMode = getAddress('cheatengine-i386.exe+17D22E',true)
  memrecInvert = getAddress('cheatengine-i386.exe+17D2CF',true)
end
assert(readIntegerLocal(penMode) == 0xcba and byteTableToWord(readBytesLocal(memrecInvert,2,true)) == 0x4774,'CE Version not valid')

local sysColors = {}
local function invertColor(t,p)
  if t[p] then
    if t[p] & 0x80000000 ~= 0 then
      local i = t[p] & 0xffffff
      if not sysColors[i] then sysColors[i] = executeCodeLocal('User32.GetSysColor',i) end
      t[p] = sysColors[i]
    end
    t[p] = ~t[p] & 0xffffff
  end
end

function invertAddressList()
  enabled = not enabled

  invertColor(al,'CheckboxActiveColor')
  invertColor(al,'checkboxActiveSelectedColor')
  invertColor(al,'CheckboxColor')
  invertColor(al,'CheckboxSelectedColor')
  invertColor(al,'DecreaseArrowColor')
  invertColor(al,'ExpandSignColor')
  invertColor(al,'IncreaseArrowColor')
  invertColor(al,'SelectedBackgroundColor')
  invertColor(al,'SelectedSecondaryBackgroundColor')

  invertColor(tv,'BackgroundColor')
  tv.Color = tv.BackgroundColor
  invertColor(tv,'SelectionFontColor')
  invertColor(tv,'SeparatorColor')
  invertColor(tv,'TreeLineColor')

  if enabled then
    writeBytesLocal(penMode+1,0x04)
    writeBytesLocal(memrecInvert,0x75)
  else
    writeBytesLocal(penMode+1,0x0c)
    writeBytesLocal(memrecInvert,0x74)
  end
end

Most stuff can be dealt with pretty easily. The main problem is that the mode of the pen which renders the selection color is set to pmMask meaning that it isn't going to show up on a black background. For now, I made a workaround that I probably won't update for future versions of CE.

There's also a minor problem with the memory records' text color not being inverted by default. Inverting each memory record's color individually is easy, but that won't affect new memory records. Since I was already using a cheap workaround, I figured it wouldn't matter if I added another one to fix this problem.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
budabum
Newbie cheater
Reputation: 0

Joined: 28 Feb 2018
Posts: 19

PostPosted: Wed Dec 26, 2018 5:14 am    Post subject: Reply with quote

what CE version is it for?

tried on 6.8.1 & 6.8.2
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 68

Joined: 06 Jul 2014
Posts: 2171

PostPosted: Wed Dec 26, 2018 10:30 pm    Post subject: Reply with quote

Based on the date, probably 6.6.

You could just remove the stuff about penMode / memrecInvert and it'll work (perhaps not as well). Or look through CE's source and make it again... whatever works.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
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 Lua Scripting 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