-- ============================================================ -- Debug Visual 2D | [Metropoles]telao -- F9 ativa/desativa | Mostra estado do shader + objetos -- ============================================================ local debugEnabled = true local debugInfo = {} function addDebugInfo(key, value) debugInfo[key] = value end addEventHandler("onClientRender", root, function() if not debugEnabled then return end local y = 10 local W = 420 local col = { header = tocolor(0, 255, 120), ok = tocolor(0, 230, 0), err = tocolor(255, 60, 60), warn = tocolor(255, 200, 0), info = tocolor(140, 200, 255), dim = tocolor(180, 180, 180), } local function row(label, value, color) dxDrawText(label .. value, 10, y, W, y + 18, color or col.info, 1, "default-bold") y = y + 20 end dxDrawText("═══ [Metropoles]telão DEBUG ═══", 10, y, W, y + 18, col.header, 1, "default-bold") y = y + 22 -- Browser local tex = getBrowserTexture() local texOk = tex ~= nil row("Browser CEF : ", texOk and "OK" or "ERRO", texOk and col.ok or col.err) -- RenderTarget local rtSt = debugInfo.renderTarget row("RenderTarget: ", rtSt and "OK" or (rtSt == nil and "?" or "ERRO"), rtSt and col.ok or (rtSt == nil and col.warn or col.err)) -- Shader local shSt = debugInfo.shader row("Shader FX : ", shSt and "OK" or (shSt == nil and "?" or "ERRO"), shSt and col.ok or (shSt == nil and col.warn or col.err)) -- Feeding local feeding = debugInfo.shaderFeeding row("Alimentando : ", feeding and "SIM" or "NÃO (sem telas?)", feeding and col.ok or col.warn) -- Telas local sc = debugInfo.screenCount or 0 row("Objetos 16k : ", tostring(sc), sc > 0 and col.ok or col.err) -- URL local url = debugInfo.currentUrl or "Nenhuma" local urlShort = string.sub(url, 1, 45) .. (string.len(url) > 45 and "…" or "") row("URL atual : ", urlShort, col.info) y = y + 4 dxDrawText("F9 = desativar debug", 10, y, W, y + 16, col.dim, 0.85) end) addEventHandler("onClientKey", root, function(button, press) if button == "f9" and press then debugEnabled = not debugEnabled outputChatBox("[Metropoles]telao: Debug " .. (debugEnabled and "ATIVADO" or "DESATIVADO"), 0, 200, 255) end end)