2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-05-28 17:17:29 +00:00
|
|
|
/*
|
|
|
|
* Authors: Ruthberg
|
|
|
|
* Opens the range card dialog
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* Open copy? <BOOLEAN>
|
|
|
|
*
|
|
|
|
* Return Value:
|
2017-06-08 13:31:51 +00:00
|
|
|
* None
|
2015-05-28 17:17:29 +00:00
|
|
|
*
|
|
|
|
* Example:
|
2017-06-08 13:31:51 +00:00
|
|
|
* [true] call ace_rangecard_fnc_openRangeCard
|
2015-05-28 17:17:29 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (GVAR(RangeCardOpened)) exitWith {};
|
|
|
|
|
|
|
|
if (_this) then {
|
2015-05-29 13:07:30 +00:00
|
|
|
if (GVAR(ammoClassCopy) != "" && GVAR(magazineClassCopy) != "" && GVAR(weaponClassCopy) != "") then {
|
2015-05-28 17:17:29 +00:00
|
|
|
GVAR(RangeCardOpened) = true;
|
2016-05-03 00:32:44 +00:00
|
|
|
|
2015-05-28 17:17:29 +00:00
|
|
|
createDialog "ACE_RangeCard_Dialog";
|
2016-05-03 00:32:44 +00:00
|
|
|
|
2016-12-01 20:20:51 +00:00
|
|
|
[GVAR(zeroRangeCopy), GVAR(boreHeightCopy), GVAR(ammoClassCopy), GVAR(magazineClassCopy), GVAR(weaponClassCopy)] call FUNC(updateRangeCard);
|
2015-05-28 17:17:29 +00:00
|
|
|
};
|
|
|
|
} else {
|
|
|
|
if (ACE_player call FUNC(updateClassNames)) then {
|
|
|
|
GVAR(RangeCardOpened) = true;
|
2016-05-03 00:32:44 +00:00
|
|
|
|
2015-05-28 17:17:29 +00:00
|
|
|
createDialog "ACE_RangeCard_Dialog";
|
2016-05-03 00:32:44 +00:00
|
|
|
|
2016-12-01 20:20:51 +00:00
|
|
|
[GVAR(zeroRange), GVAR(boreHeight), GVAR(ammoClass), GVAR(magazineClass), GVAR(weaponClass)] call FUNC(updateRangeCard);
|
2015-05-28 17:17:29 +00:00
|
|
|
};
|
|
|
|
};
|