44 ConsoleWindow(std::shared_ptr<ConsoleVariable> consoleVariable, std::shared_ptr<Window> window,
45 std::shared_ptr<Console> console,
const std::string& visibilityCvar,
const std::string& name,
46 ImVec2 originalSize, uint32_t windowFlags);
97 void Append(
const std::string& channel, spdlog::level::level_enum priority,
const char* fmt, ...);
121 void Append(
const std::string& channel, spdlog::level::level_enum priority,
const char* fmt, va_list args);
124 void OnInit(
const nlohmann::json& initArgs = nlohmann::json::object())
override;
133 spdlog::level::level_enum Priority = spdlog::level::info;
134 std::string Channel =
"Console";
137 static int CallbackStub(ImGuiInputTextCallbackData* data);
138 int32_t ClearCommand(
const std::vector<std::string>& args, std::string* output);
139 int32_t HelpCommand(
const std::vector<std::string>& args, std::string* output);
140 int32_t UnbindCommand(
const std::vector<std::string>& args, std::string* output);
141 int32_t BindCommand(
const std::vector<std::string>& args, std::string* output);
142 int32_t BindToggleCommand(
const std::vector<std::string>& args, std::string* output);
143 int32_t SetCommand(
const std::vector<std::string>& args, std::string* output);
144 int32_t GetCommand(
const std::vector<std::string>& args, std::string* output);
145 static int32_t CheckVarType(
const std::string& input);
147 int32_t mSelectedId = -1;
148 int32_t mHistoryIndex = -1;
149 std::vector<int> mSelectedEntries;
151 std::string mCurrentChannel =
"Console";
152 bool mOpenAutocomplete =
false;
153 char* mInputBuffer =
nullptr;
154 char* mFilterBuffer =
nullptr;
155 std::string mCmdHint =
"None";
156 spdlog::level::level_enum mLevelFilter = spdlog::level::trace;
157 std::map<ImGuiKey, std::string> mBindings;
158 std::map<ImGuiKey, std::string> mBindingToggle;
159 std::vector<std::string> mHistory;
160 std::vector<std::string> mAutoComplete;
161 std::map<std::string, std::vector<ConsoleLine>> mLog;
162 const std::vector<std::string> mLogChannels = {
"Console",
"Logs" };
163 const std::vector<spdlog::level::level_enum> mPriorityFilters = { spdlog::level::off, spdlog::level::critical,
164 spdlog::level::err, spdlog::level::warn,
165 spdlog::level::info, spdlog::level::debug,
166 spdlog::level::trace };
167 const std::vector<ImVec4> mPriorityColours = {
168 ImVec4(0.8f, 0.8f, 0.8f, 1.0f),
169 ImVec4(0.9f, 0.9f, 0.9f, 1.0f),
170 ImVec4(1.0f, 1.0f, 1.0f, 1.0f),
171 ImVec4(1.0f, 0.875f, 0.125f, 1.0f),
172 ImVec4(0.65f, 0.18f, 0.25, 1.0f),
173 ImVec4(0.95f, 0.11f, 0.25, 1.0f),
174 ImVec4(0.0f, 0.0f, 0.0f, 0.0f)
176 static constexpr size_t gMaxBufferSize = 255;
178 std::shared_ptr<Console> mConsole;
179 std::shared_ptr<ConsoleVariable> mConsoleVariables;
ConsoleWindow(std::shared_ptr< ConsoleVariable > consoleVariable, std::shared_ptr< Window > window, std::shared_ptr< Console > console, const std::string &visibilityCvar, const std::string &name, ImVec2 originalSize, uint32_t windowFlags)
Constructs a ConsoleWindow with constructor-injected dependencies.
GuiWindow(std::shared_ptr< ConsoleVariable > consoleVariable, std::shared_ptr< Window > window, const std::string &visibilityCvar, bool isVisible, const std::string &name, ImVec2 originalSize, uint32_t windowFlags)
Full constructor with constructor-injected dependencies, explicit size and window flags.