More Privates

This commit is contained in:
PabstMirror 2015-04-17 15:45:00 -05:00
parent 9c054b7f35
commit 00f26144ec
36 changed files with 151 additions and 145 deletions

View File

@ -13,6 +13,8 @@
*/
#include "script_component.hpp"
private ["_interval", "_player", "_newVel", "_accel", "_currentGForce", "_average", "_sum", "_classCoef", "_suitCoef", "_gBlackOut", "_gRedOut", "_g", "_gBO", "_coef", "_strength"];
EXPLODE_2_PVT(_this,_params,_pfhId);
_interval = time - GVAR(lastUpdateTime);

View File

@ -15,7 +15,7 @@
*/
#include "script_component.hpp"
private ["_affected", "_strength", "_posGrenade", "_posUnit", "_angleGrenade", "_angleView", "_angleDiff", "_light", "_losCount"];
private ["_affected", "_strength", "_posGrenade", "_posUnit", "_angleGrenade", "_angleView", "_angleDiff", "_light", "_losCount", "_dirToUnitVector", "_eyeDir", "_eyePos"];
PARAMS_1(_grenade);

View File

@ -20,6 +20,7 @@ PARAMS_1(_projectile);
if (alive _projectile) then {
playSound3D ["A3\Sounds_F\weapons\Explosion\explosion_mine_1.wss", _projectile, false, getPosASL _projectile, 5, 1.2, 400];
private "_affected";
_affected = _projectile nearEntities ["CAManBase", 50];
["flashbangExplosion", _affected, [_projectile]] call EFUNC(common,targetEvent);
};

View File

