I want the dropdown list to auto change color.
example: i have 0:OFF , 1:ON and 2:ERROR.
I want OFF show as black color in table value, ON show as green and ERROR show as red.
whenever the value change so do the color change.
any idea?
Re: Dropdown list + auto change color?
Posted: Sun Mar 21, 2021 1:20 pm
by TimFun13
You could use a timer, and check the value then change the memory records color as needed. Or you could use "OnGetDisplayValue" to set the color of the memory record.
You could use a timer, and check the value then change the memory records color as needed. Or you could use "OnGetDisplayValue" to set the color of the memory record.
im just start cheating 2 days ago. i need a full tutorial how to do it. pls
You could use a timer, and check the value then change the memory records color as needed. Or you could use "OnGetDisplayValue" to set the color of the memory record.
This is plenty of help already as it is. You can refer to Lua tutorials on the main CEF forums, but the general pseudocode could:
--sets function for all memrecs, but you can alternatively check for specific indexes or descriptions if you don't want that
al = getAddressList()
for i = 1, al.Count then
al[i].OnGetDisplayValue = function(mr, value)
if value == 0 then
mr.Color = integer for black # i'm guessing you can specify these using hex values like so 0x00000000
elif value == 1 then
mr.Color = integer for green #0x00FF00
elif value == 2 then
mr.Color = integer for red #0xFF0000
end
end
Should be rather simple if you know Lua which you're probably going to find useful if you're going to be making tables or CE trainers regularly. Rather than waiting for someone to post some readily working code, CEF forums is very helpful