Name Tags cleanup

This commit is contained in:
jonpas 2015-05-16 00:22:23 +02:00
parent 7c96c12bd5
commit bffe58efd6
9 changed files with 100 additions and 89 deletions

View File

@ -1,12 +1,8 @@
/*
Author: aeroson
Description:
Images, index in images and order of roles.
Defined number also implies order, lower number shows more on top of the list.
*/
#include "script_component.hpp"
* Author: aeroson
* Images, index in images and order of roles.
* Defined number also implies order, lower number shows more on top of the list.
*/
#define PILOT 0
#define DRIVER 1

View File

@ -1,19 +1,22 @@
/*
Author: aeroson
Description:
Might be called several times a second
Parameters:
None
Returns:
true if CrewInfo can be shown, false otherwise
*/
* Author: aeroson
* Checks if crew info can be shown.
* Might be called several times a second.
*
* Arguments:
* None
*
* Return Value:
* Can show Crew Info <BOOL>
*
* Example:
* call ace_nametags_fnc_doShow
*
* Public: No
*/
#include "script_component.hpp"
private["_player"];
private ["_player"];
_player = ACE_player;

View File

@ -1,16 +1,18 @@
/*
Author: aeroson
Description:
Shows the actual text and sets text the crew info
Parameters:
None
Returns:
Nothing
*/
* Author: aeroson
* Shows the actual text and sets text the crew info.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* call ace_nametags_fnc_doShow
*
* Public: No
*/
#include "script_component.hpp"
#include "common.hpp";

View File

@ -1,17 +1,21 @@
/*
* Author: commy2, esteldunedain
*
* Draw the nametag and rank icon.
*
* Argument:
* Arguments:
* 0: Unit (Player) <OBJECT>
* 1: Target <OBJECT>
* 2: alpha (Number)
* 4: Height offset (Number)
* 2: Alpha <NUMBER>
* 4: Height offset <NUMBER>
* 5: Draw Type <NUMBER>
*
* Return value:
* None.
* None
*
* Example:
* [ACE_player, _target, _alpha, _distance * 0.026, _icon] call ace_nametags_fnc_drawNameTagIcon
*
* Public: No
*/
#include "script_component.hpp"

View File

@ -1,46 +1,38 @@
/*
Author: aeroson
Description:
Gathers and caches data needed by AGM_CrewInfo_fnc_doShow
What really does make difference for the engine is simulation of CfgAmmo
Priority of roles is: driver/pilot, gunner, copilot, commander, ffv, cargo
Parameters:
None
Returns:
[
Is vehicle inherited from Air ?
Array categorizing each vehicle's turret
]
*/
* Author: aeroson
* Gathers and caches data needed by AGM_CrewInfo_fnc_doShow.
* What really does make difference for the engine is simulation of CfgAmmo.
* Priority of roles is: driver/pilot, gunner, copilot, commander, FFV, cargo.
*
* Arguments:
* None
*
* Return Value:
* Data <ARRAY>
* 0: Vehicle inherits from Air <BOOL>
* 1: Categorized vehicle's turrets <ARRAY>
*
* Example:
* call ace_nametags_fnc_updateSettings
*
* Public: No
*/
#include "script_component.hpp"
#include "common.hpp";
private ["_type", "_varName", "_data", "_isAir", "_config", "_fnc_addTurret", "_fnc_addTurretUnit"];
private ["_type", "_varName", "_data"];
_type = _this select 0;
PARAMS_1(_type);
_varName = format ["ACE_CrewInfo_Cache_%1", _type];
_data = + (uiNamespace getVariable _varName);
if (!isNil "_data") exitWith {
_data
};
if (!isNil "_data") exitWith {_data};
_data = [];
private ["_isAir", "_config", "_fnc_addTurret", "_fnc_addTurretUnit"];
_isAir = _type isKindOf "Air";
_fnc_addTurretUnit = {
private ["_config", "_path", "_role", "_simulationEmpty", "_simulationLaserDesignate", "_simulationOther", "_magazine", "_ammo", "_simulation"];
_config = _this select 0;
@ -83,7 +75,6 @@ _fnc_addTurretUnit = {
};
_data pushBack [_path, _role];
};
@ -108,9 +99,7 @@ _fnc_addTurret = {
} else {
_offset = _offset + 1;
};
};
};

View File

@ -4,13 +4,13 @@
* Compatiblity with TFR/ACRE and Arma's VON
*
* Arguments:
* NONE
* None
*
* Return Value:
* NONE
* None
*
* Example:
* [] call ACE_nametags_fnc_initIsSpeaking
* [] call ace_nametags_fnc_initIsSpeaking
*
* Public: No
*/

View File

@ -1,3 +1,18 @@
/*
* Author: <N/A>
* Draws names and icons.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* call ace_nametags_fnc_onDraw3d
*
* Public: No
*/
#include "script_component.hpp"
private ["_onKeyPressAlphaMax", "_defaultIcon", "_distance", "_alpha", "_icon", "_targets", "_pos2", "_vecy", "_relPos", "_projDist", "_pos", "_target"];

View File

@ -1,25 +1,28 @@
/*
Author: aeroson
Description:
Sets the text on the dialog
Parameters:
None
Returns:
Nothing
*/
/*
* Author: aeroson
* Sets the text on the dialog.
*
* Arguments:
* 0: Text <STRING>
*
* Return Value:
* None
*
* Example:
* call ace_nametags_fnc_setText
*
* Public: No
*/
#include "script_component.hpp"
#define TextIDC 11123
private["_text", "_ctrl"];
PARAMS_1(_text);
private["_ctrl"];
disableSerialization;
_text = _this select 0;
_ctrl = (uiNamespace getVariable QGVAR(dialog)) displayCtrl TextIDC;
_ctrl ctrlSetStructuredText parseText _text;
_ctrl ctrlCommit 0;

View File

@ -13,7 +13,6 @@
*
* Public: No
*/
#include "script_component.hpp"
if (isNil QGVAR(drawHandler) && {GVAR(showPlayerNames) != 0}) then {