mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 22:30:42 -07:00
overlay: card override input should be disabled when overridden with cmd line (#599)
This commit is contained in:
@@ -3804,6 +3804,7 @@ namespace overlay::windows {
|
|||||||
this->keypads_card_override_valid[player] ? ImVec4(1.f, 1.f, 1.f, 1.f) :
|
this->keypads_card_override_valid[player] ? ImVec4(1.f, 1.f, 1.f, 1.f) :
|
||||||
ImVec4(1.f, 0.f, 0.f, 1.f));
|
ImVec4(1.f, 0.f, 0.f, 1.f));
|
||||||
ImGui::SetNextItemWidth(TEXT_INPUT_WIDTH);
|
ImGui::SetNextItemWidth(TEXT_INPUT_WIDTH);
|
||||||
|
ImGui::BeginDisabled(option.disabled);
|
||||||
ImGui::InputTextWithHint("##OverrideCard", "E004010000000000",
|
ImGui::InputTextWithHint("##OverrideCard", "E004010000000000",
|
||||||
buffer, sizeof(buffer) - 1,
|
buffer, sizeof(buffer) - 1,
|
||||||
ImGuiInputTextFlags_CharsUppercase |
|
ImGuiInputTextFlags_CharsUppercase |
|
||||||
@@ -3824,19 +3825,30 @@ namespace overlay::windows {
|
|||||||
this->keypads_card_override_valid[player] = false;
|
this->keypads_card_override_valid[player] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// generate button
|
ImGui::EndDisabled();
|
||||||
ImGui::SameLine();
|
|
||||||
if (ImGui::Button("Generate")) {
|
|
||||||
generate_ea_card(buffer);
|
|
||||||
card_changed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (option.is_active()) {
|
if (!option.disabled) {
|
||||||
|
// generate button
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Button("Clear")) {
|
if (ImGui::Button("Generate")) {
|
||||||
buffer[0] = '\0';
|
generate_ea_card(buffer);
|
||||||
card_changed = true;
|
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
|
// bad card number warning
|
||||||
@@ -4723,7 +4735,7 @@ namespace overlay::windows {
|
|||||||
if (option.disabled && !definition.disabled) {
|
if (option.disabled && !definition.disabled) {
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::HelpMarker(
|
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.");
|
"Run spicecfg.exe to configure the options and then run spice(64).exe directly.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user