Stanzilla / AdvancedInterfaceOptions

WoW Addon that restores access to removed interface options in Legion
https://www.curseforge.com/wow/addons/advancedinterfaceoptions
48 stars 13 forks source link

Dump all changed CVars #47

Closed yaerox closed 2 years ago

yaerox commented 2 years ago

This is rather a question then an issue, but is there any chance to dump all changed values comapred to Blizzard Stock Settings?

Ketho commented 2 years ago

Looks like a lot of graphics cvars are always different from the default

function DumpNondefaultCvars()
    local t = {}
    local cvars = C_Console.GetAllCommands()
    for _, info in pairs(cvars) do
        local default = GetCVarDefault(info.command)
        local cur = GetCVar(info.command)
        if default ~= cur then
            tinsert(t, {info.command, default, cur})
        end
    end
    sort(t, function(a, b)
        return a[1]:lower() < b[1]:lower()
    end)
    for _, cvar in pairs(t) do
        print(unpack(cvar))
    end
end

image

yaerox commented 2 years ago

@Ketho would you tell me where do I have to put the function to call it and do this on my client? Thanks in advance

Ketho commented 2 years ago

Oh, just throw it into https://addon.bool.no/ and call it with /run DumpNondefaultCvars() in the chat window

Or use addons like https://www.curseforge.com/wow/addons/wowlua

yaerox commented 2 years ago

Sorry for answering late. But maybe someone here can clear some things up for me. I

Now I expect the AddOn to basically show nothing because I have 100% fully stock UI and settings, right? At least for me, even then the list is damn long:

image image image

yaerox commented 2 years ago

I modified the AddOn so I can dump and set all cvars. So I Dumped > Set all default > Dumped again and I had to do this a couple times then the dumped list got smaller. Like really small (5-7 lines). As soon as I restarted the game the dump was again huge like on the screenshots above.

semlar commented 2 years ago

There is a "Reset Settings" button in the bottom right of the window that opens when you type /aio into the chat; this will attempt to reset every CVar to its default value.

Most of the CVars in your list are graphics settings; if you clicked the "Recommended" button under the System Graphics menu then it sounds like it set them to recommended values based on your computer specs rather than their default settings.

Some of the remaining CVars are tracking UI settings like whether you have the Quest log expanded or collapsed next to the world map so it can remember your preferences between sessions.

Ketho commented 2 years ago

Now I expect the AddOn to basically show nothing because I have 100% fully stock UI and settings, right? At least for me, even then the list is damn long:

I assumed you would try to filter that list (since we're on github), something like

local hidden = {
    activeCUFProfile = true,
    audioLocale = true,
    cameraSavedDistance = true,
}

function DumpNondefaultCvars()
    local t = {}
    local cvars = C_Console.GetAllCommands()
    for _, info in pairs(cvars) do
        local default = GetCVarDefault(info.command)
        local cur = GetCVar(info.command)
        if default ~= cur and not hidden[info.command] then
            tinsert(t, {info.command, default, cur})
        end
    end
    sort(t, function(a, b)
        return a[1]:lower() < b[1]:lower()
    end)
    for _, cvar in pairs(t) do
        print(unpack(cvar))
    end
end

But yeah those graphics cvars are probably set to the recommended instead of the actual defaults...

yaerox commented 2 years ago

Most of the CVars in your list are graphics settings; if you clicked the "Recommended" button under the System Graphics menu then it sounds like it set them to recommended values based on your computer specs rather than their default settings.

Yeah that's right. Didn't notiuced that on the first look. On the other hand, that's as well what I'm looking for. I have some performance issues which I'm trying to recreating using a stock UI to have valid arguments that the issue is not on my side. Anyway, thank you both.

What I did with your code was just replacing tinsert(t, {info.command, default, cur}) with SetCVar(info.command, default). Not clean but seemed like it worked.

Ketho commented 2 years ago

If you want to simply reset all cvars you can use

/console cvar_default
yaerox commented 2 years ago

I never was really sure if it does exactly this because the result wasn't the same very time I used it. Especially for graphic settings. But seems like we found the reason why.