From 389ce15e23ecb6db8d5c89a4ce95021647c36108 Mon Sep 17 00:00:00 2001 From: 1076390229 <1076390229@qq.com> Date: Thu, 12 Mar 2026 17:12:53 +0800 Subject: [PATCH] 3 --- lua_probject/base_project/Main.lua | 111 +++++++++++++++++- wb_new_ui/.objs/metas/lkq9ne9s/peuq9n.info | 10 ++ .../Main/component/Player_card_info_1.xml | 2 +- .../component/option/Gcm_action_tips.xml | 2 +- .../main_zipai/ui/Main_RunBeard_fui.bytes | Bin 178614 -> 178614 bytes 5 files changed, 122 insertions(+), 3 deletions(-) create mode 100644 wb_new_ui/.objs/metas/lkq9ne9s/peuq9n.info diff --git a/lua_probject/base_project/Main.lua b/lua_probject/base_project/Main.lua index eb3a0f81..b9a1897f 100644 --- a/lua_probject/base_project/Main.lua +++ b/lua_probject/base_project/Main.lua @@ -379,4 +379,113 @@ function printlog(...) if debug_print then print(...) end -end \ No newline at end of file +end + +function TableToString(t, indent, visited) + if type(t) ~= "table" then + if type(t) == "string" then + return '"' .. t:gsub('["\\]', '\\%0') .. '"' + elseif type(t) == "number" or type(t) == "boolean" then + return tostring(t) + elseif type(t) == "function" then + -- 尝试获取函数名 + local info = debug.getinfo(t, "n") + if info and info.name and info.name ~= "" then + return '""' + else + return '""' + end + else + return '"<' .. type(t) .. '>"' + end + end + + visited = visited or {} + if visited[t] then + return '""' + end + visited[t] = true + + indent = indent or "" + local nextIndent = indent .. " " + + -- 更准确的数组检测 + local isArray = true + local maxIndex = 0 + for k in pairs(t) do + if type(k) ~= "number" or k < 1 or k ~= math.floor(k) then + isArray = false + break + end + if k > maxIndex then + maxIndex = k + end + end + + -- 检查连续性 + if isArray and maxIndex > 0 then + for i = 1, maxIndex do + if t[i] == nil then + isArray = false + break + end + end + end + + local result = "" + + if isArray then + result = result .. "[" + local parts = {} + for i = 1, maxIndex do + parts[i] = TableToString(t[i], nextIndent, visited) + end + result = result .. table.concat(parts, ",") + result = result .. "]" + else + result = result .. "{\n" + local parts = {} + local count = 0 + + for k, v in pairs(t) do + count = count + 1 + local key + if type(k) == "string" and string.match(k, "^[a-zA-Z_][a-zA-Z0-9_]*$") then + key = '"' .. k .. '"' -- 即使是标识符也加双引号,保持JSON格式 + else + key = '"' .. tostring(k):gsub('["\\]', '\\%0') .. '"' + end + + local valueStr + if type(v) == "function" then + -- 对函数进行特殊处理,只显示方法名 + local info = debug.getinfo(v, "n") + if info and info.name and info.name ~= "" then + valueStr = '""' + else + valueStr = '""' + end + else + valueStr = TableToString(v, nextIndent, visited) + end + + parts[count] = nextIndent .. key .. ": " .. valueStr + end + + -- 按键名排序,使输出更一致 + table.sort(parts, function(a, b) + local keyA = a:match('^%s*"([^"]+)"') + local keyB = b:match('^%s*"([^"]+)"') + return (keyA or "") < (keyB or "") + end) + + result = result .. table.concat(parts, ",\n") + if count > 0 then + result = result .. "\n" .. indent + end + result = result .. "}" + end + + visited[t] = nil + return result +end diff --git a/wb_new_ui/.objs/metas/lkq9ne9s/peuq9n.info b/wb_new_ui/.objs/metas/lkq9ne9s/peuq9n.info new file mode 100644 index 00000000..ad079af9 --- /dev/null +++ b/wb_new_ui/.objs/metas/lkq9ne9s/peuq9n.info @@ -0,0 +1,10 @@ +{ + "objectStatus": { + "n76_oqog": { + "collapsed": true + }, + "n77_oqog": { + "collapsed": true + } + } +} \ No newline at end of file diff --git a/wb_new_ui/assets/Main_RunBeard/component/Main/component/Player_card_info_1.xml b/wb_new_ui/assets/Main_RunBeard/component/Main/component/Player_card_info_1.xml index b5092bd2..93d4200e 100644 --- a/wb_new_ui/assets/Main_RunBeard/component/Main/component/Player_card_info_1.xml +++ b/wb_new_ui/assets/Main_RunBeard/component/Main/component/Player_card_info_1.xml @@ -17,7 +17,7 @@ - + diff --git a/wb_new_ui/assets/Main_RunBeard/component/option/Gcm_action_tips.xml b/wb_new_ui/assets/Main_RunBeard/component/option/Gcm_action_tips.xml index 2676dd6b..1181c51a 100644 --- a/wb_new_ui/assets/Main_RunBeard/component/option/Gcm_action_tips.xml +++ b/wb_new_ui/assets/Main_RunBeard/component/option/Gcm_action_tips.xml @@ -1,7 +1,7 @@ - + diff --git a/wb_unity_pro/Assets/ART/base/main_zipai/ui/Main_RunBeard_fui.bytes b/wb_unity_pro/Assets/ART/base/main_zipai/ui/Main_RunBeard_fui.bytes index b10764488f13149bb642da9d25080837e34da352..225bd7b785d84f381c64e6e263798fb48cb65fb3 100644 GIT binary patch delta 39 xcmV+?0NDSw^9r`}3b2o(lS88!m#`H936t-a3bVVTEvo@Chv`lMx9Ls-&1!$E5@rAZ delta 36 ucmV+<0Nekz^9r`}3b2o(0jiV17a^1HmkP7Hqb;ie0Eg*L0k`Q+0?leuz!7r*