Auto "Hide children when deactivated"

Section's for general approaches on hacking various options in games. No online-related discussions/posts OR warez!
Post Reply
User avatar
SilverRabbit90
Table Makers
Table Makers
Posts: 225
Joined: Fri Jan 15, 2021 12:01 am
Reputation: 205

Auto "Hide children when deactivated"

Post by SilverRabbit90 »

How can I automatically enable "Hide children when deactivated" for all headers (not just for scripts)?

I've found this that serves to uncheck (disable) only the headers that are not scripts:
Spoiler

Code: Select all

[ENABLE]
{$lua}
if syntaxcheck then return end

function Close_All()
  local al = AddressList
    for i = 0, al.Count - 1 do
        if al[i].Type ~= vtAutoAssembler then
           al[i].Active = false
           al[i].Collapsed = true
        end
    end
end

Close_All()
Selected.Active = false

[DISABLE]
and this that serves to disable all active scripts:
Spoiler

Code: Select all

[ENABLE]
{$lua}
if syntaxcheck then return end

function Disable_All()
  local al = AddressList
    for i = 0, al.Count - 1 do
      if al[i].Type == vtAutoAssembler then
         al[i].Active = false
      end
    end
end

Disable_All()
Selected.Active = false

[DISABLE]

but none of these hides the children of the headers automatically.

Once, I spent several minutes manually right-clicking on a headers, then "Group config," and then "Hide children when deactivated" for every header that had children, and it's a hassle; in fact, I would like a specific script to do that.

Thank you.

User avatar
SilverRabbit90
Table Makers
Table Makers
Posts: 225
Joined: Fri Jan 15, 2021 12:01 am
Reputation: 205

Re: Auto "Hide children when deactivated"

Post by SilverRabbit90 »

Solved with:


To insert in "Show Cheat Table Lua Script" (or press Ctrl+Alt+L)
Spoiler

Code: Select all

function applyHideWhenDeactivatedRecursive(mr)
    -- Check if the memory record is a header or has children
    if mr.Type == 11 or mr.Count > 0 then -- If it's a header or has children
        -- Remove "Always Hide" and set "Hide when deactivated"
        mr.Options = "moHideChildren"
        mr.IsCollapsed = false -- Optional: keep expanded

        -- Recursively apply to subgroups
        for j = 0, mr.Count-1 do
            applyHideWhenDeactivatedRecursive(mr.Child[j])
        end
    end
end

-- Execution
local al = getAddressList()
for i = 0, al.Count-1 do
    applyHideWhenDeactivatedRecursive(al.MemoryRecord[i])
end

if getMainForm() then
    getMainForm().refresh()
end

Or use this script:
apply Hide chlidren when deactivated.CT
(1.19 KiB) Downloaded 4 times

Post Reply

Who is online

Users browsing this forum: No registered users