From f54370de7e4214cb7813d26b1a39a8f6e42b7b56 Mon Sep 17 00:00:00 2001 From: hnOsmium0001 Date: Mon, 25 Apr 2022 20:22:07 -0700 Subject: Initial work on rendering sprites to screen --- source/EditorCommandPalette.hpp | 49 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 source/EditorCommandPalette.hpp (limited to 'source/EditorCommandPalette.hpp') diff --git a/source/EditorCommandPalette.hpp b/source/EditorCommandPalette.hpp new file mode 100644 index 0000000..1603f41 --- /dev/null +++ b/source/EditorCommandPalette.hpp @@ -0,0 +1,49 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +enum ImCmdTextType { + ImCmdTextType_Regular, + ImCmdTextType_Highlight, + ImCmdTextType_COUNT, +}; + +namespace ImCmd { +struct Command { + const char* Name; + std::function InitialCallback; + std::function SubsequentCallback; + std::function TerminatingCallback; +}; + +// Command management +void AddCommand(Command command); +void RemoveCommand(const char* name); + +// Styling +void SetStyleFont(ImCmdTextType type, ImFont* font); +void SetStyleColor(ImCmdTextType type, ImU32 color); +void ClearStyleColor(ImCmdTextType type); //< Clear the style color for the given type, defaulting to ImGuiCol_Text + +// Command palette widget +void SetNextCommandPaletteSearch(const char* text); +void SetNextCommandPaletteSearchBoxFocused(); +void ShowCommandPalette(const char* name); +bool IsAnyItemSelected(); + +void RemoveCache(const char* name); +void RemoveAllCaches(); + +// Command palette widget in a window helper +void SetNextWindowAffixedTop(ImGuiCond cond = 0); +void ShowCommandPaletteWindow(const char* name, bool* p_open); + +// Command responses, only call these in command callbacks (except TerminatingCallback) +void Prompt(std::vector options); + +} // namespace ImCmd -- cgit v1.2.3-70-g09d2