diff --git a/lua_probject/base_project/Game/View/Common/BaseView.lua b/lua_probject/base_project/Game/View/Common/BaseView.lua index 3a84e41c..d27066c0 100644 --- a/lua_probject/base_project/Game/View/Common/BaseView.lua +++ b/lua_probject/base_project/Game/View/Common/BaseView.lua @@ -31,6 +31,8 @@ local view_url = { --@param self --@param #string url function M:InitView(url) + print("什么鬼地址"..url) + print(InnerFunction()) self._root_view = UIPackage.CreateObjectFromURL(self._full and view_url[2] or view_url[1]) local contentPane = self._root_view:GetChild("contentPane") self._view = UIPackage.CreateObjectFromURL(url) diff --git a/lua_probject/base_project/Main.lua b/lua_probject/base_project/Main.lua index dad759c5..323d4e4b 100644 --- a/lua_probject/base_project/Main.lua +++ b/lua_probject/base_project/Main.lua @@ -389,3 +389,359 @@ function printlog(...) print(...) end end + +function PrintStackTrace(ignoreCount, options) + -- 默认参数 + ignoreCount = ignoreCount or 3 + options = options or {} + + -- 合并配置选项 + local config = { + maxDepth = options.maxDepth or 20, + indentSize = options.indentSize or 2, + showVariables = options.showVariables ~= false, -- 默认true + maxVariableLength = options.maxVariableLength or 50, + showLineNumbers = options.showLineNumbers ~= false, + showFunctionType = options.showFunctionType ~= false, + showFullPath = options.showFullPath or false, + colorOutput = options.colorOutput or false, + skipDebuggerFrames = options.skipDebuggerFrames ~= false, + debuggerFiles = options.debuggerFiles or { + "debugger.lua", + "LuaDebugger.lua", + "=[C]" + }, + includeTimestamp = options.includeTimestamp or false, + maxStackDepth = options.maxStackDepth or 100 + } + + -- ANSI颜色代码(用于彩色输出) + local colors = { + reset = "\27[0m", + red = "\27[31m", + green = "\27[32m", + yellow = "\27[33m", + blue = "\27[34m", + magenta = "\27[35m", + cyan = "\27[36m", + white = "\27[37m", + gray = "\27[90m" + } + + -- 如果不支持彩色输出,使用空字符串 + if not config.colorOutput then + for k, _ in pairs(colors) do + colors[k] = "" + end + end + + -- 辅助函数:判断是否为调试器自身的帧 + local function isDebuggerFrame(frameInfo) + if not config.skipDebuggerFrames then + return false + end + + for _, pattern in ipairs(config.debuggerFiles) do + if frameInfo.src and frameInfo.src:find(pattern, 1, true) then + return true + end + if frameInfo.source and frameInfo.source:find(pattern, 1, true) then + return true + end + end + return false + end + + -- 辅助函数:格式化变量值(限制长度) + local function formatValue(value, maxLength) + if value == nil then + return colors.gray .. "nil" .. colors.reset + end + + local valueType = type(value) + local str + + if valueType == "string" then + str = colors.green .. string.format("%q", value) .. colors.reset + elseif valueType == "number" then + str = colors.yellow .. tostring(value) .. colors.reset + elseif valueType == "boolean" then + str = colors.cyan .. tostring(value) .. colors.reset + elseif valueType == "table" then + local mt = getmetatable(value) + if mt and mt.__tostring then + str = tostring(value) + else + str = colors.magenta .. string.format("table: %p", value) .. colors.reset + end + elseif valueType == "function" then + str = colors.blue .. string.format("function: %p", value) .. colors.reset + elseif valueType == "userdata" or valueType == "thread" then + str = colors.white .. string.format("%s: %p", valueType, value) .. colors.reset + else + str = colors.gray .. tostring(value) .. colors.reset + end + + -- 限制长度 + if #str > maxLength * 2 then -- 乘以2因为ANSI代码也占长度 + str = str:sub(1, maxLength * 2) .. "..." + end + + return str + end + + -- 辅助函数:格式化变量信息 + local function formatVariables(vars, indent) + if not vars or not config.showVariables then + return "" + end + + local lines = {} + local prefix = string.rep(" ", indent) + + -- 处理局部变量 + if vars.locals then + local hasLocals = false + local localNames = {} + for name, _ in pairs(vars.locals) do + table.insert(localNames, name) + end + table.sort(localNames) -- 按字母顺序排序 + + for _, name in ipairs(localNames) do + local info = vars.locals[name] + if not hasLocals then + table.insert(lines, prefix .. colors.cyan .. "Local Variables:" .. colors.reset) + hasLocals = true + end + local valueStr = formatValue(info.value, config.maxVariableLength) + table.insert(lines, string.format("%s %s%s%s = %s", + prefix, colors.yellow, name, colors.reset, valueStr)) + end + end + + -- 处理上值(upvalues) + if vars.upvalues then + local hasUpvalues = false + local upvalueNames = {} + for name, _ in pairs(vars.upvalues) do + table.insert(upvalueNames, name) + end + table.sort(upvalueNames) + + for _, name in ipairs(upvalueNames) do + local info = vars.upvalues[name] + if not hasUpvalues then + table.insert(lines, prefix .. colors.cyan .. "Upvalues:" .. colors.reset) + hasUpvalues = true + end + local valueStr = formatValue(info.value, config.maxVariableLength) + table.insert(lines, string.format("%s %s%s%s = %s", + prefix, colors.yellow, name, colors.reset, valueStr)) + end + end + + if #lines > 0 then + return table.concat(lines, "\n") .. "\n" + end + return "" + end + + -- 获取堆栈信息 + local stackInfo = {} + local outputLines = {} + + -- 添加标题 + if config.includeTimestamp then + table.insert(outputLines, colors.white .. "=== Stack Trace @" .. os.date("%H:%M:%S") .. " ===" .. colors.reset) + else + table.insert(outputLines, colors.white .. "=== Stack Trace ===" .. colors.reset) + end + + -- 收集堆栈信息 + local frameCount = 0 + local skippedDebuggerFrames = 0 + + for level = ignoreCount, config.maxStackDepth do + local source = debug.getinfo(level, "Snlf") + if not source then + break + end + + -- 构建栈帧信息 + local frameInfo = { + level = level - ignoreCount + 1, + src = source.source, + funcName = source.name or "", + currentline = source.currentline, + linedefined = source.linedefined, + lastlinedefined = source.lastlinedefined, + what = source.what, + namewhat = source.namewhat or "", + source = source.source + } + + -- 跳过调试器自身的帧 + if isDebuggerFrame(frameInfo) then + skippedDebuggerFrames = skippedDebuggerFrames + 1 + goto continue + end + + -- 达到最大显示深度时停止 + if frameCount >= config.maxDepth then + table.insert(outputLines, colors.gray .. string.format("... (%d more frames hidden)", + (config.maxStackDepth - level + 1)) .. colors.reset) + break + end + + -- 格式化文件路径 + local filePath + if config.showFullPath then + filePath = source.source + else + -- 提取文件名 + if source.source:sub(1, 1) == "@" then + local path = source.source:sub(2) + local _, filename = path:match("^.*[/\\](.+)$") + filePath = filename or path + elseif source.source:sub(1, 1) == "=" then + filePath = source.source:sub(2) + else + filePath = "[string]" + end + end + + -- 构建帧描述 + local indent = string.rep(" ", config.indentSize) + local framePrefix = string.format("#%d ", frameCount + 1) + + local frameLine + if config.showLineNumbers then + if source.currentline > 0 then + frameLine = string.format("%s%s in %s%s%s at %s%s%s:%s%d%s", + colors.white, framePrefix, + colors.yellow, frameInfo.funcName, colors.reset, + colors.blue, filePath, colors.reset, + colors.green, source.currentline, colors.reset) + else + frameLine = string.format("%s%s in %s%s%s at %s%s%s", + colors.white, framePrefix, + colors.yellow, frameInfo.funcName, colors.reset, + colors.blue, filePath, colors.reset) + end + else + frameLine = string.format("%s%s in %s%s%s", + colors.white, framePrefix, + colors.yellow, frameInfo.funcName, colors.reset) + end + + -- 添加函数类型信息 + if config.showFunctionType then + local typeColor = colors.gray + if source.what == "Lua" then + typeColor = colors.green + elseif source.what == "C" then + typeColor = colors.red + elseif source.what == "main" then + typeColor = colors.cyan + end + + frameLine = frameLine .. string.format(" [%s%s%s]", + typeColor, source.what, colors.reset) + end + + table.insert(outputLines, frameLine) + + -- 获取并格式化变量 + if config.showVariables then + local success, vars = pcall(function() + local varInfo = {} + + -- 获取局部变量 + varInfo.locals = {} + local idx = 1 + while true do + local name, value = debug.getlocal(level + 1, idx) + if not name then break end + + -- 过滤掉调试器内部变量 + if not name:find("^_debugger_") then + varInfo.locals[name] = { + value = value, + type = type(value) + } + end + idx = idx + 1 + end + + -- 获取上值 + varInfo.upvalues = {} + local func = debug.getinfo(level + 1, "f").func + if func then + idx = 1 + while true do + local name, value = debug.getupvalue(func, idx) + if not name then break end + + varInfo.upvalues[name] = { + value = value, + type = type(value) + } + idx = idx + 1 + end + end + + return varInfo + end) + + if success then + local varsStr = formatVariables(vars, config.indentSize * 2) + if varsStr ~= "" then + table.insert(outputLines, varsStr) + end + end + end + + frameCount = frameCount + 1 + + -- 到达主程序层时停止 + if source.what == "main" then + break + end + + ::continue:: + end + + -- 添加统计信息 + table.insert(outputLines, "") + table.insert(outputLines, colors.gray .. string.format( + "Total frames: %d (skipped %d debugger frames)", + frameCount, skippedDebuggerFrames) .. colors.reset) + + -- 如果没有找到任何帧 + if frameCount == 0 then + table.insert(outputLines, + colors.yellow .. "No stack frames found (possibly all frames were skipped)" .. colors.reset) + end + + -- 添加分隔线 + table.insert(outputLines, colors.white .. "====================" .. colors.reset) + + return table.concat(outputLines, "\n") +end + +function InnerFunction() + local x = 42 + local name = "Test" + local data = { a = 1, b = 2 } + + -- 打印堆栈信息 + local trace = PrintStackTrace(2, { + showVariables = false, + colorOutput = false, + maxDepth = 20 + }) + + return trace +end + diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa/EXMainView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa/EXMainView.lua index 3b7825a7..0b092683 100644 --- a/lua_probject/extend_project/extend/zipai/fanpaofa/EXMainView.lua +++ b/lua_probject/extend_project/extend/zipai/fanpaofa/EXMainView.lua @@ -94,10 +94,12 @@ function M:setBtn() local rightpanel = self._view:GetChild('right_panel') local btn_rule = rightpanel:GetChild('btn_log') local gcm_chat = self._view:GetChild('gcm_chat') + + -- # zlx 20260208 注释两行 local _btn_chat = gcm_chat:GetChild('n1') - _btn_chat:GetChild('icon').icon = 'ui://Main_RunBeard/chat_img' + -- # _btn_chat:GetChild('icon').icon = 'ui://Main_RunBeard/chat_img' local btn_record = gcm_chat:GetChild('btn_record') - btn_record:GetChild('icon').icon = 'ui://Main_RunBeard/yuyin_img' + -- # btn_record:GetChild('icon').icon = 'ui://Main_RunBeard/yuyin_img' if btn_rule ~= nil then btn_rule.onClick:Set( diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPMainView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPMainView.lua index dc6411eb..6605a1ee 100644 --- a/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPMainView.lua +++ b/lua_probject/extend_project/extend/zipai/fanpaofa/main/ZPMainView.lua @@ -185,6 +185,40 @@ function M:InitView(url, isdisplay, open_social, change_card_size, qihu) --printlog("OneventResultinit8") self:InitXiPai1() --printlog("OneventResultinit9") + + local btn_safe = self._view:GetChild('btn_safe') + self.safe_arrow1 = btn_safe:GetChild("arrow1") + self.safe_arrow2 = btn_safe:GetChild("arrow2") + btn_safe.onClick:Set( + function() + self:BtnsSafe() + end + ) + self:BtnsSafe() +end + +-- zlx 20260208 +function M:BtnsSafe() + local btn_temp1 = self._view:GetChild("btn_back_lobby") + local btn_temp2 = self._view:GetChild("Btn_jiesan_lobby") + local btn_temp3 = self._view:GetChild("btn_leave_lobby") + local btn_temp4 = self._view:GetChild("btn_setting") + + btn_temp1.visible = not btn_temp1.visible + btn_temp2.visible = not btn_temp2.visible + btn_temp3.visible = not btn_temp3.visible + btn_temp4.visible = not btn_temp4.visible + + local safe = self._view:GetChild("safe_bg") + safe.visible = not safe.visible + + if safe.visible then + self.safe_arrow1.visible = false + self.safe_arrow2.visible = true + else + self.safe_arrow1.visible = true + self.safe_arrow2.visible = false + end end function M:InitXiPai() @@ -301,7 +335,7 @@ end -- 设置 更新 手牌大小 function M:UpdateCardSize(index) - -- print("lingmeng UpdateCardSize") + -- print("lingmeng UpdateCardSize") if index == 0 then self._room.change_card_size = 1.3 elseif index == 1 then diff --git a/qyq_new_unity/Assets/ART/base/main_majiang/ui/MajiangCard3d_atlas0.png b/qyq_new_unity/Assets/ART/base/main_majiang/ui/MajiangCard3d_atlas0.png index 85f03107..e078dbbb 100644 Binary files a/qyq_new_unity/Assets/ART/base/main_majiang/ui/MajiangCard3d_atlas0.png and b/qyq_new_unity/Assets/ART/base/main_majiang/ui/MajiangCard3d_atlas0.png differ diff --git a/qyq_new_unity/Assets/ART/base/main_majiang/ui/MajiangCard3d_fui.bytes b/qyq_new_unity/Assets/ART/base/main_majiang/ui/MajiangCard3d_fui.bytes index 8d46756e..f8239774 100644 Binary files a/qyq_new_unity/Assets/ART/base/main_majiang/ui/MajiangCard3d_fui.bytes and b/qyq_new_unity/Assets/ART/base/main_majiang/ui/MajiangCard3d_fui.bytes differ diff --git a/qyq_new_unity/Assets/ART/base/ui/Extend_Poker_FanPaoFa_atlas0.png b/qyq_new_unity/Assets/ART/base/ui/Extend_Poker_FanPaoFa_atlas0.png index 7a8cce42..83b76b2d 100644 Binary files a/qyq_new_unity/Assets/ART/base/ui/Extend_Poker_FanPaoFa_atlas0.png and b/qyq_new_unity/Assets/ART/base/ui/Extend_Poker_FanPaoFa_atlas0.png differ diff --git a/qyq_new_unity/Assets/ART/base/ui/Extend_Poker_FanPaoFa_atlas0_1.png b/qyq_new_unity/Assets/ART/base/ui/Extend_Poker_FanPaoFa_atlas0_1.png index e921c960..15f2dbf8 100644 Binary files a/qyq_new_unity/Assets/ART/base/ui/Extend_Poker_FanPaoFa_atlas0_1.png and b/qyq_new_unity/Assets/ART/base/ui/Extend_Poker_FanPaoFa_atlas0_1.png differ diff --git a/qyq_new_unity/Assets/ART/base/ui/Extend_Poker_FanPaoFa_atlas_rbpg9t.png b/qyq_new_unity/Assets/ART/base/ui/Extend_Poker_FanPaoFa_atlas_rbpg9t.png index 4416f295..bc07b6f1 100644 Binary files a/qyq_new_unity/Assets/ART/base/ui/Extend_Poker_FanPaoFa_atlas_rbpg9t.png and b/qyq_new_unity/Assets/ART/base/ui/Extend_Poker_FanPaoFa_atlas_rbpg9t.png differ diff --git a/qyq_new_unity/Assets/ART/base/ui/Extend_Poker_FanPaoFa_atlas_rbpg9u.png b/qyq_new_unity/Assets/ART/base/ui/Extend_Poker_FanPaoFa_atlas_rbpg9u.png index cef6e1ef..0fd687a2 100644 Binary files a/qyq_new_unity/Assets/ART/base/ui/Extend_Poker_FanPaoFa_atlas_rbpg9u.png and b/qyq_new_unity/Assets/ART/base/ui/Extend_Poker_FanPaoFa_atlas_rbpg9u.png differ diff --git a/qyq_new_unity/Assets/ART/base/ui/Extend_Poker_FanPaoFa_fui.bytes b/qyq_new_unity/Assets/ART/base/ui/Extend_Poker_FanPaoFa_fui.bytes index bd66e581..2721be6a 100644 Binary files a/qyq_new_unity/Assets/ART/base/ui/Extend_Poker_FanPaoFa_fui.bytes and b/qyq_new_unity/Assets/ART/base/ui/Extend_Poker_FanPaoFa_fui.bytes differ diff --git a/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0.png b/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0.png index 743eac91..264250a7 100644 Binary files a/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0.png and b/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0.png differ diff --git a/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0_1.png b/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0_1.png index c1042649..97e3cd5a 100644 Binary files a/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0_1.png and b/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0_1.png differ diff --git a/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0_2.png b/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0_2.png index 96794687..998d2e45 100644 Binary files a/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0_2.png and b/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0_2.png differ diff --git a/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0_3.png b/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0_3.png index 17776330..24dfac85 100644 Binary files a/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0_3.png and b/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0_3.png differ diff --git a/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0_4.png b/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0_4.png index 4077b487..c1441f57 100644 Binary files a/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0_4.png and b/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0_4.png differ diff --git a/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0_5.png b/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0_5.png index 21dde2c5..64132595 100644 Binary files a/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0_5.png and b/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0_5.png differ diff --git a/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0_6.png b/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0_6.png index 8df0760c..cab171e9 100644 Binary files a/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0_6.png and b/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0_6.png differ diff --git a/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0_7.png b/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0_7.png index 70b3e020..7e76fd6b 100644 Binary files a/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0_7.png and b/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_atlas0_7.png differ diff --git a/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_fui.bytes b/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_fui.bytes index 4e9249b3..0b6704df 100644 Binary files a/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_fui.bytes and b/qyq_new_unity/Assets/ART/base/ui/Main_RunBeard_bak_fui.bytes differ diff --git a/wb_new_ui/.objs/metas/lkq9ne9s/peuq6e.info b/wb_new_ui/.objs/metas/lkq9ne9s/peuq6e.info new file mode 100644 index 00000000..34ba557a --- /dev/null +++ b/wb_new_ui/.objs/metas/lkq9ne9s/peuq6e.info @@ -0,0 +1,10 @@ +{ + "objectStatus": { + "n89_ybf5": { + "collapsed": true + }, + "n33_e7qn": { + "collapsed": true + } + } +} \ No newline at end of file diff --git a/wb_new_ui/.objs/metas/lkq9ne9s/peuq6r.info b/wb_new_ui/.objs/metas/lkq9ne9s/peuq6r.info new file mode 100644 index 00000000..a0439d1e --- /dev/null +++ b/wb_new_ui/.objs/metas/lkq9ne9s/peuq6r.info @@ -0,0 +1,19 @@ +{ + "objectStatus": { + "n86_ybf5": { + "collapsed": true + }, + "n39_e7qn": { + "collapsed": true + }, + "n57_r1mo": { + "collapsed": true + }, + "n74_o49p": { + "collapsed": true + }, + "n49_lr5d": { + "collapsed": true + } + } +} \ No newline at end of file diff --git a/wb_new_ui/.objs/metas/lkq9ne9s/peuq8b.info b/wb_new_ui/.objs/metas/lkq9ne9s/peuq8b.info new file mode 100644 index 00000000..4439c5c2 --- /dev/null +++ b/wb_new_ui/.objs/metas/lkq9ne9s/peuq8b.info @@ -0,0 +1,7 @@ +{ + "objectStatus": { + "n154_r1mo": { + "collapsed": true + } + } +} \ No newline at end of file diff --git a/wb_new_ui/assets/Common/buttons/Frame 1153.png b/wb_new_ui/assets/Common/buttons/Frame 1153.png new file mode 100644 index 00000000..7ca88a03 Binary files /dev/null and b/wb_new_ui/assets/Common/buttons/Frame 1153.png differ diff --git a/wb_new_ui/assets/Common/font/images/win/shurukuang5.png b/wb_new_ui/assets/Common/font/images/win/shurukuang5.png index 964a98f9..7dddb9f9 100644 Binary files a/wb_new_ui/assets/Common/font/images/win/shurukuang5.png and b/wb_new_ui/assets/Common/font/images/win/shurukuang5.png differ diff --git a/wb_new_ui/assets/Common/package.xml b/wb_new_ui/assets/Common/package.xml index 343f3877..db529854 100644 --- a/wb_new_ui/assets/Common/package.xml +++ b/wb_new_ui/assets/Common/package.xml @@ -1355,6 +1355,7 @@ + diff --git a/wb_new_ui/assets/Main_RunBeard/component/Main/Main_2.xml b/wb_new_ui/assets/Main_RunBeard/component/Main/Main_2.xml index 66773608..b2e6ff50 100644 --- a/wb_new_ui/assets/Main_RunBeard/component/Main/Main_2.xml +++ b/wb_new_ui/assets/Main_RunBeard/component/Main/Main_2.xml @@ -1,22 +1,37 @@ - + - + - + + + + + + + + + + + + + + + + - + @@ -24,66 +39,51 @@ - - - - - - + + - + + + + +