Blank space cleanup

This commit is contained in:
SilentSpike 2015-07-05 00:10:01 +01:00
parent 5e7c094c98
commit 27610b78e1
20 changed files with 72 additions and 72 deletions

View File

@ -26,4 +26,4 @@ PREP(unitInfo);
PREP(unitSide);
PREP(unitVar);
ADDON = true;
ADDON = true;

View File

@ -4,16 +4,16 @@
Description:
Compile array of units to spectate.
Arguments:
None.
Example:
call ace_spectator_fnc_checkUnits;
Return Value:
None
Public:
No
*/
@ -32,6 +32,6 @@ GVAR(units) = [];
_x addEventHandler ["Respawn", {_this call FUNC(respawn)}];
_x setVariable [QGVAR(listed), true];
};
if ([_x] call FUNC(canSpectateUnit)) then {GVAR(units) pushback _x};
} forEach _units;
} forEach _units;

View File

@ -4,19 +4,19 @@
Description:
Orient and set compass.
Arguments:
0: Compass <Display>
Example:
[display] call ace_spectator_fnc_compass;
Return Value:
None
Public:
No
*/
*/
#include "script_component.hpp"
@ -56,4 +56,4 @@ _qOrder = switch (true) do {
{
_x ctrlSetPosition (_positions select _forEachIndex);
_x ctrlCommit 0;
} forEach _qOrder;
} forEach _qOrder;

View File

@ -26,4 +26,4 @@ if (!isNull _xhair) then {
if (!isNull GVAR(attach)) then {[1,1,0,0.8]} else {[1,1,1,0.8]};
};
(_xhair displayCtrl 0) ctrlSetTextColor _colour;
};
};

View File

@ -31,4 +31,4 @@ if (!isNull _status) then {[_status] call FUNC(status)};
if (GVAR(markers) > 0) then {
call FUNC(drawMines3D);
call FUNC(drawUnits3D);
};
};

View File

