2015-10-02 14:27:56 +00:00
|
|
|
private ["_dt","_object","_objType","_dialog","_handled","_config","_upgrade","_remove"];
|
2015-09-14 20:55:36 +00:00
|
|
|
|
2015-10-02 14:27:56 +00:00
|
|
|
if !(isNil "EPOCH_simulSwap_Lock") exitWith{ false };
|
2015-09-14 20:55:36 +00:00
|
|
|
if !(isNull EPOCH_Target) exitWith{ false };
|
|
|
|
if (EPOCH_playerEnergy <= 0) exitWith{ _dt = ["<t size='0.8' shadow='0' color='#99ffffff'>Need energy</t>", 0, 1, 5, 2, 0, 1] spawn bis_fnc_dynamictext; false };
|
|
|
|
|
|
|
|
_object = _this;
|
|
|
|
|
|
|
|
if (isNull _object) exitWith{ false };
|
|
|
|
if ((player distance _object) > 9) exitWith { false };
|
|
|
|
|
|
|
|
_objType = typeOf _object;
|
|
|
|
|
|
|
|
_dialog = "InteractBaseBuilding";
|
|
|
|
_handled = createdialog _dialog;
|
|
|
|
|
|
|
|
_config = 'CfgBaseBuilding' call EPOCH_returnConfig;
|
|
|
|
|
|
|
|
_upgrade = getArray(_config >> _objType >> "upgradeBuilding");
|
|
|
|
if (_upgrade isEqualTo[]) then{
|
|
|
|
ctrlEnable[2400, false];
|
|
|
|
};
|
|
|
|
_remove = getArray(_config >> _objType >> "removeParts");
|
|
|
|
if (_remove isEqualTo[]) then{
|
|
|
|
ctrlEnable[2401, false];
|
|
|
|
};
|
2015-10-02 14:27:56 +00:00
|
|
|
// disable Move option if not SIM
|
|
|
|
if !(_object isKindOf "ThingX") then{
|
2015-09-14 20:55:36 +00:00
|
|
|
ctrlEnable[2402, false];
|
|
|
|
};
|
|
|
|
|
|
|
|
true
|