fix TP buttons

This commit is contained in:
HarrySilan 2022-06-19 21:13:45 +08:00
parent 75119a8ddb
commit e1a3d837a9

View File

@ -200,8 +200,7 @@ namespace cheat::feature
bool checked = std::any_of(checkedIndices.begin(), checkedIndices.end(), [&index](const auto& i) { return i == index; }); bool checked = std::any_of(checkedIndices.begin(), checkedIndices.end(), [&index](const auto& i) { return i == index; });
bool selected = index == selectedIndex; bool selected = index == selectedIndex;
const char* hashId = ("##Index" + std::to_string(index)).c_str(); ImGui::Checkbox(("##Index" + std::to_string(index)).c_str(), &checked);
ImGui::Checkbox(hashId, &checked);
if (ImGui::IsItemClicked(0)) { if (ImGui::IsItemClicked(0)) {
if (checked) { if (checked) {
if (selected) selectedIndex = -1; if (selected) selectedIndex = -1;
@ -213,7 +212,7 @@ namespace cheat::feature
} }
} }
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("TP")) if (ImGui::Button(("TP##Button" + std::to_string(index)).c_str()))
{ {
auto& mapTeleport = MapTeleport::GetInstance(); auto& mapTeleport = MapTeleport::GetInstance();
mapTeleport.TeleportTo(position); mapTeleport.TeleportTo(position);