Skip to content

Commit

Permalink
Asc sort Route step option
Browse files Browse the repository at this point in the history
  • Loading branch information
Neogeekmo committed May 7, 2024
1 parent fe5069a commit 8a437bd
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions helper/Utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,14 @@ local function qpartTableToString(tbl, level, parrentKey)
local str = "{\n"
local itemIndent = string.rep(" ", level + 1)

for k, v in pairs(tbl) do
local keys = {}
for k in pairs(tbl) do
table.insert(keys, k)
end
table.sort(keys)

for _, k in ipairs(keys) do
local v = tbl[k]
local keyStr = ''
if parrentKey == "Button" then
keyStr = '["' .. tostring(k) .. '"] = '
Expand All @@ -140,13 +147,15 @@ function AprRC:RouteToString(tbl, level)
local str = "{\n"
local itemIndent = string.rep(" ", level + 1)

for k, v in pairs(tbl) do
local keyStr
if type(k) == "string" then
keyStr = k .. " = "
else
keyStr = ""
end
local keys = {}
for k in pairs(tbl) do
table.insert(keys, k)
end
table.sort(keys)

for _, k in ipairs(keys) do
local v = tbl[k]
local keyStr = type(k) == "string" and k .. " = " or ""

if type(v) == "table" then
if next(v) == nil then
Expand Down

0 comments on commit 8a437bd

Please sign in to comment.