config: keep general category on top

This commit is contained in:
DBFBlackbull
2025-08-02 16:52:15 +02:00
committed by GitHub
parent 344354d975
commit 91a7dc6160
+13 -1
View File
@@ -123,7 +123,19 @@ settings.load = function(self)
local entrysize = 22
local previous = nil
for category, entries in ShaguTweaks.spairs(gui) do
local sortedKeys = {}
for key, value in pairs(gui) do
table.insert(sortedKeys, key)
end
table.sort(sortedKeys, function(a, b)
if a == T["General"] then return true end
if b == T["General"] then return false end
return a < b
end)
for _, category in ipairs(sortedKeys) do
local entries = gui[category]
local entry, spacing = 1, 22
local height = 0