Formating and Headers

This commit is contained in:
PabstMirror 2015-02-01 14:56:19 -06:00
parent 8ceb2aabc1
commit fa002b4db6
14 changed files with 406 additions and 392 deletions

View File

@ -1 +1 @@
z\ace\Addons\laser
z\ace\Addons\attach

View File

@ -1,7 +1,8 @@
ace_attach
==========
Introducing the ability to attach various throwables to yourself to mark your position and assist in IFF.
Introducing the ability to attach various throwables to yourself or vehicles, to mark your position and assist in IFF.
Adds item `ACE_IR_Strobe_Item`.
## Maintainers
@ -11,3 +12,4 @@ The people responsible for merging changes to this component or answering potent
- [esteldunedain](https://github.com/esteldunedain)
- [bux578](https://github.com/bux578)
- [KoffeinFlummi](https://github.com/KoffeinFlummi)
- [PabstMirror](https://github.com/PabstMirror)

View File

@ -1,18 +1,21 @@
#include "script_component.hpp"
/*
Author: eRazeri and CAA-Picard
Attach an item to the unit
Arguments:
0: OBJECT - unit doing the attaching (player)
1: OBJECT - vehicle that it will be attached to (player or vehicle)
2: STRING - classname of attached item (from CfgMagazines or CfgWeapons)
Return Value:
none
*/
* Author: eRazeri and CAA-Picard
* Attach an item to the unit
*
* Arguments:
* 0: unit doing the attach (player) <OBJECT>
* 1: vehicle that it will be attached to (player or vehicle) <OBJECT>
* 2: Name of the attachable item <STRING>
*
* Return Value:
* Nothing
*
* Example:
* Nothing
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_3(_unit,_attachToVehicle,_itemName);

View File

@ -1,17 +1,21 @@
#include "script_component.hpp"
/*
* Author: commy2
*
* Check if a unit can attach a specific item.
*
* Argument:
* 0: Unit that wants to attach the object (Object)
* 1: Name of the attachable item (String)
* Arguments:
* 0: unit doing the attach (player) <OBJECT>
* 1: vehicle that it will be attached to (player or vehicle) <OBJECT>
* 2: Name of the attachable item <STRING>
*
* Return value:
* Boolean (Bool)
* Return Value:
* Boolean <BOOL>
*
* Example:
* Nothing
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_3(_unit,_attachToVehicle,_item);

View File

@ -1,16 +1,20 @@
#include "script_component.hpp"
/*
* Author: commy2
*
* Check if a unit has an item attached and if it can remove that item.
*
* Argument:
* 0: Unit that wants to detach something (Object)
*
* Return value:
* Boolean (Bool)
*/
* Author: commy2
* Check if a unit has an item attached and if it can remove that item.
*
* Arguments:
* 0: unit doing the detaching (player) <STRING>
* 1: vehicle that it will be detached from (player or vehicle) <OBJECT>
*
* Return Value:
* Boolean <BOOL>
*
* Example:
* Nothing
*
* Public: No
*/
#include "script_component.hpp"
private ["_attachedObjects", "_inRange", "_unitPos", "_objectPos"];

View File

@ -1,17 +1,20 @@
#include "script_component.hpp"
/*
Author: eRazeri and CAA-Picard
Detach an item from a unit
Arguments:
0: OBJECT - unit doing the attaching (player)
1: OBJECT - vehicle that it will be detached from (player or vehicle)
Return Value:
none
*/
* Author: eRazeri and CAA-Picard
* Detach an item from a unit
*
* Arguments:
* 0: unit doing the attaching (player) <STRING>
* 1: vehicle that it will be detached from (player or vehicle) <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
* Nothing
*
* Public: No
*/
#include "script_component.hpp"
private ["_itemName", "_count", "_attachedItem", "_fnc_detachDelay"];
@ -71,13 +74,13 @@ _attachToVehicle setVariable ["ACE_AttachedItemNames", _attachedItemsArray, true
// Display message
switch true do {
case (_itemName == "ACE_IR_Strobe_Item") : {
case (_itemName == "ACE_IR_Strobe_Item") : {
[localize "STR_ACE_Attach_IrStrobe_Detached"] call EFUNC(common,displayTextStructured);
};
case (_itemName == "B_IR_Grenade" or _itemName == "O_IR_Grenade" or _itemName == "I_IR_Grenade") : {
case (_itemName == "B_IR_Grenade" or _itemName == "O_IR_Grenade" or _itemName == "I_IR_Grenade") : {
[localize "STR_ACE_Attach_IrGrenade_Detached"] call EFUNC(common,displayTextStructured);
};
case (_itemName == "Chemlight_blue" or {_itemName == "Chemlight_green"} or {_itemName == "Chemlight_red"} or {_itemName == "Chemlight_yellow"}) : {
case (_itemName == "Chemlight_blue" or {_itemName == "Chemlight_green"} or {_itemName == "Chemlight_red"} or {_itemName == "Chemlight_yellow"}) : {
[localize "STR_ACE_Attach_Chemlight_Detached"] call EFUNC(common,displayTextStructured);
};
};

View File

@ -1,21 +1,21 @@
/*
* Author: Garth de Wet (LH)
* Opens the UI for attaching objects.
*
* Arguments:
* 0: unit <STRING>
* 1: target <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
* Nothing
*
* Public: No
*/
#include "script_component.hpp"
/*
Author: Garth de Wet (LH)
Description:
Opens the UI for attaching objects.
Parameters:
0: OBJECT - unit
1: OBJECT - target
Returns:
Nothing
Example:
[player] call ACE_Attach_fnc_openAttachUI;
*/
private ["_actions", "_attachables", "_item"];
PARAMS_2(_unit,_target);
@ -55,13 +55,13 @@ _attachables = items _unit;
} forEach _attachables;
[
_actions,
{
_actions,
{
[ACE_player, GVAR(attachTarget), _this] call FUNC(attach);
call EFUNC(interaction,hideMenu);
},
{
},
{
call EFUNC(interaction,hideMenu);
if !(profileNamespace getVariable [QEGVAR(interaction,AutoCloseMenu), false]) then {"Default" call EFUNC(interaction,openMenuSelf)};
}
}
] call EFUNC(interaction,openSelectMenu);

View File

@ -1,16 +1,18 @@
/*
Name: FUNC(placeApprove)
Author(s):
Pabst Mirror (based on Explosive attach by Garth de Wet (LH))
Description:
Approves placement of the lightObject, releases the placement object for it to settle in a location
Parameters:
Nothing
Returns:
Nothing
Example:
call FUNC(placeApprove);
*/
* Author: Pabst Mirror (based on Explosive attach by Garth de Wet (LH))
* Approves placement of the lightObject, scans for an appropriate location and attaches
*
* Arguments:
* Nothing
*
* Return Value:
* Nothing
*
* Example:
* Nothing
*
* Public: No
*/
#include "script_component.hpp"
private ["_setupObject", "_setupClassname", "_itemClassname", "_placementText", "_attachToVehicle", "_placer", "_startingPosition", "_startingOffset", "_distanceFromCenter", "_closeInUnitVector", "_keepGoingCloser", "_closeInDistance", "_endPosTestOffset", "_endPosTest", "_startingPosShifted", "_startASL", "_endPosShifted", "_endASL", "_attachedObject", "_currentObjects", "_currentItemNames"];

View File

@ -1,21 +1,18 @@
/*
Name: FUNC(placeCancel)
Author(s):
Pabst Mirror (based on Explosive attach by Garth de Wet (LH))
Description:
Cancels placement of the lightObject
Parameters:
Nothing
Returns:
Nothing
Example:
call FUNC(placeCancel);
*/
* Author: Pabst Mirror (based on Explosive attach by Garth de Wet (LH))
* Cancels placement of the lightObject
*
* Arguments:
* Nothing
*
* Return Value:
* Nothing
*
* Example:
* Nothing
*
* Public: No
*/
#include "script_component.hpp"
if (GVAR(pfeh_running)) then {
@ -25,11 +22,6 @@ if (GVAR(pfeh_running)) then {
if (!isNull (GVAR(setupObject))) then {
deleteVehicle GVAR(setupObject);
};
GVAR(SetupPlacmentItem) = "";
GVAR(SetupPlacmentText) = "";
GVAR(setupObject) = objNull;
GVAR(SetupAttachVehicle) = objNull;
[GVAR(placer), QGVAR(vehAttach), false] call EFUNC(common,setForceWalkStatus);
call EFUNC(interaction,hideMouseHint);
@ -37,3 +29,7 @@ call EFUNC(interaction,hideMouseHint);
[GVAR(placer), "MenuBack", GVAR(placer) getVariable [QGVAR(cancelActionEH), -1]] call EFUNC(common,removeActionEventHandler);
GVAR(placer) = objNull;
GVAR(SetupPlacmentItem) = "";
GVAR(SetupPlacmentText) = "";
GVAR(setupObject) = objNull;
GVAR(SetupAttachVehicle) = objNull;