ACE3/addons/pylons/functions/fnc_onButtonApply.sqf
Serg Vergun af86109c2b
General - Utilize isNotEqualTo command (#8732)
* Utilize isNotEqualTo command

* fix pr validation
2021-12-18 17:15:32 -06:00

47 lines
1.3 KiB
Plaintext

#include "script_component.hpp"
/*
* Author: 654wak654
* Starts the pylon configuration.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* [] call ace_pylons_fnc_onButtonApply
*
* Public: No
*/
// Check for FRIES change
private _checkbox = CONTROL(ID_DIALOG) ID_CHECKBOX_FRIES;
if (ctrlShown _checkbox && {(cbChecked _checkbox) isNotEqualTo (_checkbox getVariable QGVAR(originalState))}) then {
if (cbChecked _checkbox) then {
[GVAR(currentAircraft)] call EFUNC(fastroping,equipFRIES);
} else {
[GVAR(currentAircraft)] call EFUNC(fastroping,cutRopes);
private _fries = GVAR(currentAircraft) getVariable [QEGVAR(fastroping,FRIES), objNull];
deleteVehicle _fries;
};
_checkbox setVariable [QGVAR(originalState), cbChecked _checkbox];
};
private _pylonsToConfigure = [];
{
// Pick combo boxes where current selection doesn't match original selection
if ((lbCurSel (_x select 0)) != (_x select 3)) then {
_pylonsToConfigure pushBack _forEachIndex;
};
} forEach GVAR(comboBoxes);
if (_pylonsToConfigure isEqualTo []) exitWith {};
[_pylonsToConfigure, 0] call FUNC(configurePylons);
// As a zeus you expect module dialogs to close once you click apply
if (GVAR(isCurator)) then {
call FUNC(onButtonClose);
};