@ -1,7 +1,7 @@
/*
Author:
voiper
Description:
Draw mines on spectator map.
@ -40,4 +40,4 @@ _showText = (GVAR(markers) > 1);
_name = getText (configFile >> "CfgMagazines" >> _magName >> "displayName");
};
_map drawIcon [TEXTURE, [1,0.5,0,1], getPos _x, _iconSize, _iconSize, getDir _x, _name, 1, _textSize, "PuristaMedium"];
} forEach allMines;
} forEach allMines;

View File

@ -1,7 +1,7 @@
/*
Author:
voiper
Description:
Draw mines in 3D.
@ -33,23 +33,23 @@ _showText = (GVAR(markers) > 1);
{
_pos = getPos _x;
_dist = (_cam distance _pos) + 0.1;
if (_dist < 2000) then {
_distScaled = SCALE / sqrt(_dist);
_iconScale = 300 * _distScaled;
//_iconSize = (20 * _size) max _scale min _min;
_iconSize = _iconScale max ICONMAX min ICONMIN;
_textSize = 0;
if (_showText) then {
_textScale = 10 * _distScaled;
_textSize = _textScale max TEXTMAX min TEXTMIN;
};
_magName = getText (configFile >> "CfgAmmo" >> (typeOf _x) >> "defaultMagazine");
_name = getText (configFile >> "CfgMagazines" >> _magName >> "displayName");
drawIcon3D [TEXTURE, [1,0.5,0,1], _pos, _iconSize, _iconSize, 0, _name, 1, _textSize, "PuristaMedium"];
};
} forEach allMines;
} forEach allMines;

View File

@ -26,12 +26,12 @@ _zoom = _this select 1;
{
_unit = _x select 0;
_info = [_unit] call FUNC(unitInfo);
_colour = _info select 2;
if (_unit == GVAR(unit)) then {_colour = [1,1,0,_colour select 3]};
_positions = _x select 1;
_count = count _positions;
_step = floor (10 * _zoom) min 3 max 1;
@ -47,10 +47,10 @@ _zoom = _this select 1;
};
};
};
//((_count - _step + _count mod _step) max 0)
if (alive _unit) then {
_map drawLine [_positions select _lastIndex, getPosVisual _unit, _colour];
};
} forEach GVAR(trackingArray);
} forEach GVAR(trackingArray);

View File

@ -71,11 +71,11 @@ _textSize = (0.25 * _size) max (SCALE / 2) min (SCALE / 1.5);
if (_isTarget) exitWith {
_topIcon = [_icon, [1,1,0,1], _pos, _iconSize, _iconSize, _dir, _iconText, 1, _textSize, "PuristaBold", "RIGHT"];
};
_map drawIcon [_icon, _colour, _pos, _iconSize, _iconSize, _dir, _iconText, 1, _textSize, "PuristaMedium", "RIGHT"]
};
} forEach GVAR(units);
if (count _topIcon > 0) then {
_map drawIcon _topIcon;
};
};

View File

@ -29,7 +29,7 @@
_cam = GVAR(cam);
_showText = (GVAR(markers) > 1);
_topIcon = [];
{
_unit = _x;
@ -37,11 +37,11 @@ _topIcon = [];
_veh = vehicle _unit;
_inVeh = (_veh != _unit);
_cmdr = if (_inVeh && (_unit == ((crew _veh) select 0))) then {true} else {false};
_obj = if (_inVeh && _cmdr) then {_veh} else {_unit};
_pos = if (surfaceIsWater getPos _obj) then {getPosASLVisual _obj} else {getPosATLVisual _obj};
_dist = (_cam distance _pos) + 0.1;
_isTarget = (_unit == GVAR(unit));
//exit if too far
@ -83,7 +83,7 @@ _topIcon = [];
if (GVAR(markers) > 2) then {
_text = _text + " [" + str ceil(_dist) + "]";
};
if (_isTarget) exitWith {
_topIcon = [_icon, [1,1,0,1], _pos, _iconSize, _iconSize, 0, _text, 2, _textSize, "PuristaBold", "CENTER", true];
};
@ -94,4 +94,4 @@ _topIcon = [];
if ((count _topIcon > 0) && GVAR(cameraOn)) then {
drawIcon3D _topIcon;
};
};

View File

@ -32,7 +32,7 @@ if (!isNull _killer) then {
if (GVAR(markers) > 2 && !difficultyEnabled "deathMessages") then {
_nameUnit = name _unit;
_nameKiller = name _killer;
_text = if (_killer == _unit) then {
format ["%1 died", _nameUnit]
} else {
@ -62,4 +62,4 @@ if (!isNil QGVAR(trackingArray)) then {
_tracks pushBack _pos;
_unitArray set [1, _tracks];
GVAR(trackingArray) set [_index, _unitArray];
};
};

View File

@ -15,14 +15,14 @@ PARAMS_3(_logic,_units,_activated);
if !(_activated) exitWith {};
[_logic, QGVAR(enabled), "SpectatorEnabled"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(limitSide), "SpectatorPlayerSide"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(AI), "SpectatorAI"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(enabled), "SpectatorEnabled"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(limitSide), "SpectatorPlayerSide"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(AI), "SpectatorAI"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(tracking), "SpectatorTracking"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(modulePos), "SpectatorPos"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(endMission), "SpectatorEnd"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(modulePos), "SpectatorPos"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(endMission), "SpectatorEnd"] call EFUNC(common,readSettingFromModule);
if GVAR(modulePos) then {
GVAR(startingPos) = getPosATL _logic;
GVAR(startingDir) = getDir _logic;
};
};

View File

@ -25,23 +25,23 @@ _mode = _this select 0;
_this = _this select 1;
switch _mode do {
case "Init": {
_display = _this select 0;
_ctrl = _display displayCtrl 0;
_count = _ctrl tvCount [];
for "_i" from 0 to _count do {
_ctrl tvDelete [_x];
};
_ctrl tvAdd [[], "Blufor"];
_ctrl tvAdd [[], "Opfor"];
_ctrl tvAdd [[], "Independent"];
_ctrl tvAdd [[], "Civilian"];
_unitList = [];
{
_units = units _x;
private ["_groupNum"];
@ -56,15 +56,15 @@ switch _mode do {
case INDEPENDENT: {2};
case CIVILIAN: {3};
};
_icon = getText (configFile >> "CfgVehicles" >> (typeOf _x) >> "Icon");
_picture = "\a3\ui_f\data\map\VehicleIcons\" + _icon + "_ca.paa";
_treeIndex = [];
_unitList pushBack _x;
_savedUnit = GVAR(savedUnits) find _x;
if (_savedUnit > -1) then {_text = _text + " (#" + str (_savedUnit + 1) + ")"};
if (_forEachIndex == 0) then {
_groupNum = _ctrl tvAdd [[_side], _text];
_treeIndex = [_side, _groupNum];
@ -79,7 +79,7 @@ switch _mode do {
};
} forEach _units;
} forEach allGroups;
if (!isNull GVAR(unit)) then {
if (alive GVAR(unit)) then {
_treeIndex = _unitList select ((_unitList find GVAR(unit)) + 1);
@ -87,13 +87,13 @@ switch _mode do {
};
};
};
case "Select": {
_ctrl = _this select 0;
_selection = _this select 1;
if (count _selection < 2) exitWith {};
_str = _ctrl tvData _selection;
_unit = missionNamespace getVariable _str;
GVAR(unit) = _unit;
@ -103,4 +103,4 @@ switch _mode do {
["Camera", ["SwitchUnit"]] call FUNC(camera);
};
};
};
};

View File

@ -22,4 +22,4 @@
_unit = _this select 0;
_unit setVariable [QGVAR(name), name _unit, true];
//_unit setVariable [QGVAR(listed), false];
//_unit setVariable [QGVAR(listed), false];

View File

@ -32,7 +32,7 @@ _colour = switch _side do {
GETCOLOUR('Map_BLUFOR_B', 0.6)
]
};
case OPFOR: {
[
GETCOLOUR('Map_OPFOR_R', 0.5),
@ -40,7 +40,7 @@ _colour = switch _side do {
GETCOLOUR('Map_OPFOR_B', 0)
]
};
case INDEPENDENT: {
[
GETCOLOUR('Map_Independent_R', 0),
@ -48,7 +48,7 @@ _colour = switch _side do {
GETCOLOUR('Map_Independent_B', 0)
]
};
case CIVILIAN: {
[
GETCOLOUR('Map_Civilian_R', 0.4),
@ -63,4 +63,4 @@ _colour set [1, (_colour select 1) * FACTOR];
_colour set [2, (_colour select 2) * FACTOR];
_colour set [3, 1];
_colour
_colour

View File

@ -57,4 +57,4 @@ _timeAccText = (str ([GVAR(accTime), 4] call BIS_fnc_cutDecimals)) + "x";
_focusDist = [GVAR(focus) select 0, 1] call BIS_fnc_cutDecimals;
_focusBlur = GVAR(focus) select 1;
_focusText = if (_focusDist == -1 && _focusBlur == 1) then {"Auto"} else {if (_focusDist < 0) then {toString [8734]} else {str _focusDist + "m"}};
(_display displayCtrl 6) ctrlSetText _focusText;
(_display displayCtrl 6) ctrlSetText _focusText;

View File

@ -30,7 +30,7 @@ if (count GVAR(units) < 1) exitWith {};
_unit = _x;
_pos = getPos _unit;
_pos resize 2;
_index = -1;
{if ((_x select 0) == _unit) then {_index = _forEachIndex}} forEach GVAR(trackingArray);
@ -43,12 +43,12 @@ if (count GVAR(units) < 1) exitWith {};
_latestPos = _trackingArray select _latestIndex;
_diffX = abs((_latestPos select 0) - (_pos select 0));
_diffY = abs((_latestPos select 1) - (_pos select 1));
if !((_diffX < 20) && (_diffY < 20)) then {
_trackingArray pushBack _pos;
_trackingArray pushBack _pos;
_unitArray set [1, _trackingArray];
GVAR(trackingArray) set [_index, _unitArray];
};
};
} forEach GVAR(units);
} forEach GVAR(units);

View File

@ -31,4 +31,4 @@ if (!alive _unit) then {
_colour set [3, 0.8];
};
[_name, _side, _colour]
[_name, _side, _colour]

View File

@ -36,4 +36,4 @@ if (alive _unit) then {
};
};
_side
_side

View File

@ -23,16 +23,16 @@ _var = _object getVariable [QGVAR(objectVar), ""];
if (_var == "") then {
_var = vehicleVarname _object;
if (_var == "") then {
_var = [_this, 1, QGVAR(obj), [""]] call BIS_fnc_param;
_varID = [_var, 1] call BIS_fnc_counter;
_var = _var + str _varID;
};
_object setVariable [QGVAR(objectVar), _var];
missionNamespace setVariable [_var, _object];
_object setVehicleVarname _var;
};
_var
_var