More Privates

This commit is contained in:
PabstMirror 2015-04-17 18:13:09 -05:00
parent dce344c85f
commit ed2e847247
28 changed files with 72 additions and 74 deletions

View File

@ -24,6 +24,7 @@ GVAR(drawing_controls) = [36732, 36733, 36734, 36735, 36736, 36737];
// The thread dies as soon as the mission start, so it's not really compiting for scheduler space.
[] spawn {
_fnc_installMapEvents = {
private "_d";
_d = _this;
((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseMoving", {_this call FUNC(handleMouseMove);}];
((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonDown", {[1, _this] call FUNC(handleMouseButton);}];

View File

@ -15,10 +15,11 @@
*/
#include "script_component.hpp"
_name = _this select 0;
_startPos = _this select 1;
_difPos = (_this select 2) vectorDiff _startPos ;
_color = _this select 3;
PARAMS_4(_name,_startPos,_endPos,_color);
private ["_marker", "_difPos", "_mag"];
_difPos = _endPos vectorDiff _startPos;
_marker = createMarkerLocal [_name, _startPos];
_name setMarkerShapeLocal "RECTANGLE";

View File

@ -12,6 +12,8 @@
*/
#include "script_component.hpp"
private ["_screenOffset", "_pos"];
_pos = ((finddisplay 12) displayctrl 51) ctrlMapScreenToWorld [0.5, 0.5];
_screenOffset = ((finddisplay 12) displayctrl 51) posWorldToScreen [(_pos select 0) + 100, (_pos select 1)];

View File

@ -15,6 +15,7 @@
PARAMS_1(_lineMarkers);
{
private "_marker";
_marker = _x;
//Add marker if we don't already have it
if (({(_x select 0) == (_marker select 0)} count GVAR(drawing_lineMarkers)) == 0) then {

View File

@ -15,13 +15,10 @@
#include "script_component.hpp"
private ["_dir", "_params", "_control", "_button", "_screenPos", "_shiftKey", "_ctrlKey", "_handled", "_pos"];
PARAMS_5(_display,_code,_shiftKey,_ctrlKey,_altKey);
private ["_handled", "_relPos", "_diffVector", "_magDiffVector", "_lambdaLong", "_lambdaTrasAbs"];
_display = _this select 0;
_code = _this select 1;
_shiftKey = _this select 2;
_ctrlKey = _this select 3;
_altKey = _this select 4;
_handled = false;
#define DIK_ESCAPE 0x01

View File

@ -13,10 +13,9 @@
#include "script_component.hpp"
private ["_dir", "_params", "_control", "_button", "_screenPos", "_shiftKey", "_ctrlKey", "_handled", "_pos"];
private ["_control", "_button", "_screenPos", "_shiftKey", "_ctrlKey", "_handled", "_pos", "_altKey", "_gui", "_marker"];
_dir = _this select 0;
_params = _this select 1;
PARAMS_2(_dir,_params);
_control = _params select 0;
_button = _params select 1;
_screenPos = [_params select 2, _params select 3];

View File

@ -51,6 +51,7 @@ if (GVAR(mapTool_isDragging)) exitWith {
// Rotation
if (GVAR(mapTool_isRotating)) exitWith {
private "_angle";
// Get new angle
_angle = (180 + ((GVAR(mousePosition) select 0) - (GVAR(mapTool_startPos) select 0)) atan2 ((GVAR(mousePosition) select 1) - (GVAR(mapTool_startPos) select 1)) mod 360);
GVAR(mapTool_angle) = GVAR(mapTool_startAngle) + _angle - GVAR(mapTool_startDragAngle);

View File

@ -16,6 +16,7 @@
#define DIST_TOP_TO_CENTER_PERC 0.65
#define DIST_LEFT_TO_CENTER_PERC 0.30
private ["_textureWidth", "_relPos", "_dirVector", "_lambdaLong", "_lambdaTrasAbs", "_pos"];
if (GVAR(mapTool_Shown) == 0) exitWith {false};
_textureWidth = [TEXTURE_WIDTH_IN_M, TEXTURE_WIDTH_IN_M / 2] select (GVAR(mapTool_Shown) - 1);

View File

@ -12,7 +12,10 @@
*/
#include "script_component.hpp"
_shouldOpenGps = _this select 0;
PARAMS_1(_shouldOpenGps);
private ["_isOpen"];
_isOpen = !(isNull (uiNamespace getVariable [QGVAR(ui_mapGpsDisplay), displayNull]));
if (_shouldOpenGps && {"ItemGPS" in assignedItems ACE_player} && {!_isOpen}) then {

View File

@ -3,6 +3,8 @@
#include "script_component.hpp"
private ["_mapGpsDisplay", "_ctrl"];
if ((!("ItemGPS" in assigneditems ACE_player)) || {isNull (uiNamespace getVariable [QGVAR(ui_mapGpsDisplay), displayNull])}) exitWith {
("RscACE_MapGps" call BIS_fnc_rscLayer) cutText ["","PLAIN"]; //close GPS RSC
[(_this select 1)] call CBA_fnc_removePerFrameHandler; //remove frameHandler

View File

@ -11,7 +11,7 @@
#include "script_component.hpp"
_name = _this select 0;
PARAMS_1(_name);
deleteMarkerLocal _name;
{

View File

@ -13,10 +13,11 @@
*/
#include "script_component.hpp"
_name = _this select 0;
_startPos = _this select 1;
_difPos = (_this select 2) vectorDiff _startPos ;
_color = _this select 3;
PARAMS_4(_name,_startPos,_endPos,_color);
private ["_difPos", "_mag"];
_difPos = _endPos vectorDiff _startPos;
_name setMarkerShapeLocal "RECTANGLE";
_name setMarkerAlphaLocal 1;

View File

@ -18,6 +18,8 @@
PARAMS_1(_theMap);
private ["_rotatingTexture", "_textureWidth", "_scale", "_xPos", "_yPos"];
if (!("ACE_MapTools" in items ACE_player)|| {GVAR(mapTool_Shown) == 0}) exitWith {};
_rotatingTexture = "";

View File

@ -14,12 +14,7 @@
*/
#include "script_component.hpp"
private ["_unit", "_weapon", "_magazine"];
_unit = _this select 0;
_target = _this select 1;
_weapon = _this select 2;
_magazine = _this select 3;
PARAMS_4(_unit,_target,_weapon,_magazine);
_target selectWeapon _weapon;

View File

@ -2,13 +2,11 @@
// execute on server only!
#include "script_component.hpp"
private "_unit";
_unit = _this select 0;
PARAMS_1(_unit);
private ["_group0", "_rallypoint"];
_group0 = group _unit; // _group is a reserved veriable and shouldn't be used
_group0 = group _unit; // _group-is a reserved veriable and shouldn't be used
_rallypoint = [
objNull,

View File

@ -16,11 +16,7 @@
#include "script_component.hpp"
private ["_rallypoint", "_respawnMarker", "_side"];
_rallypoint = _this select 0;
_respawnMarker = _this select 1;
_side = _this select 2;
PARAMS_3(_rallypoint,_respawnMarker,_side);
private "_name";
_name = typeOf _rallypoint;
@ -29,12 +25,11 @@ _name = typeOf _rallypoint;
if (hasInterface) then {
// fix init having wrong position, vars etc.
[_rallypoint, _respawnMarker, _side, _name] spawn {
_rallypoint = _this select 0;
_respawnMarker = _this select 1;
_side = _this select 2;
_name = _this select 3;
_marker = format ["ACE_Marker_%1", _name];
PARAMS_4(_rallypoint,_respawnMarker,_side,_name);
private ["_marker", "_type"];
_marker = format ["ACE_Marker_%1", _name];
// exit if it already exist
if (_marker in allMapMarkers) exitWith {};

View File

@ -18,10 +18,9 @@
#include "script_component.hpp"
if !(isServer) exitWith {};
PARAMS_3(_logic,_units,_activated);
_logic = _this select 0;
_activated = _this select 2;
if !(isServer) exitWith {};
if !(_activated) exitWith {};
@ -32,9 +31,10 @@ GVAR(Module) = true;
if (isServer) then {
if (GVAR(RemoveDeadBodiesDisconnected)) then {
private "_fnc_deleteDisconnected";
_fnc_deleteDisconnected = {
_this spawn {
_unit = _this select 0;
PARAMS_1(_unit);
sleep 4;

View File

@ -19,17 +19,13 @@
#include "script_component.hpp"
_this spawn {
_logic = _this select 0;
_units = _this select 1;
_activated = _this select 2;
PARAMS_3(_logic,_units,_activated);
if !(_activated) exitWith {};
if (isServer) then {
_varName = QGVAR(showFriendlyFireMessage);
missionNamespace setVariable [_varName, true];
publicVariable _varName;
missionNamespace setVariable [QGVAR(showFriendlyFireMessage), true];
publicVariable QGVAR(showFriendlyFireMessage);
};
diag_log text "[ACE]: Friendly Fire Messages Module Initialized.";

View File

@ -16,11 +16,9 @@
VOID
*/
#include "script_component.hpp"
_logic = _this select 0;
_units = _this select 1;
_activated = _this select 2;
#include "script_component.hpp"
PARAMS_3(_logic,_units,_activated);
if !(_activated) exitWith {};

View File

@ -18,9 +18,10 @@
#include "script_component.hpp"
_this spawn {
_unit = _this select 0;
_side = _this select 1;
PARAMS_2(_unit,_side);
private ["_rallypoint", "_position"];
// rallypoint names are defined in CfgVehicles.hpp
_rallypoint = [

View File

@ -16,7 +16,7 @@
#include "script_component.hpp"
private ["_forceRemove", "_body"];
private ["_forceRemove", "_body", "_uid"];
_forceRemove = _this select 0;

View File

@ -17,11 +17,10 @@
#include "script_component.hpp"
private ["_unit", "_allGear", "_headgear", "_goggles", "_uniform", "_uniformitems", "_vest", "_vestitems", "_backpack", "_backpackitems", "_primaryweapon", "_primaryweaponitems", "_primaryweaponmagazine", "_handgunweapon", "_handgunweaponitems", "_handgunweaponmagazine", "_assigneditems", "_binocular"];
PARAMS_2(_unit,_allGear);
private ["_unit", "_allGear", "_headgear", "_goggles", "_uniform", "_uniformitems", "_vest", "_vestitems", "_backpack", "_backpackitems", "_primaryweapon", "_primaryweaponitems", "_primaryweaponmagazine", "_handgunweapon", "_handgunweaponitems", "_handgunweaponmagazine", "_assigneditems", "_binocular", "_backpa", "_secondaryweapon", "_secondaryweaponitems", "_secondaryweaponmagazine"];
_unit = _this select 0;
_allGear = _this select 1;
// remove all starting gear of a player
removeAllWeapons _unit;

View File

@ -3,6 +3,7 @@
if (!hasInterface) exitWith {};
// IGNORE_PRIVATE_WARNING(_player)
//["Soldier", {_player = ACE_player; if (currentWeapon _player in (_player getVariable [QGVAR(safedWeapons), []])) then {[false] call FUNC(setSafeModeVisual)}] call EFUNC(common,addInfoDisplayEventHandler);
//@todo addEventHandler infoDisplayChanged with select 1 == "Soldier"

View File

@ -14,11 +14,11 @@
*/
#include "script_component.hpp"
if !(vehicle _unit == _unit) exitWith {false};
PARAMS_3(_unit,_turretAndDirection,_majorStep);
private ["_unit", "_turretAndDirection", "_majorStep", "_weaponIndex", "_zeroing", "_optic", "_increment", "_maxVertical", "_maxHorizontal", "_elevation", "_windage", "_zero"];
if (vehicle _unit != _unit) exitWith {false};
EXPLODE_3_PVT(_this,_unit,_turretAndDirection,_majorStep);
private ["_weaponIndex", "_zeroing", "_optic", "_increment", "_maxVertical", "_maxHorizontal", "_elevation", "_windage", "_zero", "_adjustment"];
_weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex);
if (_weaponIndex < 0) exitWith {false};

View File

@ -12,10 +12,11 @@
*/
#include "script_component.hpp"
if !(vehicle _unit == _unit) exitWith {false};
PARAMS_1(_unit);
private ["_unit", "_adjustment", "_zeroing", "_elevation", "_windage", "_zero"];
_unit = _this select 0;
if (vehicle _unit != _unit) exitWith {false};
private ["_weaponIndex", "_adjustment", "_zeroing", "_elevation", "_windage", "_zero"];
_weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex);
if (_weaponIndex < 0) exitWith {false};

View File

@ -15,10 +15,10 @@
*/
#include "script_component.hpp"
private ["_unit", "_elevation", "_windage", "_zero", "_adjustmentDifference", "_pitchbankyaw", "_pitch", "_bank", "_yaw"];
EXPLODE_4_PVT(_this,_unit,_elevation,_windage,_zero);
private ["_adjustmentDifference", "_pitchbankyaw", "_pitch", "_bank", "_yaw", "_adjustment", "_weaponIndex"];
_weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex);
_adjustment = _unit getVariable QGVAR(Adjustment);

View File

@ -12,13 +12,14 @@
*/
#include "script_component.hpp"
PARAMS_1(_unit);
private ["_weaponIndex", "_adjustment", "_elevation"];
if (cameraView == "GUNNER") exitWith {false};
if !(vehicle _unit == _unit) exitWith {false};
if !(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) exitWith {false};
private ["_unit", "_adjustment", "_elevation"];
_unit = _this select 0;
_weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex);
if (_weaponIndex < 0) exitWith {false};

View File

@ -70,6 +70,8 @@ def check_privates(filepath):
if '_forEachIndex' in priv_use: priv_use.remove('_forEachIndex')
if '_foreachIndex' in priv_declared: priv_declared.remove('_foreachIndex')
if '_foreachIndex' in priv_use: priv_use.remove('_foreachIndex')
if '_foreachindex' in priv_declared: priv_declared.remove('_foreachindex')
if '_foreachindex' in priv_use: priv_use.remove('_foreachindex')
missing = []
for s in priv_use: