-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #469 from CBATeam/compile-final-all-missionnamespa…
…ce-functions compileFinal all missionNamespace functions
- Loading branch information
Showing
9 changed files
with
100 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,81 @@ | ||
|
||
CBA_fnc_createCenter = { | ||
["CBA_fnc_createCenter", { | ||
WARNING('Deprecated function used: CBA_fnc_createCenter'); | ||
params ["_side"]; | ||
_side | ||
}; | ||
}] call CBA_fnc_compileFinal; | ||
|
||
CBA_fnc_locked = { | ||
["CBA_fnc_locked", { | ||
WARNING('Deprecated function used: CBA_fnc_locked (new: locked)'); | ||
locked _this > 1 | ||
}; | ||
}] call CBA_fnc_compileFinal; | ||
|
||
CBA_fnc_getPistol = { | ||
["CBA_fnc_getPistol", { | ||
WARNING('Deprecated function used: CBA_fnc_getPistol (new: handgunWeapon)'); | ||
params [["_unit", objNull, [objNull]]]; | ||
handgunWeapon _unit | ||
}; | ||
}] call CBA_fnc_compileFinal; | ||
|
||
CBA_fnc_systemChat = { | ||
["CBA_fnc_systemChat", { | ||
WARNING('Deprecated function used: CBA_fnc_systemChat (new: systemChat)'); | ||
params [["_message", "", [""]]]; | ||
systemChat _message; | ||
}; | ||
}] call CBA_fnc_compileFinal; | ||
|
||
CBA_fnc_defaultParam = { | ||
["CBA_fnc_defaultParam", { | ||
WARNING('Deprecated function used: CBA_fnc_defaultParam (new: param)'); | ||
params [["_params", []], ["_index", -1, [0]], "_defaultValue"]; | ||
if (_index < 0) exitWith {_defaultValue}; | ||
_params param [_index, _defaultValue] | ||
}; | ||
}] call CBA_fnc_compileFinal; | ||
|
||
CBA_fnc_addWeaponCargoGlobal = { | ||
["CBA_fnc_addWeaponCargoGlobal", { | ||
WARNING('Deprecated function used: CBA_fnc_addWeaponCargoGlobal (new: CBA_fnc_addWeaponCargo)'); | ||
_this call CBA_fnc_addWeaponCargo; | ||
}; | ||
}] call CBA_fnc_compileFinal; | ||
|
||
CBA_fnc_addMagazineCargoGlobal = { | ||
["CBA_fnc_addMagazineCargoGlobal", { | ||
WARNING('Deprecated function used: CBA_fnc_addMagazineCargoGlobal (new: CBA_fnc_addMagazineCargo)'); | ||
_this call CBA_fnc_addMagazineCargo; | ||
}; | ||
}] call CBA_fnc_compileFinal; | ||
|
||
CBA_fnc_removeWeaponCargoGlobal = { | ||
["CBA_fnc_removeWeaponCargoGlobal", { | ||
WARNING('Deprecated function used: CBA_fnc_removeWeaponCargoGlobal (new: CBA_fnc_removeWeaponCargo)'); | ||
_this call CBA_fnc_removeWeaponCargo; | ||
}; | ||
}] call CBA_fnc_compileFinal; | ||
|
||
CBA_fnc_removeMagazineCargoGlobal = { | ||
["CBA_fnc_removeMagazineCargoGlobal", { | ||
WARNING('Deprecated function used: CBA_fnc_removeMagazineCargoGlobal (new: CBA_fnc_removeMagazineCargo)'); | ||
_this call CBA_fnc_removeMagazineCargo; | ||
}; | ||
}] call CBA_fnc_compileFinal; | ||
|
||
CBA_fnc_removeItemCargoGlobal = { | ||
["CBA_fnc_removeItemCargoGlobal", { | ||
WARNING('Deprecated function used: CBA_fnc_removeItemCargoGlobal (new: CBA_fnc_removeItemCargo)'); | ||
_this call CBA_fnc_removeItemCargo; | ||
}; | ||
}] call CBA_fnc_compileFinal; | ||
|
||
CBA_fnc_removeBackpackCargoGlobal = { | ||
["CBA_fnc_removeBackpackCargoGlobal", { | ||
WARNING('Deprecated function used: CBA_fnc_removeBackpackCargoGlobal (new: CBA_fnc_removeBackpackCargo)'); | ||
_this call CBA_fnc_removeBackpackCargo; | ||
}; | ||
}] call CBA_fnc_compileFinal; | ||
|
||
FUNC(directCall) = { | ||
[QFUNC(directCall), { | ||
WARNING('Deprecated function used: FUNC(directCall) (new: CBA_fnc_directCall)'); | ||
params ["_params", "_code"]; | ||
[_code, _params] call CBA_fnc_directCall; | ||
}; | ||
}] call CBA_fnc_compileFinal; | ||
|
||
CBA_fnc_intToString = { | ||
["CBA_fnc_intToString", { | ||
WARNING('Deprecated function used: CBA_fnc_intToString (new: str)'); | ||
params [["_int", nil, [0]]]; | ||
if (isNil "_int") exitWith {""}; | ||
str _int | ||
}; | ||
}] call CBA_fnc_compileFinal; | ||
|
||
CBA_fnc_inArea = { | ||
["CBA_fnc_inArea", { | ||
WARNING('Deprecated function used: CBA_fnc_inArea (new: inArea)'); | ||
params ["_position", ["_zRef", objNull, ["", objNull, locationNull, []], 5]]; | ||
|
||
_position = _position call CBA_fnc_getPos; | ||
_position inArea _zRef; | ||
}; | ||
}] call CBA_fnc_compileFinal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* ---------------------------------------------------------------------------- | ||
Function: CBA_fnc_compileFinal | ||
Description: | ||
Defines a function in mission namespace and prevents it from being overwritten. | ||
Parameters: | ||
_name - Function name <STRING> | ||
_function - A function <CODE> | ||
Returns: | ||
Nothing | ||
Examples: | ||
(begin example) | ||
["MyFunction", {systemChat str _this}] = true call CBA_fnc_compileFinal; | ||
(end) | ||
Author: | ||
commy2 | ||
---------------------------------------------------------------------------- */ | ||
#include "script_component.hpp" | ||
SCRIPT(compileFinal); | ||
|
||
params [["_name", "", [""]], ["_function", {}, [{}]]]; | ||
|
||
_function = str _function; | ||
_function = _function select [1, count _function - 2]; | ||
|
||
missionNamespace setVariable [_name, compileFinal _function]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.