diff --git a/lua_probject/base_project/Game/View/ResultView.lua b/lua_probject/base_project/Game/View/ResultView.lua index e385ef84..f4a2887c 100644 --- a/lua_probject/base_project/Game/View/ResultView.lua +++ b/lua_probject/base_project/Game/View/ResultView.lua @@ -249,6 +249,8 @@ function M:SetGSListlineGap(linespacing) end function M:InitBigResult(room, fontsize) + print("为什么会来这里000000000000000") + print(InnerFunction()) local big_result = self._view:GetChild('big_result') if big_result ~= nil then local player_list = big_result:GetChild('player_list') diff --git a/lua_probject/base_project/Main.lua b/lua_probject/base_project/Main.lua index eb3a0f81..866df3c1 100644 --- a/lua_probject/base_project/Main.lua +++ b/lua_probject/base_project/Main.lua @@ -379,4 +379,359 @@ function printlog(...) if debug_print then print(...) end -end \ No newline at end of file +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 c4d0f0d1..2373902f 100644 --- a/lua_probject/extend_project/extend/zipai/fanpaofa/EXMainView.lua +++ b/lua_probject/extend_project/extend/zipai/fanpaofa/EXMainView.lua @@ -779,8 +779,8 @@ function M:__FangziTip(tip, _uid, fptype) else self._view:AddChild(_chipeng_tip) _chipeng_tip:Center() - _chipeng_tip.x = _chipeng_tip.x + 600 - _chipeng_tip.y = _chipeng_tip.y - 200 + _chipeng_tip.x = _chipeng_tip.x + 450 + _chipeng_tip.y = _chipeng_tip.y - 100 end end diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa/main/HuTipView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa/main/HuTipView.lua index 7e60d4a5..f847d2d5 100644 --- a/lua_probject/extend_project/extend/zipai/fanpaofa/main/HuTipView.lua +++ b/lua_probject/extend_project/extend/zipai/fanpaofa/main/HuTipView.lua @@ -6,12 +6,12 @@ local HuTipView = { local M = HuTipView function M.new(main_view) - local self = {} - self.class = "HuTipView" - setmetatable(self,{__index = HuTipView}) - self._main_view = main_view - self:init() - return self + local self = {} + self.class = "HuTipView" + setmetatable(self, { __index = HuTipView }) + self._main_view = main_view + self:init() + return self end local function SetObjEnabled(obj, enabled) @@ -22,8 +22,9 @@ function M:OnTouchBegin(context) self._view_start_pos = Vector2(self._view.x, self._view.y) self._touch_start_pos = self._main_view._view:GlobalToLocal(Vector2(context.inputEvent.x, context.inputEvent.y)) end + function M:OnTouchMove(context) - local xy = self._main_view._view:GlobalToLocal(Vector2.New(context.inputEvent.x,context.inputEvent.y)) + local xy = self._main_view._view:GlobalToLocal(Vector2.New(context.inputEvent.x, context.inputEvent.y)) local dist = Vector2(xy.x - self._touch_start_pos.x, xy.y - self._touch_start_pos.y) local posx = self._view_start_pos.x + dist.x local posy = self._view_start_pos.y + dist.y @@ -41,16 +42,20 @@ function M:init() local m_height = self._main_view._view.height self._view.x = 0.115 * m_width --- 0.5 * width --self._view.x = 0 + -- self._view.y = 0.65 * m_height self._view.y = 0.65 * m_height SetObjEnabled(self._view, false) self._view.onTouchBegin:Add(handler(self, self.OnTouchBegin)) self._view.onTouchMove:Add(handler(self, self.OnTouchMove)) end -function M:FillData(cards) +function M:FillData(cards) local lst_card = self._view:GetChild("tingpai") lst_card:RemoveChildrenToPool() local num = #cards + local n0 = self._view:GetChild("n0") + n0.height = 130 + n0.width = 76 * #cards + 150 if num > 0 then if num > 4 and num < 28 then self._view.width = 191 + ((num > 4 and 6 or num) - 3) * 38 @@ -66,4 +71,4 @@ function M:FillData(cards) end end -return M \ No newline at end of file +return M diff --git a/wb_new_ui/.objs/metas/1utjt0r2/ufu92i.info b/wb_new_ui/.objs/metas/1utjt0r2/ufu92i.info index d04551a1..72d03a3e 100644 --- a/wb_new_ui/.objs/metas/1utjt0r2/ufu92i.info +++ b/wb_new_ui/.objs/metas/1utjt0r2/ufu92i.info @@ -6,6 +6,9 @@ "n84_rbpg": { "hidden": true }, + "n55_rx2e": { + "collapsed": true + }, "n4_fux2": { "hidden": true } diff --git a/wb_new_ui/.objs/metas/8wph7p8n/yffnmy.info b/wb_new_ui/.objs/metas/8wph7p8n/yffnmy.info index 6cbc974a..1aae7ef5 100644 --- a/wb_new_ui/.objs/metas/8wph7p8n/yffnmy.info +++ b/wb_new_ui/.objs/metas/8wph7p8n/yffnmy.info @@ -3,13 +3,10 @@ "n87_q50p": { "hidden": true }, - "n155_diqo": { - "collapsed": true - }, "n166_ukp7": { "hidden": true }, - "n179_yffn": { + "n155_diqo": { "collapsed": true }, "n131_ckvb": { diff --git a/wb_new_ui/.objs/workspace.json b/wb_new_ui/.objs/workspace.json index f2741964..b3f277a1 100644 --- a/wb_new_ui/.objs/workspace.json +++ b/wb_new_ui/.objs/workspace.json @@ -2,24 +2,61 @@ "libview.firstColumnWidth": 413, "libview.iconScale": 0, "doc.openedDocs": [ - "ui://m7iejg4610snh5j", - "ui://m7iejg46h46p7ish", - "ui://m7iejg4610i2p7isr", - "ui://m7iejg4610i2p7iss" + "ui://lkq9ne9speuq8b", + "ui://lkq9ne9speuq6p", + "ui://lkq9ne9speuq5a", + "ui://lkq9ne9speuq2q", + "ui://lkq9ne9speuq9m", + "ui://lkq9ne9speuq9k", + "ui://lkq9ne9speuqt", + "ui://lkq9ne9so0c1ru", + "ui://1utjt0r2ufu92i" ], "test.device": "Huawei Mate20", "canvasColor": 10066329, "auxline2": true, - "doc.activeDoc": "ui://m7iejg4610i2p7iss", + "doc.activeDoc": "ui://lkq9ne9speuq2q", "libview.twoColumn": false, "libview.expandedNodes": [ + "27vd145b", + "/", + "27vd145b", + "/images/", + "1utjt0r2", + "/", + "1utjt0r2", + "/component/", + "1utjt0r2", + "/component/clearing/", + "1utjt0r2", + "/component/clearing/image/", + "lkq9ne9s", + "/", + "lkq9ne9s", + "/component/", + "lkq9ne9s", + "/component/HuTip/", + "lkq9ne9s", + "/component/Main/", + "lkq9ne9s", + "/component/Main/images/", + "lkq9ne9s", + "/component/cards/", + "lkq9ne9s", + "/component/images/", + "lkq9ne9s", + "/component/niao/", + "yzaioi79", + "/", + "yzaioi79", + "/component/", + "yzaioi79", + "/component/HuTip/", "m7iejg46", "/", "m7iejg46", "/component/", "m7iejg46", - "/component/Lst_room/", - "m7iejg46", "/images/" ], "auxline1": true, diff --git a/wb_new_ui/assets/Common/package.xml b/wb_new_ui/assets/Common/package.xml index 9d1a42b9..7c40a4e4 100644 --- a/wb_new_ui/assets/Common/package.xml +++ b/wb_new_ui/assets/Common/package.xml @@ -1559,6 +1559,7 @@ + diff --git a/wb_new_ui/assets/Common/屏幕截图 2026-03-11 203420.png b/wb_new_ui/assets/Common/屏幕截图 2026-03-11 203420.png new file mode 100644 index 00000000..0da7b8f6 Binary files /dev/null and b/wb_new_ui/assets/Common/屏幕截图 2026-03-11 203420.png differ diff --git a/wb_new_ui/assets/Extend_Poker_FanPaoFa/component/clearing/image/shengli_zipai.png b/wb_new_ui/assets/Extend_Poker_FanPaoFa/component/clearing/image/shengli_zipai.png index d4aa2b30..bf94aacd 100644 Binary files a/wb_new_ui/assets/Extend_Poker_FanPaoFa/component/clearing/image/shengli_zipai.png and b/wb_new_ui/assets/Extend_Poker_FanPaoFa/component/clearing/image/shengli_zipai.png differ diff --git a/wb_new_ui/assets/Extend_Poker_FanPaoFa/component/clearing/result_zipai_main.xml b/wb_new_ui/assets/Extend_Poker_FanPaoFa/component/clearing/result_zipai_main.xml index 02c54b61..bcc08764 100644 --- a/wb_new_ui/assets/Extend_Poker_FanPaoFa/component/clearing/result_zipai_main.xml +++ b/wb_new_ui/assets/Extend_Poker_FanPaoFa/component/clearing/result_zipai_main.xml @@ -1,7 +1,7 @@ - - + + @@ -27,29 +27,29 @@ - + - + - + - - - - - + + + + + - + - - - - + + + + @@ -58,27 +58,27 @@ - + - - + + -