In-engine runtime console / log ring buffer for DevTools. 更多...
#include <ConsolePanel.hpp>
Public 类型 | |
| using | ImGuiDrawer = void(*)(ConsolePanel &panel) |
Public 成员函数 | |
| ConsolePanel (const ConsolePanel &)=delete | |
| ConsolePanel & | operator= (const ConsolePanel &)=delete |
| void | setVisible (bool on) |
| bool | isVisible () const |
| void | toggleVisible () |
| void | addLog (std::string level, std::string text) |
| Append a leveled log line (thread-safe). | |
| void | addInfo (std::string text) |
| void | addWarn (std::string text) |
| void | addError (std::string text) |
| void | clear () |
| void | setMaxEntries (size_t n) |
| std::vector< ConsoleLine > | recent (size_t max=128) const |
| std::string | format (size_t max=128) const |
| void | attach (HSQUIRRELVM vm) |
Attach to a Squirrel VM: capture print/script errors into the log. | |
| void | detach () |
| bool | isAttached () const |
| std::string | eval (const std::string &expression) |
| Evaluate a Squirrel expression against the root table and return a formatted result (or error message). Works as a runtime REPL. | |
| void | drawImGui () |
| Optional ImGui draw hook. Default no-op: console UI is registered by the host (see setImGuiDrawer) so EVDevTools does not include imgui.h. | |
静态 Public 成员函数 | |
| static ConsolePanel & | instance () |
| static void | setImGuiDrawer (ImGuiDrawer fn) |
友元 | |
| template<typename > | |
| struct | Immortal |
详细描述
In-engine runtime console / log ring buffer for DevTools.
Provides a single place for script and engine messages: leveled log lines, capture of Squirrel print / script errors, and a Squirrel REPL (expression evaluation against the root table). Mirrors the AiPanel design — thread-safe ring buffer, optional ImGui draw hook registered by the host so EVDevTools does not need to include imgui.h.
Script API (Debug builds, eve run --debug): eve.dev.console.log/info/warn/error/debug(text) eve.dev.console.eval(expr) -> result string eve.dev.console.clear() / recent(n) / format(n) / setVisible / toggleVisible
Desktop-only (part of EVDevTools); not shipped on Android/iOS trimmed runtimes.
在文件 ConsolePanel.hpp 第 38 行定义.
成员类型定义说明
◆ ImGuiDrawer
| using eve::dev::ConsolePanel::ImGuiDrawer = void (*)(ConsolePanel& panel) |
在文件 ConsolePanel.hpp 第 77 行定义.
构造及析构函数说明
◆ ConsolePanel()
|
delete |
成员函数说明
◆ addError()
| void eve::dev::ConsolePanel::addError | ( | std::string | text | ) |
◆ addInfo()
| void eve::dev::ConsolePanel::addInfo | ( | std::string | text | ) |
◆ addLog()
| void eve::dev::ConsolePanel::addLog | ( | std::string | level, |
| std::string | text | ||
| ) |
Append a leveled log line (thread-safe).
在文件 ConsolePanel.cpp 第 154 行定义.
引用了 line , 以及 eve::dev::ConsoleLine::timestamp.
被这些函数引用 addError(), addInfo(), addWarn(), attach(), eve::dev::DevTool::attach(), detach(), eval() , 以及 eve::dev::DevTool::exposeScriptApi().
◆ addWarn()
| void eve::dev::ConsolePanel::addWarn | ( | std::string | text | ) |
◆ attach()
| void eve::dev::ConsolePanel::attach | ( | HSQUIRRELVM | vm | ) |
Attach to a Squirrel VM: capture print/script errors into the log.
在文件 ConsolePanel.cpp 第 199 行定义.
引用了 addLog(), detach() , 以及 vm.
被这些函数引用 eve::dev::DevTool::attach().
◆ clear()
| void eve::dev::ConsolePanel::clear | ( | ) |
在文件 ConsolePanel.cpp 第 170 行定义.
被这些函数引用 eve::dev::DevTool::exposeScriptApi().
◆ detach()
| void eve::dev::ConsolePanel::detach | ( | ) |
◆ drawImGui()
| void eve::dev::ConsolePanel::drawImGui | ( | ) |
Optional ImGui draw hook. Default no-op: console UI is registered by the host (see setImGuiDrawer) so EVDevTools does not include imgui.h.
在文件 ConsolePanel.cpp 第 254 行定义.
◆ eval()
| std::string eve::dev::ConsolePanel::eval | ( | const std::string & | expression | ) |
Evaluate a Squirrel expression against the root table and return a formatted result (or error message). Works as a runtime REPL.
在文件 ConsolePanel.cpp 第 217 行定义.
引用了 addLog(), eve::script::captureCompileError(), eve::script::ScriptErrorContext::empty(), eve::script::formatScriptError(), eve::script::takeLastScriptError() , 以及 vm.
被这些函数引用 eve::dev::DevTool::exposeScriptApi().
◆ format()
| std::string eve::dev::ConsolePanel::format | ( | size_t | max = 128 | ) | const |
◆ instance()
|
static |
◆ isAttached()
|
inline |
在文件 ConsolePanel.hpp 第 63 行定义.
◆ isVisible()
| bool eve::dev::ConsolePanel::isVisible | ( | ) | const |
在文件 ConsolePanel.cpp 第 147 行定义.
被这些函数引用 eve::dev::DevTool::exposeScriptApi() , 以及 toggleVisible().
◆ operator=()
|
delete |
◆ recent()
| std::vector< ConsoleLine > eve::dev::ConsolePanel::recent | ( | size_t | max = 128 | ) | const |
在文件 ConsolePanel.cpp 第 181 行定义.
被这些函数引用 eve::dev::DevTool::exposeScriptApi() , 以及 format().
◆ setImGuiDrawer()
|
static |
在文件 ConsolePanel.cpp 第 252 行定义.
引用了 fn.
◆ setMaxEntries()
| void eve::dev::ConsolePanel::setMaxEntries | ( | size_t | n | ) |
在文件 ConsolePanel.cpp 第 175 行定义.
引用了 n.
◆ setVisible()
| void eve::dev::ConsolePanel::setVisible | ( | bool | on | ) |
在文件 ConsolePanel.cpp 第 142 行定义.
被这些函数引用 eve::dev::DevTool::exposeScriptApi() , 以及 toggleVisible().
◆ toggleVisible()
| void eve::dev::ConsolePanel::toggleVisible | ( | ) |
在文件 ConsolePanel.cpp 第 152 行定义.
引用了 isVisible() , 以及 setVisible().
被这些函数引用 eve::dev::DevTool::exposeScriptApi().
友元及相关函数文档
◆ Immortal
|
friend |
在文件 ConsolePanel.hpp 第 82 行定义.
该类的文档由以下文件生成:
- src/engine/devtools/ConsolePanel.hpp
- src/engine/devtools/ConsolePanel.cpp