remove deprecated functions

This commit is contained in:
commy2 2016-07-30 11:07:31 +02:00
parent c117a79431
commit 1ffe3131e3
16 changed files with 31 additions and 634 deletions

View File

@ -26,11 +26,6 @@ class Extended_DisplayLoad_EventHandlers {
};
class Extended_InitPost_EventHandlers {
class All {
class GVAR(executePersistent) {
init = QUOTE([_this select 0] call FUNC(executePersistent));
};
};
class CAManBase {
class GVAR(setName) {
init = QUOTE(if (local (_this select 0)) then {[ARR_2(FUNC(setName),_this)] call CBA_fnc_execNextFrame};);

View File

@ -39,10 +39,6 @@ PREP(endRadioTransmission);
PREP(eraseCache);
PREP(errorMessage);
PREP(execNextFrame);
PREP(execPersistentFnc);
PREP(execRemoteFnc);
PREP(executePersistent);
PREP(filter);
PREP(findUnloadPosition);
PREP(firedEH);
PREP(fixCollision);
@ -50,16 +46,13 @@ PREP(fixFloating);
PREP(fixLoweredRifleAnimation);
PREP(fixPosition);
PREP(getAllDefinedSetVariables);
PREP(getAllGear);
PREP(getDeathAnim);
PREP(getCaptivityStatus);
PREP(getDefaultAnim);
PREP(getDefinedVariable);
PREP(getDefinedVariableDefault);
PREP(getDefinedVariableInfo);
PREP(getFirstObjectIntersection);
PREP(getFirstTerrainIntersection);
PREP(getForceWalkStatus);
PREP(getGunner);
PREP(getInPosition);
PREP(getMapData);
@ -117,7 +110,6 @@ PREP(loadPersonLocal);
PREP(loadSettingsFromProfile);
PREP(loadSettingsOnServer);
PREP(loadSettingsLocalizedText);
PREP(map);
PREP(moduleCheckPBOs);
PREP(moduleLSDVehicles);
PREP(muteUnit);
@ -146,12 +138,9 @@ PREP(runAfterSettingsInit);
PREP(sanitizeString);
PREP(sendRequest);
PREP(serverLog);
PREP(setAllGear);
PREP(setApproximateVariablePublic);
PREP(setCaptivityStatus);
PREP(setDefinedVariable);
PREP(setDisableUserInputStatus);
PREP(setForceWalkStatus);
PREP(setHearingCapability);
PREP(setName);
PREP(setParameter);
@ -215,7 +204,6 @@ PREP(getVehicleCrew);
PREP(getVehicleUAVCrew);
// turrets
PREP(getTurrets);
PREP(getTurretIndex);
PREP(getTurretConfigPath);
PREP(getTurretGunner);

View File

@ -160,14 +160,6 @@ if (isServer) then {
[FUNC(syncedEventPFH), 0.5, []] call CBA_fnc_addPerFrameHandler;
};
// @todo deprecated
QGVAR(remoteFnc) addPublicVariableEventHandler {
(_this select 1) call FUNC(execRemoteFnc);
};
// @todo figure out what this does.
[missionNamespace] call FUNC(executePersistent);
//////////////////////////////////////////////////
// Check files, previous installed version etc.
@ -326,7 +318,37 @@ enableCamShake true;
// "playerInventoryChanged" event
["loadout", {
["ace_playerInventoryChanged", [ACE_player, [ACE_player, false] call FUNC(getAllGear)]] call CBA_fnc_localEvent;
private _fnc_getAllGear = {
if (isNull _this) exitWith {[
"",
"",
"", [],
"", [],
"", [],
"", ["","","",""], [],
"", ["","","",""], [],
"", ["","","",""], [],
[],
"",
""
]};
[
headgear _this,
goggles _this,
uniform _this, uniformItems _this,
vest _this, vestItems _this,
backpack _this, backpackItems _this,
primaryWeapon _this, primaryWeaponItems _this, primaryWeaponMagazine _this,
secondaryWeapon _this, secondaryWeaponItems _this, secondaryWeaponMagazine _this,
handgunWeapon _this, handgunItems _this, handgunMagazine _this,
assignedItems _this,
binocular _this,
_this call CBA_fnc_binocularMagazine
]
};
["ace_playerInventoryChanged", [ACE_player, ACE_player call _fnc_getAllGear]] call CBA_fnc_localEvent;
}] call CBA_fnc_addPlayerEventHandler;
// "playerVisionModeChanged" event

View File

@ -5,17 +5,6 @@ ADDON = false;
#include "XEH_PREP.hpp"
// backwards comp
DFUNC(canUseWeapon) = {
ACE_DEPRECATED("ace_common_fnc_canUseWeapon","3.7.0","CBA_fnc_canUseWeapon");
_this call CBA_fnc_canUseWeapon;
};
DFUNC(selectWeaponMode) = {
ACE_DEPRECATED("ace_common_fnc_selectWeaponMode","3.7.0","CBA_fnc_selectWeapon");
_this call CBA_fnc_selectWeapon;
};
GVAR(syncedEvents) = HASH_CREATE;
GVAR(showHudHash) = [] call FUNC(hashCreate);

View File

@ -1,53 +0,0 @@
/*
* Author: commy2
* Execute a function on every machine. Function will also be called upon JIP (postInit). The arguments are stored in (_this select 0), while the assigned namespace is stored in (_this select 1).
*
* Arguments:
* 0: Function arguments <ARRAY>
* 1: Function to execute, has to be defined on the remote machine first <STRING>
* 2: Namespace to save that variable in <OBJECT, NAMESPACE>
* 3: Name. Will overwrite previously defined functions with that name <STRING>
*
* Return Value:
* None
*
* Public: No
*
* Deprecated
*/
#include "script_component.hpp"
ACE_DEPRECATED("ace_common_fnc_execPersistentFnc","3.7.0","ace_common_fnc_globalEvent");
GVAR(remoteFnc) = _this;
params ["_arguments", "_function", "_unit", "_name"];
TRACE_4("params", _arguments, _function, _unit, _name);
_function = call compile _function;
// execute function on every currently connected machine
[[_arguments, _unit], _this select 1, 2] call FUNC(execRemoteFnc);
// save persistent function for JIP
private _persistentFunctions = _unit getVariable ["ACE_PersistentFunctions", []];
// find index to overwrite function with the same name, add to end otherwise
private _index = count _persistentFunctions;
{
if (_x select 2 == _name) exitWith {
_index = _forEachIndex;
};
} forEach _persistentFunctions;
// set new value
_persistentFunctions set [_index, [_arguments, _function, _name]];
// broadcast variable
if (typeName _unit == "NAMESPACE") then {
ACE_PersistentFunctions = _persistentFunctions;
publicVariable "ACE_PersistentFunctions";
} else {
_unit setVariable ["ACE_PersistentFunctions", _persistentFunctions, true];
};

View File

@ -1,68 +0,0 @@
/*
* Author: commy2
* Execute a function on a remote machine in mp.
*
* Arguments:
* 0: Function arguments <ARRAY>
* 1: Function to execute, has to be defined on the remote machine first <STRING>
* 2: The function will be executed where this unit is local OR the mode were this function should be executed. (default: 2) <OBJECT, NUMBER>
* 0 = execute on this machine only
* 1 = execute on server
* 2 = execute on all clients + server
* 3 = execute on dedicated only
*
* Return Value:
* None
*
* Public: No
*
* Deprecated
*/
#include "script_component.hpp"
ACE_DEPRECATED("ace_common_fnc_execRemoteFnc","3.7.0","ace_common_fnc_globalEvent");
GVAR(remoteFnc) = _this;
params ["_arguments", "_function", ["_unit", 2]];
TRACE_3("params", _arguments, _function, _unit);
_function = call compile _function;
if (_unit isEqualType 0) exitWith {
switch (_unit) do {
case 0 : {
_arguments call _function;
};
case 1 : {
if (isServer) then {
_arguments call _function;
} else {
publicVariableServer QGVAR(remoteFnc);
};
};
case 2 : {
_arguments call _function;
GVAR(remoteFnc) set [2, 0];
publicVariable QGVAR(remoteFnc);
};
case 3 : {
if (isDedicated) then {
_arguments call _function;
} else {
if (!isServer) then {publicVariableServer QGVAR(remoteFnc)};
};
};
};
};
if (local _unit) then {
_arguments call _function;
} else {
if (isServer) then {
(owner _unit) publicVariableClient QGVAR(remoteFnc);
} else {
publicVariableServer QGVAR(remoteFnc);
};
};

View File

@ -1,25 +0,0 @@
/*
* Author: commy2
* Execute all Persistent Functions
*
* Arguments:
* ?
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
params ["_target"];
{
if (isNil "_x") then {
ACE_LOGERROR_1("No arguments and function for remote function. ID: %1",_forEachIndex);
} else {
if (_x isEqualType []) then {
[_x select 0, _target] call (_x select 1);
};
};
} forEach (_target getVariable ["ACE_PersistentFunctions", []]);

View File

@ -1,31 +0,0 @@
/*
* Author: KoffeinFlummi, commy2
* Filters array and removes every element not fitting the condition
*
* Arguments:
* 0: Array to be filtered.
* 1: Code to be evaluated.
*
* Return Value:
* Final array
*
* Public: Yes
*
* Deprecated
*/
#include "script_component.hpp"
params [["_array", [], [[]]], ["_code", {}, [{}]]];
ACE_DEPRECATED("ace_common_fnc_filter","3.7.0","select CODE");
private _result = [];
{
if (_x call _code) then {
_result pushBack _x;
};
false
} count _array;
_result

View File

@ -1,68 +0,0 @@
/*
* Author: bux578, commy2
* Returns an array containing all items of a given unit
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* 0: Headgear <STRING>
* 1: Goggles <STRING>
* 2: Uniform <STRING>
* 3: Uniform Items <ARRAY>
* 4: Vest <String>
* 5: Vest Items <ARRAY>
* 6: Backback <STRING>
* 7: Backpack Items <ARRAY>
* 8: Rifle <STRING>
* 9: Rifle Items <ARRAY>
* 10: Rifle Magazines <ARRAY>
* 11: Launcher <STRING>
* 12: Launcher Items <ARRAY>
* 13: Launcher Magazines <ARRAY>
* 14: Handgun <STRING>
* 15: Handgun Items <ARRAY>
* 16: Handgun Magazines <ARRAY>
* 17: Assigned Items (map, compass, watch, etc.) <ARRAY>
* 18: Binoculars <STRING>
* 19: Binocular Magazine (E.g. Laserbatteries) <STRING>
*
* Public: Yes
*
* Note: Element 17 includes the Head Mounted Display (HMD)
*/
#include "script_component.hpp"
params ["_unit", ["_showDeprecated", true]];
if (_showDeprecated) then {
ACE_DEPRECATED("ace_common_fnc_getAllGear","3.7.0","getUnitLoadout");
};
if (isNull _unit) exitWith {[
"",
"",
"", [],
"", [],
"", [],
"", ["","","",""], [],
"", ["","","",""], [],
"", ["","","",""], [],
[],
"",
""
]};
[
headgear _unit,
goggles _unit,
uniform _unit, uniformItems _unit,
vest _unit, vestItems _unit,
backpack _unit, backpackItems _unit,
primaryWeapon _unit, primaryWeaponItems _unit, primaryWeaponMagazine _unit,
secondaryWeapon _unit, secondaryWeaponItems _unit, secondaryWeaponMagazine _unit,
handgunWeapon _unit, handgunItems _unit, handgunMagazine _unit,
assignedItems _unit,
binocular _unit,
[_unit] call CBA_fnc_binocularMagazine
]

View File

@ -1,20 +0,0 @@
/*
* Author: commy2
* Return the captivity status of an unit.
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* Captivity Reasons, empty if not captive <ARRAY>
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit"];
//Now just a wrapper for FUNC(statusEffect_get) [No longer used in ace as of 3.5]
ACE_DEPRECATED("ace_common_fnc_getCaptivityStatus","3.7.0","ace_common_fnc_statusEffect_get");
([_unit, "setCaptive"] call FUNC(statusEffect_get)) select 1

View File

@ -1,23 +0,0 @@
/*
* Author: PabstMirror, commy2
* Returns reasons why the unit is forceWalk-ing.
*
* Arguments:
* 0: unit <OBJECT>
*
* Return Value:
* Force Walk reasons <ARRAY>
*
* Example:
* [ACE_Player] call ace_common_fnc_getForceWalkStatus
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit"];
//Now just a wrapper for FUNC(statusEffect_get) [No longer used in ace as of 3.5]
ACE_DEPRECATED("ace_common_fnc_getForceWalkStatus","3.7.0","ace_common_fnc_statusEffect_get");
([_unit, "forceWalk"] call FUNC(statusEffect_get)) select 1

View File

@ -1,54 +0,0 @@
/*
* Author: commy2
* Get all turret indicies of a vehicle type.
*
* Arguments:
* 0: Vehicle type <STRING>
*
* Return Value:
* Turret Indecies <ARRAY>
*
* Public: No
*
* Note: It's advised to use allTurrets [_vehicle, true] instead whenever possible
*/
#include "script_component.hpp"
ACE_DEPRECATED("ace_common_fnc_getTurrets","3.7.0","allTurrets [_vehicle, true]");
params ["_type"];
private _varName = format [QGVAR(CachedTurrets_%1), _type];
private _turrets = + (uiNamespace getVariable _varName);
if (!isNil "_turrets") exitWith {_turrets};
private _config = configFile >> "CfgVehicles" >> _type;
_turrets = [];
private _fnc_addTurret = {
params ["_config", "_path"];
_config = _config >> "Turrets";
private _offset = 0;
for "_index" from 0 to (count _config - 1) do {
private _path2 = _path + [_index - _offset];
private _config2 = _config select _index;
if (isClass _config2) then {
_turrets pushBack _path2;
[_config2, _path2] call _fnc_addTurret;
} else {
_offset = _offset + 1;
};
};
};
[_config, []] call _fnc_addTurret;
uiNamespace setVariable [_varName, _turrets];
_turrets

View File

@ -1,29 +0,0 @@
/*
* Author: KoffeinFlummi, commy2
* Applies given code to every element in an array, LIKE SOMETHING SQF SHOULD HAVE BY DEFAULT. <- :kappa:
*
* Arguments:
* 0: Array to be thingied.
* 1: Code to be applied to every element.
*
* Return Value:
* Final array
*
* Public: Yes
*
* Deprecated
*/
#include "script_component.hpp"
params [["_array", [], [[]]], ["_code", {}, [{}]]];
ACE_DEPRECATED("ace_common_fnc_map","3.7.0","apply");
// copy array to not alter the original one
_array = + _array;
{
_array set [_forEachIndex, _x call _code];
} forEach _array;
_array

View File

@ -1,178 +0,0 @@
/*
* Author: bux578, commy2
* Applies gear to unit. It must be called in the machine in which the unit is local.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: All Gear based on return value of ACE_common_fnc_getAllGear <ARRAY>
* 2: Remove all attachments from weapons? (default: false) <BOOL>
* 3: Remove all items from prefilled backpacks? (default: false) <BOOL>
*
* Return Value:
* None
*
* Example:
* [player, gear_array, true, true] call ace_common_fnc_setAllGear
*
* Public: Yes
*/
#include "script_component.hpp"
ACE_DEPRECATED("ace_common_fnc_setAllGear","3.7.0","setUnitLoadout");
params ["_unit", "_allGear", ["_clearAttachments", false], ["_clearBackpack", false]];
if (!local _unit) exitWith {
ACE_LOGWARNING_1("setAllGear - %1 has to be local.",_unit);
};
// remove all starting gear of a player
removeAllWeapons _unit;
removeGoggles _unit;
removeHeadgear _unit;
removeVest _unit;
removeUniform _unit;
removeAllAssignedItems _unit;
removeBackpack _unit;
_allGear params [
"_headgear", "_goggles",
"_uniform", "_uniformitems",
"_vest", "_vestitems",
"_backpack", "_backpackitems",
"_primaryweapon", "_primaryweaponitems", "_primaryweaponmagazine",
"_secondaryweapon", "_secondaryweaponitems", "_secondaryweaponmagazine",
"_handgunweapon", "_handgunweaponitems", "_handgunweaponmagazine",
"_assigneditems",
"_binocular",
"_binocularmagazine"
];
// start restoring the items
if (_headgear != "") then {_unit addHeadgear _headgear};
if (_goggles != "") then {_unit addGoggles _goggles};
// ensure all weapons being loaded
_unit addBackpack "ACE_FakeBackpack";
// primaryWeapon
if (_primaryweapon != "") then {
{
_unit addMagazine _x;
false
} count _primaryweaponmagazine;
_unit addWeapon _primaryweapon;
if (_clearAttachments) then {
removeAllPrimaryWeaponItems _unit;
};
{
if (_x != "") then {
_unit addPrimaryWeaponItem _x;
};
false
} count _primaryweaponitems;
};
// secondaryWeapon
if (_secondaryweapon != "") then {
{
_unit addMagazine _x;
false
} count _secondaryweaponmagazine;
_unit addWeapon _secondaryweapon;
if (_clearAttachments) then {
//removeAllSecondaryWeaponItems _unit;
{
_unit removeSecondaryWeaponItem _x;
false
} count secondaryWeaponItems _unit;
};
{
if (_x != "") then {
_unit addSecondaryWeaponItem _x;
};
false
} count _secondaryweaponitems;
};
// handgun
if (_handgunweapon != "") then {
{
_unit addMagazine _x;
false
} count _handgunweaponmagazine;
_unit addWeapon _handgunweapon;
if (_clearAttachments) then {
removeAllHandgunItems _unit;
};
{
if (_x != "") then {
_unit addHandgunItem _x;
};
false
} count _handgunweaponitems;
};
// binocular
_unit addWeapon _binocular;
_unit addMagazine _binocularmagazine;
// done with dummy backpack. now remove
removeBackpack _unit;
// uniform
if (_uniform != "") then {
_unit forceAddUniform _uniform;
};
{
_unit addItemToUniform _x;
false
} count _uniformitems;
// vest
if (_vest != "") then {
_unit addVest _vest;
};
{
_unit addItemToVest _x;
false
} count _vestitems;
// backpack
if (_backpack != "") then {
_unit addBackpack _backpack;
if (_clearBackpack) then {
private _backpackObject = unitBackpack _unit;
clearMagazineCargoGlobal _backpackObject;
clearWeaponCargoGlobal _backpackObject;
clearItemCargoGlobal _backpackObject;
};
{
_unit addItemToBackpack _x;
false
} count _backpackitems;
};
// assigned items
_assignedItems deleteAt (_assignedItems find _binocular);
{
_unit linkItem _x;
false
} count _assignedItems;
nil

View File

@ -1,22 +0,0 @@
/*
* Author: commy2
* Set the captivity status of an unit. This allows the handling of more than one reason to set a unit captive.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: The reason of the captivity <STRING>
* 2: Is the reason still valid? True for setting this reason, false for removing it <BOOL>
*
* Return Value:
* None
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit", "_reason", "_status"];
//Now just a wrapper for FUNC(statusEffect_set) [No longer used in ace as of 3.5]
ACE_DEPRECATED("ace_common_fnc_setCaptivityStatus","3.7.0","ace_common_fnc_statusEffect_set");
[_unit, "setCaptive", _reason, _status] call FUNC(statusEffect_set);

View File

@ -1,26 +0,0 @@
/*
* Author: Pabst Mirror (from captivity by commy2)
* Sets the forceWalk status of an unit. This allows the handling of more than one reason to set forceWalk.
* Unit will force walk until all reasons are removed.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Reason for forcing walking <STRING>
* 2: Is the reason still valid. True to force walk, false to remove restriction. <BOOL>
*
* Returns:
* None
*
* Example:
* [ACE_Player, "BrokenLeg", true] call FUNC(setForceWalkStatus)
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit", "_reason", "_status"];
//Now just a wrapper for FUNC(statusEffect_set) [No longer used in ace as of 3.5]
ACE_DEPRECATED("ace_common_fnc_setForceWalkStatus","3.7.0","ace_common_fnc_statusEffect_set");
[_unit, "forceWalk", _reason, _status] call FUNC(statusEffect_set);