- ambits en la consola

- verifica que la habitacio de debug.yaml existisca
This commit is contained in:
2026-04-02 22:45:27 +02:00
parent 7287d65ca3
commit 9ffd29bea8
7 changed files with 120 additions and 9 deletions

View File

@@ -17,6 +17,7 @@ struct CommandDef {
bool debug_only{false};
bool help_hidden{false};
bool dynamic_completions{false};
std::vector<std::string> scopes; // Ámbitos: "global", "game", "editor", "debug"
std::unordered_map<std::string, std::vector<std::string>> completions;
};
@@ -40,9 +41,11 @@ class CommandRegistry {
[[nodiscard]] auto generateTerminalHelp() const -> std::string;
[[nodiscard]] auto generateConsoleHelp() const -> std::string;
// Scope activo (filtra comandos visibles en help y tab completion)
void setScope(const std::string& scope) { active_scope_ = scope; }
[[nodiscard]] auto getScope() const -> const std::string& { return active_scope_; }
// TAB completion
// Devuelve las opciones de completado para un path dado (ej: "SHADER", "SHADER PRESET")
// Combina completions estáticas del YAML con dinámicas registradas en C++
[[nodiscard]] auto getCompletions(const std::string& path) const -> std::vector<std::string>;
[[nodiscard]] auto getVisibleKeywords() const -> std::vector<std::string>;
@@ -51,6 +54,8 @@ class CommandRegistry {
std::unordered_map<std::string, CommandHandler> handlers_;
std::unordered_map<std::string, std::vector<std::string>> completions_map_;
std::unordered_map<std::string, DynamicCompletionProvider> dynamic_providers_;
std::string active_scope_; // Scope activo ("" = sin filtro, muestra todo)
void registerHandlers();
[[nodiscard]] auto isCommandVisible(const CommandDef& cmd) const -> bool;
};