mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-02-23 22:32:50 -05:00
start on tree view
This commit is contained in:
parent
3816ed11a4
commit
dbb4e3eefc
@ -3747,37 +3747,35 @@ void DrawRandoEditor(bool& open) {
|
|||||||
window->DC.CurrLineTextBaseOffset = 0.0f;
|
window->DC.CurrLineTextBaseOffset = 0.0f;
|
||||||
|
|
||||||
ImGui::BeginChild("ChildRandomizedLocations");
|
ImGui::BeginChild("ChildRandomizedLocations");
|
||||||
for (auto it : SpoilerfileCheckNameToEnum) {
|
for (auto areaIt : RandomizerCheckObjects::GetAllRCAreas()) {
|
||||||
if (!excludedLocations.count(it.second) && locationSearch.PassFilter(it.first.c_str())) {
|
// todo fix this, it's hacky and we shouldn't need to iterate through so many times
|
||||||
if (ImGui::ArrowButton(std::to_string(it.second).c_str(), ImGuiDir_Right)) {
|
bool hasItems = false;
|
||||||
excludedLocations.insert(it.second);
|
for (auto locationIt : RandomizerCheckObjects::GetAllRCObjects()) {
|
||||||
|
if (!excludedLocations.count(locationIt.second.rc) &&
|
||||||
|
locationIt.second.rcArea == areaIt.first &&
|
||||||
|
locationSearch.PassFilter(locationIt.second.rcSpoilerName.c_str())) {
|
||||||
|
hasItems = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
|
||||||
ImGui::Text("%s", it.first.c_str());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Checkbox UI
|
if (hasItems) {
|
||||||
|
ImGui::SetNextItemOpen(true, ImGuiCond_Once);
|
||||||
if (locationSearch.PassFilter(it.first.c_str())) {
|
if (ImGui::TreeNode(areaIt.second.c_str())) {
|
||||||
// we need the part from ## on to make each button unique in imgui
|
for (auto locationIt : RandomizerCheckObjects::GetAllRCObjects()) {
|
||||||
std::string buttonKey = "->##" + std::to_string(it.second);
|
if (!excludedLocations.count(locationIt.second.rc) &&
|
||||||
// if (ImGui::SmallButton(buttonKey.c_str())) {
|
locationIt.second.rcArea == areaIt.first &&
|
||||||
// excludedLocations.insert(it.second);
|
locationSearch.PassFilter(locationIt.second.rcSpoilerName.c_str())) {
|
||||||
// }
|
if (ImGui::ArrowButton(std::to_string(locationIt.first).c_str(), ImGuiDir_Right)) {
|
||||||
auto elfound = excludedLocations.find(it.second);
|
excludedLocations.insert(locationIt.first);
|
||||||
bool varTheImguiCheckboxNeeds = elfound == excludedLocations.end();
|
}
|
||||||
if (ImGui::Checkbox(it.first.c_str(), &varTheImguiCheckboxNeeds)) {
|
ImGui::SameLine();
|
||||||
if (elfound != excludedLocations.end()) {
|
ImGui::Text(locationIt.second.rcShortName.c_str());
|
||||||
excludedLocations.erase(elfound);
|
}
|
||||||
} else {
|
|
||||||
excludedLocations.insert(it.second);
|
|
||||||
}
|
}
|
||||||
|
ImGui::TreePop();
|
||||||
}
|
}
|
||||||
// ImGui::SameLine();
|
|
||||||
// ImGui::Text("%s", it.first.c_str());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
ImGui::EndChild();
|
ImGui::EndChild();
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "randomizerTypes.h"
|
#include "randomizerTypes.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <map>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
// Check types based on main settings
|
// Check types based on main settings
|
||||||
@ -72,6 +73,7 @@ typedef struct {
|
|||||||
} RandomizerCheckObject;
|
} RandomizerCheckObject;
|
||||||
|
|
||||||
namespace RandomizerCheckObjects {
|
namespace RandomizerCheckObjects {
|
||||||
|
std::map<RandomizerCheckArea, std::string> GetAllRCAreas();
|
||||||
std::unordered_map<RandomizerCheck, RandomizerCheckObject> GetAllRCObjects();
|
std::unordered_map<RandomizerCheck, RandomizerCheckObject> GetAllRCObjects();
|
||||||
RandomizerCheckObject GetRCObject(RandomizerCheck check);
|
RandomizerCheckObject GetRCObject(RandomizerCheck check);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user