Skip to content

Moved debug panel UI to xml#700

Open
Geckostya wants to merge 4 commits into
MihailRis:mainfrom
Geckostya:main
Open

Moved debug panel UI to xml#700
Geckostya wants to merge 4 commits into
MihailRis:mainfrom
Geckostya:main

Conversation

@Geckostya
Copy link
Copy Markdown

I created xml file and input for the debug panel. There is some inconsistency between this panel and the rest debug visualization (gizmo and fps graph), because they being triggered from different locations, but I don't know how to make it better for now

(если что, можно со мной на русском общаться)

Comment thread res/layouts/debug_panel.xml.lua Outdated
@@ -0,0 +1,216 @@
-- Debug panel logic ported from C++ create_debug_panel to Lua XML script.
-- Shows performance, world, player and selection info; provides simple time control.
-- All comments in this file are intentionally in English only.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Комментарий про историю панели излишний. Последняя же строка вообще к коду теме не относится. В целом, из комментарием имеют смысл только:

  • объяснения неочевидных моментов, которые нельзя решить именованием
  • документация публичного API

Comment thread res/layouts/debug_panel.xml.lua Outdated
local function safe_caption(blockid)
-- Expect that the API exists and returns a valid string id
return block.name(blockid)
end
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Отдельная функция не требуется, так как результат block.name и нужно выводить на панели + бессмысленный комментарий

Comment thread res/layouts/debug_panel.xml.lua Outdated
n = tonumber(n) or 0
if n < 10 then return "0"..tostring(n) end
return tostring(n)
end
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В extensions.md уже описана встроенная функция

Comment thread res/layouts/debug_panel.xml.lua Outdated
document.dbg_flags.text = "flags: -"
else
document.dbg_flags.text = "flags: "..table.concat(flags, ", ")
end
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Перенос не подразумевает добавление новых элементов

Comment thread res/layouts/debug_panel.xml.lua Outdated
end
document.dbg_tp_x.consumer = try_teleport
document.dbg_tp_y.consumer = try_teleport
document.dbg_tp_z.consumer = try_teleport
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

За llm стоит проверять
Это просто не будет работать

extern const luaL_Reg vec4lib[]; // vecn.cpp
extern const luaL_Reg weatherlib[]; // gfx.weather
extern const luaL_Reg worldlib[];
extern const luaL_Reg renderlib[];
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

библиотеки графического api реализуются в пакете gfx

{"get_emitters_alive", lua::wrap<l_get_emitters_alive>},
{"get_visible_chunks", lua::wrap<l_get_visible_chunks>},
{"get_entities_next_id", lua::wrap<l_get_entities_next_id>},
{nullptr, nullptr}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В одну кучу свален и рендер и частицы, для которых уже есть библиотека и hud и вообще серверная часть, к рендеру отношения не имеющая

require_world_info().fog = static_cast<float>(value);
return 0;
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Этот старый костыль должен быть удалён, вместе с соответствующим полем в WorldInfo

Copy link
Copy Markdown
Author

@Geckostya Geckostya Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я тогда просто пока уберу фог из этой либы и в дебаг менюшке заменю на clouds, а удаление его совсем лучше сделать другим коммитом кмк

<checkbox id="dbg_cb_minimap" size="400,24"
supplier="render.get_show_generator_minimap"
consumer="render.set_show_generator_minimap">Show Generator Minimap</checkbox>
</panel>
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Бред LLM, начиная с несуществующих свойств text, font , заканчивая некорректным использованием checkbox

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Про чекбокс не понял. Вроде работает как ожидается

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants