mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Laser - Public getter and setter for laser codes (#9772)
* Getter and setter for laser codes * Documentation * Sanitising input
This commit is contained in:
parent
ae532c72f7
commit
28e45c2979
@ -3,6 +3,7 @@ PREP(addLaserTarget);
|
||||
PREP(addMapHandler);
|
||||
PREP(dev_drawVisibleLaserTargets);
|
||||
PREP(findLaserSource);
|
||||
PREP(getLaserCode);
|
||||
PREP(handleLaserTargetCreation);
|
||||
PREP(keyLaserCodeChange);
|
||||
PREP(laserOff);
|
||||
@ -13,6 +14,7 @@ PREP(onLaserDesignatorDraw);
|
||||
PREP(rotateVectLine);
|
||||
PREP(rotateVectLineGetMap);
|
||||
PREP(seekerFindLaserSpot);
|
||||
PREP(setLaserCode);
|
||||
PREP(shootCone);
|
||||
PREP(shootRay);
|
||||
PREP(showVehicleHud);
|
||||
|
24
addons/laser/functions/fnc_getLaserCode.sqf
Normal file
24
addons/laser/functions/fnc_getLaserCode.sqf
Normal file
@ -0,0 +1,24 @@
|
||||
#include "..\script_component.hpp"
|
||||
/*
|
||||
* Author: johnb43
|
||||
* Gets the laser code of a laser source.
|
||||
*
|
||||
* Argument:
|
||||
* 0: Laser source <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Laser code <NUMBER>
|
||||
*
|
||||
* Example:
|
||||
* player call ace_laser_fnc_getLaserCode;
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_laserSource", objNull, [objNull]]];
|
||||
|
||||
if (isNull _laserSource) exitWith {
|
||||
-1
|
||||
};
|
||||
|
||||
_laserSource getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE]
|
21
addons/laser/functions/fnc_setLaserCode.sqf
Normal file
21
addons/laser/functions/fnc_setLaserCode.sqf
Normal file
@ -0,0 +1,21 @@
|
||||
#include "..\script_component.hpp"
|
||||
/*
|
||||
* Author: johnb43
|
||||
* Sets the laser code on a laser source.
|
||||
*
|
||||
* Argument:
|
||||
* 0: Laser source <OBJECT>
|
||||
* 1: Laser code <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [player, 1111] call ace_laser_fnc_setLaserCode;
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_laserSource", objNull, [objNull]], ["_laserCode", ACE_DEFAULT_LASER_CODE, [0]]];
|
||||
|
||||
_laserSource setVariable [QGVAR(code), _laserCode, true];
|
34
docs/wiki/framework/laser-framework.md
Normal file
34
docs/wiki/framework/laser-framework.md
Normal file
@ -0,0 +1,34 @@
|
||||
---
|
||||
layout: wiki
|
||||
title: Laser
|
||||
description: Explains the functions available for laser designators.
|
||||
group: framework
|
||||
order: 5
|
||||
parent: wiki
|
||||
mod: ace
|
||||
version:
|
||||
major: 3
|
||||
minor: 16
|
||||
patch: 4
|
||||
---
|
||||
|
||||
## 1. Scripting
|
||||
|
||||
### 1.1. Get object's laser code
|
||||
|
||||
`ace_laser_fnc_getLaserCode`
|
||||
|
||||
| | Arguments | Type | Optional (default value)
|
||||
---| --------- | ---- | ------------------------
|
||||
0 | Unit/Vehicle | Object | Required
|
||||
**R** | Laser code | Number | Return value
|
||||
|
||||
### 1.2. Set object's laser code
|
||||
|
||||
`ace_laser_fnc_setLaserCode`
|
||||
|
||||
| | Arguments | Type | Optional (default value)
|
||||
---| --------- | ---- | ------------------------
|
||||
0 | Unit/Vehicle | Object | Required
|
||||
1 | Laser code | Number | Required
|
||||
**R** | None | None | Return value
|
Loading…
Reference in New Issue
Block a user