Added option to lock the menu order

This commit is contained in:
AlexandreRouma
2022-03-31 01:03:31 +02:00
parent 03f173a3ac
commit 8d78eb301c
5 changed files with 19 additions and 1 deletions

View File

@ -88,7 +88,7 @@ bool Menu::draw(bool updateStates) {
clickedMenuName = opt.name;
}
if (menuClicked && ImGui::IsMouseDragging(ImGuiMouseButton_Left) && draggedMenuName.empty() && clickedMenuName == opt.name) {
if (menuClicked && ImGui::IsMouseDragging(ImGuiMouseButton_Left) && draggedMenuName.empty() && clickedMenuName == opt.name && !locked) {
draggedMenuName = opt.name;
draggedId = rawId - 1;
draggedOpt = opt;

View File

@ -27,9 +27,12 @@ public:
std::vector<MenuOption_t> order;
bool locked = false;
private:
bool isInOrderList(std::string name);
bool menuClicked = false;
std::string clickedMenuName = "";
std::string draggedMenuName = "";