- Es pot posar shader preset directament per nom desde la consola
- shader preset i palette ja autocompleten amb la llista de noms
This commit is contained in:
@@ -359,26 +359,10 @@ void Console::handleEvent(const SDL_Event& event) {
|
||||
} else {
|
||||
const std::string base_cmd = upper.substr(0, space_pos);
|
||||
const std::string sub_prefix = upper.substr(space_pos + 1);
|
||||
if (registry_.hasDynamicCompletions(base_cmd) && base_cmd == "PALETTE" && Screen::get() != nullptr) {
|
||||
// NEXT/PREV primero, luego todos los nombres de paleta disponibles
|
||||
for (const auto* sv : {"NEXT", "PREV"}) {
|
||||
if (sub_prefix.empty() || std::string_view{sv}.starts_with(sub_prefix)) {
|
||||
tab_matches_.emplace_back("PALETTE " + std::string(sv));
|
||||
}
|
||||
}
|
||||
for (const auto& name : Screen::get()->getPaletteNames()) {
|
||||
if (sub_prefix.empty() || std::string_view{name}.starts_with(sub_prefix)) {
|
||||
tab_matches_.emplace_back("PALETTE " + name);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
const auto* opts = registry_.getCompletions(base_cmd);
|
||||
if (opts != nullptr) {
|
||||
for (const auto& arg : *opts) {
|
||||
if (sub_prefix.empty() || std::string_view{arg}.starts_with(sub_prefix)) {
|
||||
tab_matches_.emplace_back(base_cmd + " " + arg);
|
||||
}
|
||||
}
|
||||
const auto opts = registry_.getCompletions(base_cmd);
|
||||
for (const auto& arg : opts) {
|
||||
if (sub_prefix.empty() || std::string_view{arg}.starts_with(sub_prefix)) {
|
||||
tab_matches_.emplace_back(base_cmd + " " + arg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user