@ -12,6 +12,8 @@ PREP(sendMarkersJIP);
PREP(setMarkerJIP);
PREP(setMarkerNetwork);
private ["_config", "_marker", "_a", "_scope", "_icon", "_rgba", "_name"];
// init marker types
if (isNil QGVAR(MarkersCache)) then {
_config = configfile >> "CfgMarkers";

View File

@ -19,6 +19,8 @@
#define BORDER 0.005
[{
private ["_display", "_text", "_picture", "_channel", "_buttonOK", "_buttonCancel", "_description", "_title", "_descriptionChannel", "_sizeX", "_sizeY", "_aceShapeLB", "_aceColorLB", "_aceAngleSlider", "_aceAngleSliderText", "_mapIDD", "_pos", "_posX", "_posY", "_posW", "_posH", "_offsetButtons", "_buttonOk", "_curSelShape", "_curSelColor", "_curSelAngle"];
disableserialization;
PARAMS_1(_display);

View File

@ -54,6 +54,8 @@ GVAR(rangeFinderPositionASL) = [];
GVAR(mapAltitude) = getNumber (configFile >> "CfgWorlds" >> worldName >> "elevationOffset");
private ["_worldMapLong", "_worldMapLat", "_zone", "_band", "_squareID"];
//Calculate the map's MGRS:
_worldMapLong = getNumber (configFile >> "CfgWorlds" >> worldName >> "longitude");
_worldMapLat = getNumber (configFile >> "CfgWorlds" >> worldName >> "latitude");

View File

@ -19,6 +19,8 @@
PARAMS_2(_waypointName,_waypointPosASL);
private "_waypoints";
_waypoints = ace_player getVariable [QGVAR(waypoints), []];
_waypoints pushBack [_waypointName, _waypointPosASL];
ace_player setVariable [QGVAR(waypoints), _waypoints];

View File

@ -18,6 +18,8 @@
PARAMS_1(_wpIndex);
private "_waypoints";
_waypoints = ace_player getVariable [QGVAR(waypoints), []];
if ((_wpIndex < 0) || (_wpIndex > ((count _waypoints) - 1))) exitWith {ERROR("out of bounds wp");};

View File

@ -20,6 +20,8 @@
PARAMS_4(_theMap,_mouseButton,_xPos,_yPos);
private ["_worldPos"];
//Only handle LMB
if (_mouseButton != 0) exitWith {};

View File

@ -17,7 +17,8 @@
PARAMS_1(_theMap);
_theMap = _this select 0;
private ["_mapSize", "_waypoints", "_size", "_targetPos", "_relBearing", "_wpName", "_wpPos", "_alpha"];
_mapSize = (ctrlPosition _theMap) select 3;
_waypoints = [] call FUNC(deviceGetWaypoints);

View File

@ -16,7 +16,7 @@
*/
#include "script_component.hpp"
private ["_display", "_theMap", "_mapSize", "_centerPos"];
private ["_display", "_theMap", "_mapSize", "_centerPos", "_mapCtrlPos"];
PARAMS_1(_newMode);
@ -39,13 +39,13 @@ if (GVAR(currentApplicationPage) == 2) then {
//Hit button again, toggle map modes:
if (_newMode == 2) then {
if (GVAR(mapShowTexture)) then {
GVAR(mapShowTexture) = false;
} else {
if (GVAR(mapShowTexture)) then {
GVAR(mapShowTexture) = false;
} else {
if (GVAR(MapDataAvailable) == MAP_DETAIL_SAT) then {
GVAR(mapShowTexture) = true;
};
};
};
};
};

View File

@ -9,15 +9,15 @@
* The return value <BOOL>
*
* Example:
* _bool = [player] call ace_movement_fnc_canClimb
* [player] call ace_movement_fnc_canClimb
*
* Public: No
*/
#include "script_component.hpp"
private ["_unit", "_pos", "_dir"];
private ["_pos", "_dir"];
_unit = _this select 0;
PARAMS_1(_unit);
_pos = getPosASL _unit;
_dir = getDir _unit;

View File

@ -9,7 +9,7 @@
* The return value <NUMBER>
*
* Example:
* _bool = [player] call ace_movement_fnc_getWeight
* [player] call ace_movement_fnc_getWeight
*
* Public: No
*/

View File

@ -27,7 +27,7 @@
"\A3\Ui_f\data\GUI\Cfg\Ranks\colonel_gs.paa" \
]
private ["_height", "_position", "_color", "_name", "_rank", "_size"];
private ["_height", "_position", "_color", "_name", "_rank", "_size", "_icon"];
PARAMS_5(_player,_target,_alpha,_heightOffset,_iconType);

View File

@ -55,6 +55,7 @@ if (isClass (configFile >> "cfgPatches" >> "acre_api")) then {
//Note: class RscDisplayVoiceChat {idd = 55} - only present when talking
[{
private ["_oldSetting", "_newSetting"];
_oldSetting = ACE_player getVariable [QGVAR(isSpeakingInGame), false];
_newSetting = (!(isNull findDisplay 55));
if (!(_oldSetting isEqualTo _newSetting)) then {

View File

@ -14,9 +14,7 @@
if !(isServer) exitWith {};
_logic = _this select 0;
_units = _this select 1;
_activated = _this select 2;
PARAMS_3(_logic,_units,_activated);
if !(_activated) exitWith {};

View File

@ -1,9 +1,9 @@
#include "script_component.hpp"
_player = ACE_player;
private ["_onKeyPressAlphaMax", "_defaultIcon", "_distance", "_alpha", "_icon", "_targets", "_pos2", "_vecy", "_relPos", "_projDist", "_pos", "_target"];
//don't show nametags in spectator
if (!alive _player) exitWith {};
if (!alive ACE_player) exitWith {};
_onKeyPressAlphaMax = if ((GVAR(showPlayerNames) in [3,4])) then {
2 + (GVAR(ShowNamesTime) - time); //after release 1 second of full opacity, 1 second of fading to 0
@ -24,14 +24,14 @@ if (GVAR(showCursorTagForVehicles) && {_onKeyPressAlphaMax > 0}) then {
if ((!(_target isKindOf "CAManBase")) && {!(_target in allUnitsUAV)}) then {
_target = effectiveCommander _target;
if ((!isNull _target) &&
{(side (group _target)) == (side (group _player))} &&
{_target != _player} &&
{(side (group _target)) == (side (group ACE_player))} &&
{_target != ACE_player} &&
{GVAR(ShowNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} &&
{!(_target getVariable ["ACE_hideName", false])}) then {
_distance = _player distance _target;
_distance = ACE_player distance _target;
_alpha = ((1 - 0.2 * (_distance - GVAR(PlayerNamesViewDistance))) min 1) * GVAR(PlayerNamesMaxAlpha);
_alpha = _alpha min _onKeyPressAlphaMax;
[_player, _target, _alpha, _distance * 0.026, _defaultIcon] call FUNC(drawNameTagIcon);
[ACE_player, _target, _alpha, _distance * 0.026, _defaultIcon] call FUNC(drawNameTagIcon);
};
};
};
@ -41,11 +41,11 @@ if ((GVAR(showPlayerNames) in [2,4]) && {_onKeyPressAlphaMax > 0}) then {
_target = cursorTarget;
if ((!isNull _target) &&
{_target isKindOf "CAManBase"} &&
{(side (group _target)) == (side (group _player))} &&
{_target != _player} &&
{(side (group _target)) == (side (group ACE_player))} &&
{_target != ACE_player} &&
{GVAR(ShowNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} &&
{!(_target getVariable ["ACE_hideName", false])}) then {
_distance = _player distance _target;
_distance = ACE_player distance _target;
_alpha = ((1 - 0.2 * (_distance - GVAR(PlayerNamesViewDistance))) min 1) * GVAR(PlayerNamesMaxAlpha);
_alpha = _alpha min _onKeyPressAlphaMax;
_icon = ICON_NONE;
@ -55,7 +55,7 @@ if ((GVAR(showPlayerNames) in [2,4]) && {_onKeyPressAlphaMax > 0}) then {
_icon = if (([_target] call FUNC(isSpeaking)) && {(vehicle _target) == _target} && {GVAR(showSoundWaves) > 0}) then {ICON_NAME_SPEAK} else {_defaultIcon};
};
[_player, _target, _alpha, _distance * 0.026, _icon] call FUNC(drawNameTagIcon);
[ACE_player, _target, _alpha, _distance * 0.026, _icon] call FUNC(drawNameTagIcon);
};
};
@ -84,12 +84,12 @@ if (((GVAR(showPlayerNames) in [1,3]) && {_onKeyPressAlphaMax > 0}) || {GVAR(sho
};
if ((_icon != ICON_NONE) &&
{(side (group _target)) == (side (group _player))} &&
{_target != _player} &&
{(side (group _target)) == (side (group ACE_player))} &&
{_target != ACE_player} &&
{GVAR(ShowNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} &&
{!(_target getVariable ["ACE_hideName", false])}) then {
if (lineIntersects [_pos, (visiblePositionASL _target) vectorAdd [0,0,1], vehicle _player, _target]) exitWith {}; // Check if there is line of sight
if (lineIntersects [_pos, (visiblePositionASL _target) vectorAdd [0,0,1], vehicle ACE_player, _target]) exitWith {}; // Check if there is line of sight
_relPos = (visiblePositionASL _target) vectorDiff _pos;
_distance = vectorMagnitude _relPos;
_projDist = _relPos vectorDistance (_vecy vectorMultiply (_relPos vectorDotProduct _vecy));
@ -102,7 +102,7 @@ if (((GVAR(showPlayerNames) in [1,3]) && {_onKeyPressAlphaMax > 0}) || {GVAR(sho
_alpha = _alpha min _onKeyPressAlphaMax;
};
[_player, _target, _alpha, _distance * 0.026, _icon] call FUNC(drawNameTagIcon);
[ACE_player, _target, _alpha, _distance * 0.026, _icon] call FUNC(drawNameTagIcon);
};
} forEach _targets;
};

View File

@ -42,7 +42,7 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0;
// Conditions: canInteract
if !([ACE_player, objNull, ["isNotEscorting", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if ((currentVisionMode _player != 1)) exitWith {false};
if ((currentVisionMode ACE_player != 1)) exitWith {false};
// Statement
[ACE_player, 1] call FUNC(changeNVGBrightness);
@ -56,7 +56,7 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0;
// Conditions: canInteract
if !([ACE_player, objNull, ["isNotEscorting", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if ((currentVisionMode _player != 1)) exitWith {false};
if ((currentVisionMode ACE_player != 1)) exitWith {false};
// Statement
[ACE_player, -1] call FUNC(changeNVGBrightness);

View File

@ -15,7 +15,7 @@
*/
#include "script_component.hpp"
private ["_currentVehicle", "_grainSetting", "_blurSetting", "_radBlurSetting", "_config"];
private ["_currentVehicle", "_grainSetting", "_blurSetting", "_radBlurSetting", "_config", "_hmd", "_cameraView", "_turret"];
_currentVehicle = vehicle ACE_player;
@ -41,7 +41,7 @@ _fnc_isUsingHMD = {
!("NVG" in getArray (_config >> "ViewOptics" >> "visionMode"));
};
private ["_result", "_turretConfig", "_turretConfigOpticsIn"];
private ["_result", "_turretConfig", "_turretConfigOpticsIn", "_index"];
_result = true;
_turretConfig = [_config, _turret] call EFUNC(common,getTurretConfigPath);
_turretConfigOpticsIn = _turretConfig >> "OpticsIn";

View File

@ -2,15 +2,13 @@
#include "script_component.hpp"
/*
_setupPlayer = {
[{
if (!isNull ACE_player) then {
[(_this select 1)] call cba_fnc_removePerFrameHandler;
[ACE_player, "isPlayer"] call EFUNC(common,muteUnit);
};
};
[_setupPlayer, 0, []] call CBA_fnc_addPerFrameHandler;
}, 0, []] call CBA_fnc_addPerFrameHandler;
*/
if (!hasInterface) exitWith {};

View File

@ -17,12 +17,10 @@
#include "script_component.hpp"
private ["_unit", "_sides"];
_unit = _this select 0;
_sides = _this select 1;
PARAMS_2(_unit,_sides);
["theMapClick", "onMapSingleClick", {
// IGNORE_PRIVATE_WARNING(_pos,_shift,_alt)
if (alive ACE_player && {GVAR(OriginalUnit) getVariable ["ACE_CanSwitchUnits", false]}) then {
[_this, _pos, _shift, _alt] call FUNC(handleMapClick);
};

View File

@ -10,7 +10,7 @@
* None
*
* Example:
* [_unit, _sides] call FUNC(handleMapClick)
* [unit, _sides] call FUNC(handleMapClick)
*
* Public: No
*/

View File

@ -10,7 +10,7 @@
* None
*
* Example:
* [_player, _sides] call FUNC(initPlayer)
* [player, [west]] call FUNC(initPlayer)
*
* Public: No
*/
@ -19,8 +19,7 @@
private ["_playerUnit", "_sides"];
_playerUnit = _this select 0;
_sides = _this select 1;
PARAMS_2(_playerUnit,_sides);
if (vehicle _playerUnit == _playerUnit) then {

View File

@ -10,14 +10,15 @@
* Player units <ARRAY<OBJECT>>
*
* Example:
* [_pos, 100] call FUNC(nearestPlayers)
* [[300,300,0], 100] call FUNC(nearestPlayers)
*
* Public: Yes
*/
#include "script_component.hpp"
private ["_position", "_radius", "_nearestPlayers"];
private ["_nearestPlayers"];
PARAMS_2(_position,_radius);
_position = _this select 0;
_radius = _this select 1;
@ -25,9 +26,9 @@ _radius = _this select 1;
_nearestPlayers = [];
{
if ([_x] call EFUNC(common,isPlayer) && {alive _x}) then {
_nearestPlayers pushBack _x;
};
if ([_x] call EFUNC(common,isPlayer) && {alive _x}) then {
_nearestPlayers pushBack _x;
};
} forEach (nearestObjects [_position, ["Man"], _radius]);
_nearestPlayers
_nearestPlayers

View File

@ -10,26 +10,20 @@
* None
*
* Example:
* [_origPlayer, _respPlayer] call FUNC(switchBack)
* [_originalPlayerUnit, _currentUnit] call FUNC(switchBack)
*
* Public: Yes
*/
#include "script_component.hpp"
private ["_origPlayerUnit"];
PARMAS_1(_originalPlayerUnit);
_origPlayerUnit = _this select 0;
[_origPlayerUnit] joinSilent GVAR(OriginalGroup);
[_originalPlayerUnit] joinSilent GVAR(OriginalGroup);
DFUNC(pfhSwitchBack) = {
private ["_args", "_originalPlayerUnit", "_currentUnit"];
_args = _this select 0;
_originalPlayerUnit = _args select 0;
_currentUnit = _args select 1;
PARAMS_2(_args,_pfID);
EXPLODE_2_PVT(_args,_originalPlayerUnit,_currentUnit);
if (local _originalPlayerUnit) exitWith {
selectPlayer _originalPlayerUnit;

View File

@ -18,9 +18,9 @@
#include "script_component.hpp"
private ["_unit", "_allNearestPlayers", "_oldUnit", "_leave"];
private ["_nearestEnemyPlayers", "_allNearestPlayers", "_oldUnit", "_leave"];
_unit = _this select 1;
PARAMS_1(_unit);
// don't switch to original player units
if (!([_unit] call FUNC(isValidAi))) exitWith {};

View File

@ -37,6 +37,7 @@ if (!isServer) exitWith {};
};
{
private "_unit";
_unit = _x;
if (_unit isKindOf "CAManBase") then {
{

View File

@ -21,6 +21,7 @@ PARAMS_2(_unit,_container);
//Only check for player:
if (_unit != ace_player) exitWith {false};
private "_handeled";
_handeled = false;
if (GVAR(LockVehicleInventory) && //if setting not enabled

View File

@ -26,6 +26,7 @@ GVAR(CurrentGrenadeMuzzleOther) = "";
// Collect frag and other muzzles separately
with uiNamespace do {
private ["_magazines", "_magazine", "_ammo", "_explosive"];
if (isNil QGVAR(FragMuzzles)) then {
GVAR(FragMuzzles) = [];
GVAR(NonFragMuzzles) = [];

View File

@ -12,18 +12,13 @@
*/
#include "script_component.hpp"
private ["_unit", "_muzzle"];
PARAMS_2(_unit,_muzzle);
_unit = _this select 0;
_muzzle = _this select 1;
private ["_uniformMags", "_vestMags", "_backPackMags"];
private ["_uniformMags", "_vestMags", "_backpackMags", "_numberOfMagazines", "_magazineClasses", "_firstMagazine"];
_uniformMags = getMagazineCargo uniformContainer _unit;
_vestMags = getMagazineCargo vestContainer _unit;
_backPackMags = getMagazineCargo backpackContainer _unit;
private ["_numberOfMagazines", "_magazineClasses", "_firstMagazine"];
_backpackMags = getMagazineCargo backpackContainer _unit;
_numberOfMagazines = 0;
_magazineClasses = getArray (configFile >> "CfgWeapons" >> "Throw" >> _muzzle >> "magazines");

View File

@ -21,10 +21,10 @@ _numberofMagazines = _this select 1;
private ["_color", "_name", "_text", "_picture"];
_color = [[1,0,0], [1,1,1]] select (_numberOfMagazines > 0);
_color = [[1,0,0], [1,1,1]] select (_numberofMagazines > 0);
_name = getText (configFile >> "CfgMagazines" >> _magazine >> "displayNameShort");
_text = [format["%1 x%2", _name, _numberOfMagazines], _color] call EFUNC(common,stringToColoredText);
_text = [format["%1 x%2", _name, _numberofMagazines], _color] call EFUNC(common,stringToColoredText);
_picture = getText (configFile >> "CfgMagazines" >> _magazine >> "picture");
[_text, _picture] call EFUNC(common,displayTextPicture);

View File

@ -11,41 +11,41 @@
*/
#include "script_component.hpp"
private ["_unit", "_nextMuzzle"];
private ["_text", "_nextMuzzle"];
_unit = _this select 0;
PARAMS_1(_unit);
_nextMuzzle = ["All"] call FUNC(findNextGrenadeMuzzle);
if (_nextMuzzle != "") then {
private ["_magazines", "_magazine", "_count", "_return"];
_magazines = GVAR(AllMagazines) select (GVAR(AllMuzzles) find _nextMuzzle);
reverse _magazines;
private ["_magazines", "_magazine", "_count", "_return"];
_magazines = GVAR(AllMagazines) select (GVAR(AllMuzzles) find _nextMuzzle);
reverse _magazines;
_magazine = "";
_count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit;
_magazine = "";
_count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit;
// There is a muzzle with magazines --> cycle to it
[_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle);
// There is a muzzle with magazines --> cycle to it
[_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle);
[_magazine, _count] call FUNC(displayGrenadeTypeAndNumber);
[_magazine, _count] call FUNC(displayGrenadeTypeAndNumber);
} else {
// There is a no muzzle with magazines --> select nothing
GVAR(CurrentGrenadeMuzzleFrag) = ""; GVAR(CurrentGrenadeMuzzleOther) = "";
// There is a no muzzle with magazines --> select nothing
GVAR(CurrentGrenadeMuzzleFrag) = ""; GVAR(CurrentGrenadeMuzzleOther) = "";
if (GVAR(DisplayText)) then {
_text = [localize "STR_ACE_WeaponSelect_NoGrenadesLeft", [1,0,0]] call EFUNC(common,stringToColoredText);
[composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured);
};
if (GVAR(DisplayText)) then {
_text = [localize "STR_ACE_WeaponSelect_NoGrenadesLeft", [1,0,0]] call EFUNC(common,stringToColoredText);
[composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured);
};
};
if (_nextMuzzle in GVAR(FragMuzzles)) then {
GVAR(CurrentGrenadeMuzzleFrag) = _nextMuzzle;
GVAR(CurrentGrenadeMuzzleIsFrag) = true;
GVAR(CurrentGrenadeMuzzleFrag) = _nextMuzzle;
GVAR(CurrentGrenadeMuzzleIsFrag) = true;
} else {
GVAR(CurrentGrenadeMuzzleOther) = _nextMuzzle;
GVAR(CurrentGrenadeMuzzleIsFrag) = false;
GVAR(CurrentGrenadeMuzzleOther) = _nextMuzzle;
GVAR(CurrentGrenadeMuzzleIsFrag) = false;
};

View File

@ -11,34 +11,34 @@
*/
#include "script_component.hpp"
private ["_unit", "_nextMuzzle"];
private ["_text", "_nextMuzzle"];
_unit = _this select 0;
PARAMS_1(_unit);
_nextMuzzle = ["Frag"] call FUNC(findNextGrenadeMuzzle);
if (_nextMuzzle != "") then {
GVAR(CurrentGrenadeMuzzleFrag) = _nextMuzzle;
GVAR(CurrentGrenadeMuzzleFrag) = _nextMuzzle;
private ["_magazines", "_magazine", "_count", "_return"];
_magazines = GVAR(FragMagazines) select (GVAR(FragMuzzles) find _nextMuzzle);
reverse _magazines;
private ["_magazines", "_magazine", "_count", "_return"];
_magazines = GVAR(FragMagazines) select (GVAR(FragMuzzles) find _nextMuzzle);
reverse _magazines;
_magazine = "";
_count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit;
_magazine = "";
_count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit;
// There is a muzzle with magazines --> cycle to it
[_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle);
// There is a muzzle with magazines --> cycle to it
[_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle);
[_magazine, _count] call FUNC(displayGrenadeTypeAndNumber);
[_magazine, _count] call FUNC(displayGrenadeTypeAndNumber);
} else {
// There is a no muzzle with magazines --> select nothing
GVAR(CurrentGrenadeMuzzleFrag) = "";
if (GVAR(DisplayText)) then {
_text = [localize "STR_ACE_WeaponSelect_NoFragsLeft", [1,0,0]] call EFUNC(common,stringToColoredText);
[composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured);
};
// There is a no muzzle with magazines --> select nothing
GVAR(CurrentGrenadeMuzzleFrag) = "";
if (GVAR(DisplayText)) then {
_text = [localize "STR_ACE_WeaponSelect_NoFragsLeft", [1,0,0]] call EFUNC(common,stringToColoredText);
[composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured);
};
};
GVAR(CurrentGrenadeMuzzleIsFrag) = true;

View File

@ -11,34 +11,34 @@
*/
#include "script_component.hpp"
private ["_unit", "_nextMuzzle"];
private ["_nextMuzzle", "_text"];
_unit = _this select 0;
PARAMS_1(_unit);
_nextMuzzle = ["NonFrag"] call FUNC(findNextGrenadeMuzzle);
if (_nextMuzzle != "") then {
GVAR(CurrentGrenadeMuzzleOther) = _nextMuzzle;
GVAR(CurrentGrenadeMuzzleOther) = _nextMuzzle;
private ["_magazines", "_magazine", "_count", "_return"];
_magazines = GVAR(NonFragMagazines) select (GVAR(NonFragMuzzles) find _nextMuzzle);
reverse _magazines;
private ["_magazines", "_magazine", "_count", "_return"];
_magazines = GVAR(NonFragMagazines) select (GVAR(NonFragMuzzles) find _nextMuzzle);
reverse _magazines;
_magazine = "";
_count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit;
_magazine = "";
_count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit;
// There is a muzzle with magazines --> cycle to it
[_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle);
// There is a muzzle with magazines --> cycle to it
[_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle);
[_magazine, _count] call FUNC(displayGrenadeTypeAndNumber);
[_magazine, _count] call FUNC(displayGrenadeTypeAndNumber);
} else {
// There is a no muzzle with magazines --> select nothing
GVAR(CurrentGrenadeMuzzleOther) = "";
if (GVAR(DisplayText)) then {
_text = [localize "STR_ACE_WeaponSelect_NoMiscGrenadeLeft", [1,0,0]] call EFUNC(common,stringToColoredText);
[composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured);
};
// There is a no muzzle with magazines --> select nothing
GVAR(CurrentGrenadeMuzzleOther) = "";
if (GVAR(DisplayText)) then {
_text = [localize "STR_ACE_WeaponSelect_NoMiscGrenadeLeft", [1,0,0]] call EFUNC(common,stringToColoredText);
[composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured);
};
};
GVAR(CurrentGrenadeMuzzleIsFrag) = false;

View File

@ -17,19 +17,15 @@ private ["_unit", "_muzzle"];
_unit = _this select 0;
_muzzle = _this select 1;
private ["_uniformMags", "_vestMags", "_backPackMags"];
private ["_uniformMags", "_vestMags", "_backpackMags", "_i", "_uniformMagsToRemove", "_vestMagsToRemove", "_backpackMagsToRemove", "_firstMagazine", "_throwMuzzleNames"];
_uniformMags = getMagazineCargo uniformContainer _unit;
_vestMags = getMagazineCargo vestContainer _unit;
_backPackMags = getMagazineCargo backpackContainer _unit;
private ["_uniformMagsToRemove", "_vestMagsToRemove", "_backPackMagsToRemove"];
_backpackMags = getMagazineCargo backpackContainer _unit;
_uniformMagsToRemove = [];
_vestMagsToRemove = [];
_backPackMagsToRemove = [];
private ["_firstMagazine", "_throwMuzzleNames"];
_backpackMagsToRemove = [];
_firstMagazine = "";
_throwMuzzleNames = getArray (configfile >> "CfgWeapons" >> "Throw" >> "muzzles");
@ -99,7 +95,7 @@ _throwMuzzleNames = getArray (configfile >> "CfgWeapons" >> "Throw" >> "muzzles"
for [{_i = 0}, {_i < (_x select 1)}, {_i = _i + 1}] do {
_unit removeItem (_x select 0);
};
} forEach _backPackMagsToRemove;
} forEach _backpackMagsToRemove;
// Readd magazines
{
@ -118,4 +114,4 @@ _throwMuzzleNames = getArray (configfile >> "CfgWeapons" >> "Throw" >> "muzzles"
for [{_i = 0}, {_i < (_x select 1)}, {_i = _i + 1}] do {
_unit addItemToBackpack (_x select 0);
};
} forEach _backPackMagsToRemove;
} forEach _backpackMagsToRemove;

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/env python3
import fnmatch
import os
@ -21,7 +21,7 @@ def get_private_declare(content):
priv_split = sorted(set(priv_split))
priv_declared += priv_split;
srch = re.compile('PARAMS_[0-9].*|EXPLODE_[0-9]_PVT.*|DEFAULT_PARAM.*|KEY_PARAM.*')
srch = re.compile('PARAMS_[0-9].*|EXPLODE_[0-9]_PVT.*|DEFAULT_PARAM.*|KEY_PARAM.*|IGNORE_PRIVATE_WARNING.*')
priv_srch_declared = srch.findall(content)
priv_srch_declared = sorted(set(priv_srch_declared))
@ -37,7 +37,7 @@ def get_private_declare(content):
return priv_declared
def check_privates(filepath):
bad_count_file = 0
def pushClosing(t):
closingStack.append(closing.expr)
closing << Literal( closingFor[t[0]] )
@ -81,6 +81,9 @@ def check_privates(filepath):
print (filepath)
for bad_priv in missing:
print ('\t' + bad_priv)
bad_count_file = bad_count_file + 1
return bad_count_file
def main():
@ -89,6 +92,7 @@ def main():
print("#########################")
sqf_list = []
bad_count = 0
parser = argparse.ArgumentParser()
parser.add_argument('-m','--module', help='only search specified module addon folder', required=False, default=".")
@ -99,7 +103,10 @@ def main():
sqf_list.append(os.path.join(root, filename))
for filename in sqf_list:
check_privates(filename)
bad_count = bad_count + check_privates(filename)
print ("Bad Count {0}".format(bad_count))
if __name__ == "__main__":
main()