MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / ComboAutoSelectData

Class ComboAutoSelectData

KBotExt/Misc.h:468–485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

466#pragma warning( push )
467#pragma warning( disable : 4996 )
468 struct ComboAutoSelectData
469 {
470 std::vector<std::string> items;
471 int index = -1;
472 char input[128] = {};
473
474 ComboAutoSelectData() = default;
475
476 explicit ComboAutoSelectData(const std::vector<std::string>& hints, const int selected_index = -1)
477 : items(hints)
478 {
479 if (selected_index > -1 && selected_index < static_cast<int>(items.size()))
480 {
481 strncpy(input, items[selected_index].c_str(), sizeof(input) - 1);
482 index = selected_index;
483 }
484 }
485 };
486
487 inline bool ComboAutoSelectComplex(const char* label, char* input, const int inputlen, int* current_item,
488 std::vector<std::string> data, const int items_count, const ImGuiComboFlags flags)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected