overlay: card override input should be disabled when overridden with cmd line (#599)

This commit is contained in:
bicarus
2026-03-29 20:36:42 -07:00
committed by GitHub
parent d66af8e16b
commit b06a0a7d47
+22 -10
View File
@@ -3804,6 +3804,7 @@ namespace overlay::windows {
this->keypads_card_override_valid[player] ? ImVec4(1.f, 1.f, 1.f, 1.f) :
ImVec4(1.f, 0.f, 0.f, 1.f));
ImGui::SetNextItemWidth(TEXT_INPUT_WIDTH);
ImGui::BeginDisabled(option.disabled);
ImGui::InputTextWithHint("##OverrideCard", "E004010000000000",
buffer, sizeof(buffer) - 1,
ImGuiInputTextFlags_CharsUppercase |
@@ -3824,19 +3825,30 @@ namespace overlay::windows {
this->keypads_card_override_valid[player] = false;
}
// generate button
ImGui::SameLine();
if (ImGui::Button("Generate")) {
generate_ea_card(buffer);
card_changed = true;
}
ImGui::EndDisabled();
if (option.is_active()) {
if (!option.disabled) {
// generate button
ImGui::SameLine();
if (ImGui::Button("Clear")) {
buffer[0] = '\0';
if (ImGui::Button("Generate")) {
generate_ea_card(buffer);
card_changed = true;
}
// clear button
if (option.is_active()) {
ImGui::SameLine();
if (ImGui::Button("Clear")) {
buffer[0] = '\0';
card_changed = true;
}
}
} else {
if (ImGui::IsItemHovered(ImGui::TOOLTIP_FLAGS)) {
ImGui::HelpTooltip(
"This option cannot be edited because it was overriden by command-line options.\n"
"Run spicecfg.exe to configure the options and then run spice(64).exe directly.");
}
}
// bad card number warning
@@ -4723,7 +4735,7 @@ namespace overlay::windows {
if (option.disabled && !definition.disabled) {
ImGui::SameLine();
ImGui::HelpMarker(
"This option can not be edited because it was overriden by command-line options.\n"
"This option cannot be edited because it was overriden by command-line options.\n"
"Run spicecfg.exe to configure the options and then run spice(64).exe directly.");
}