feat: Allow increment/decrement for Saved Variables (#486)

This commit is contained in:
PlayDay
2025-06-18 22:06:30 +02:00
committed by GitHub
parent b5bb0bf0c4
commit 6f9b292bc7
@@ -116,8 +116,8 @@ namespace YimMenu
void DrawSavedVariable(SavedVariableBase& var)
{
ImGui::SetNextItemWidth(175.0f);
ImGui::InputScalar("Index", ImGuiDataType_U32, &var.base);
ImGui::SetNextItemWidth(200.0f);
ImGui::InputScalar("Index", ImGuiDataType_U32, &var.base, (void*)1);
ImGui::SameLine();
ImGui::SetNextItemWidth(100.0f);
ImGui::Combo("##var_type", (int*)&var.type, "Int\0Int64\0Bitset\0Bool\0Float\0Vector\0String\0");
@@ -128,15 +128,15 @@ namespace YimMenu
switch (item.type)
{
case VariableAppendage::Type::OFFSET:
ImGui::SetNextItemWidth(100.f);
ImGui::InputScalar(std::format("At##{}{}", i, (int)item.type).c_str(), ImGuiDataType_S32, &item.offset);
ImGui::SetNextItemWidth(125.f);
ImGui::InputScalar(std::format("At##{}{}", i, (int)item.type).c_str(), ImGuiDataType_S32, &item.offset, (void*)1);
ImGui::SameLine();
ImGui::SetNextItemWidth(100.f);
ImGui::InputScalar(std::format("Size##{}{}", i, (int)item.type).c_str(), ImGuiDataType_S32, &item.size);
ImGui::SetNextItemWidth(125.f);
ImGui::InputScalar(std::format("Size##{}{}", i, (int)item.type).c_str(), ImGuiDataType_S32, &item.size, (void*)1);
break;
case VariableAppendage::Type::PLAYER_ID:
ImGui::SetNextItemWidth(100.f);
ImGui::InputScalar(std::format("Size##{}{}", i, (int)item.type).c_str(), ImGuiDataType_S32, &item.size);
ImGui::SetNextItemWidth(125.f);
ImGui::InputScalar(std::format("Size##{}{}", i, (int)item.type).c_str(), ImGuiDataType_S32, &item.size, (void*)1);
break;
}
}
@@ -163,4 +163,4 @@ namespace YimMenu
var.appendages.clear();
}
}
}
}