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) :
|
||||
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,6 +3825,9 @@ namespace overlay::windows {
|
||||
this->keypads_card_override_valid[player] = false;
|
||||
}
|
||||
|
||||
ImGui::EndDisabled();
|
||||
|
||||
if (!option.disabled) {
|
||||
// generate button
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Generate")) {
|
||||
@@ -3831,6 +3835,7 @@ namespace overlay::windows {
|
||||
card_changed = true;
|
||||
}
|
||||
|
||||
// clear button
|
||||
if (option.is_active()) {
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Clear")) {
|
||||
@@ -3838,6 +3843,13 @@ namespace overlay::windows {
|
||||
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
|
||||
if (!this->keypads_card_override_valid[player] && buffer_len > 0) {
|
||||
|
||||
Reference in New Issue
Block a user