1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Fix checkbox warning message

This commit is contained in:
George King
2025-08-06 15:37:39 +02:00
committed by GitHub
parent a15d62ed57
commit fba35f5614

View File

@@ -433,22 +433,19 @@ end;
procedure OnTaskCheck(Sender: TObject); procedure OnTaskCheck(Sender: TObject);
var var
i: Integer; idx: Integer;
begin begin
// Loop through all tasks in the tasks list // Get the index of the currently clicked task
for i := 0 to WizardForm.TasksList.Items.Count - 1 do idx := WizardForm.TasksList.ItemIndex;
// Check if the clicked task is the "AddFirewallRules" one
if WizardForm.TasksList.Items[idx] = ExpandConstant('{cm:AddFirewallRules}') then
begin begin
// Check if the current task is "firewallrules" // If it was just unchecked, show the warning
if WizardForm.TasksList.Items[i] = ExpandConstant('{cm:AddFirewallRules}') then if not WizardForm.TasksList.Checked[idx] then
begin begin
// Check if the "firewallrules" task is unchecked
if not WizardForm.TasksList.Checked[i] then
begin
// Show a custom warning message box
MsgBox(ExpandConstant('{cm:Warning}') + '!' + #13#10 + #13#10 + ExpandConstant('{cm:InstallForMeOnly1}') + #13#10 + ExpandConstant('{cm:InstallForMeOnly2}'), mbError, MB_OK); MsgBox(ExpandConstant('{cm:Warning}') + '!' + #13#10 + #13#10 + ExpandConstant('{cm:InstallForMeOnly1}') + #13#10 + ExpandConstant('{cm:InstallForMeOnly2}'), mbError, MB_OK);
end; end;
Exit; // Task found, exit the loop
end;
end; end;
end; end;
@@ -971,3 +968,4 @@ end;