Minor fixes

This commit is contained in:
johnb432 2024-07-26 17:41:41 +02:00
parent 179d713473
commit 757710b002
4 changed files with 16 additions and 19 deletions

View File

@ -1,10 +1,10 @@
#include "..\script_component.hpp"
/*
* Author: tcvm
* Checks if the unit can deploy a tripod
* Checks if the player can deploy the tripod.
*
* Arguments:
* 0: Unit <OBJECT>
* 0: Player <OBJECT>
*
* Return Value:
* Can deploy <BOOL>
@ -15,8 +15,8 @@
* Public: No
*/
params ["_unit"];
params ["_player"];
private _secondaryWeapon = secondaryWeapon _unit;
private _secondaryWeapon = secondaryWeapon _player;
_secondaryWeapon != "" && {getText (configFile >> "CfgWeapons" >> _secondaryWeapon >> QUOTE(ADDON) >> "type") == "mount"} // return

View File

@ -1,17 +1,16 @@
#include "..\script_component.hpp"
/*
* Author: tcvm
* Checks if the unit can pickup the tripod
* Checks if the player can pickup the tripod.
*
* Arguments:
* 0: Tripod <OBJECT>
* 1: Unit (not used) <OBJECT>
*
* Return Value:
* Can pickup <BOOL>
*
* Example:
* [cursorObject, player] call ace_csw_fnc_canPickupTripod
* cursorObject call ace_csw_fnc_canPickupTripod
*
* Public: No
*/

View File

@ -22,11 +22,7 @@ private _statement = {
_args params ["_vehMag", "_turretPath", "_carryMag"];
TRACE_5("starting unload",_target,_turretPath,_player,_carryMag,_vehMag);
private _timeToUnload = 1;
private _config = configOf _target >> QUOTE(ADDON) >> "ammoUnloadTime";
if (!isNull _config) then {
_timeToUnload = getNumber _config;
};
private _timeToUnload = GET_NUMBER(configOf _target >> QUOTE(ADDON) >> "ammoUnloadTime",1);
[
TIME_PROGRESSBAR(_timeToUnload),
@ -37,7 +33,7 @@ private _statement = {
[QGVAR(removeTurretMag), [_target, _turretPath, _carryMag, _vehMag, _player]] call CBA_fnc_globalEvent;
},
{TRACE_1("unload progressBar fail",_this);},
format [LLSTRING(unloadX), getText (configFile >> "CfgMagazines" >> _carryMag >> "displayName")],
format [LLSTRING(actionUnload), getText (configFile >> "CfgMagazines" >> _carryMag >> "displayName")],
{(_this select 0) call FUNC(reload_canUnloadMagazine)},
["isNotInside"]
] call EFUNC(common,progressBar);
@ -46,7 +42,9 @@ private _statement = {
private _condition = {
params ["_target", "_player", "_args"];
_args params ["_vehMag", "_turretPath", "_carryMag"];
[_target, _turretPath, _player, _carryMag, _vehMag] call FUNC(reload_canUnloadMagazine)
[_player, _target] call EFUNC(interaction,canInteractWithVehicleCrew) &&
{[_target, _turretPath, _player, _carryMag, _vehMag] call FUNC(reload_canUnloadMagazine)}
};
private _actions = [];
@ -64,7 +62,7 @@ private _cfgMagazines = configFile >> "CfgMagazines";
if (_carryMag == "") exitWith {};
private _displayName = getText (_cfgMagazines >> _carryMag >> "displayName");
private _text = format [LLSTRING(unloadX), _displayName];
private _text = format [LLSTRING(actionUnload), _displayName];
private _picture = getText (_cfgMagazines >> _carryMag >> "picture");
private _action = [format ["unload_%1", _forEachIndex], _text, _picture, _statement, _condition, {}, [_xMag, _xTurret, _carryMag]] call EFUNC(interact_menu,createAction);
_actions pushBack [_action, [], _vehicle];

View File

@ -1,7 +1,7 @@
#include "..\script_component.hpp"
/*
* Author: tcvm
* Initializes CSW systems on vehicle
* Initializes CSW systems on vehicle.
*
* Arguments:
* 0: Vehicle <OBJECT>
@ -78,7 +78,7 @@ if (hasInterface && {!(_typeOf in GVAR(initializedStaticTypes))}) then {
if ((GVAR(ammoHandling) == 0) && {!([false, true, true, GVAR(defaultAssemblyMode)] select (_target getVariable [QGVAR(assemblyMode), 3]))}) exitWith { false };
[_player, _target, ["isNotSwimming", "isNotSitting"]] call EFUNC(common,canInteractWith)
};
private _childenCode = {
private _childrenCode = {
BEGIN_COUNTER(getActions); // can remove for final release
private _ret = (call FUNC(getLoadActions)) + (call FUNC(getUnloadActions));
END_COUNTER(getActions);
@ -86,10 +86,10 @@ if (hasInterface && {!(_typeOf in GVAR(initializedStaticTypes))}) then {
};
if (_configEnabled && {_magazineLocation != ""}) then {
private _positionCode = compile _magazineLocation;
private _ammoAction = [QGVAR(magazine), LLSTRING(AmmoHandling_displayName), "", {}, _condition, _childenCode, [], _positionCode, 4] call EFUNC(interact_menu,createAction);
private _ammoAction = [QGVAR(magazine), LLSTRING(AmmoHandling_displayName), "", {}, _condition, _childrenCode, [], _positionCode, 4] call EFUNC(interact_menu,createAction);
_ammoActionPath = [_typeOf, 0, [], _ammoAction] call EFUNC(interact_menu,addActionToClass);
} else {
private _ammoAction = [QGVAR(magazine), LLSTRING(AmmoHandling_displayName), "", {}, _condition, _childenCode] call EFUNC(interact_menu,createAction);
private _ammoAction = [QGVAR(magazine), LLSTRING(AmmoHandling_displayName), "", {}, _condition, _childrenCode] call EFUNC(interact_menu,createAction);
_ammoActionPath = [_typeOf, 0, ["ACE_MainActions"], _ammoAction] call EFUNC(interact_menu,addActionToClass);
};