Sync main repo

This commit is contained in:
lambdatiger 2024-02-08 17:19:54 -06:00
commit 49c6187c17
457 changed files with 4205 additions and 2224 deletions

1
.gitignore vendored
View File

@ -20,3 +20,4 @@ CHANGELOG.md
sqfvm.exe
ArmaScriptCompiler.exe
*.sqfc
!extras/**/*.zip

View File

@ -126,6 +126,7 @@ Keithen <Keithen.Neu@gmail.com>
Kllrt <kllrtik@gmail.com>
KokaKolaA3
Krzyciu
LAxemann
legman <juicemelon@msn.com>
Legolasindar "Viper" <legolasindar@gmail.com>
licht-im-Norden87 <lichtimnorden87@gmail.com>
@ -190,3 +191,4 @@ YetheSamartaka
xrufix
Zakant <Zakant@gmx.de>
zGuba
Zman6258

View File

@ -5,7 +5,7 @@
<p align="center">
<a href="https://github.com/acemod/ACE3/releases/latest">
<img src="https://img.shields.io/badge/Version-3.16.1-blue.svg?style=flat-square" alt="ACE3 Version">
<img src="https://img.shields.io/badge/Version-3.16.3-blue.svg?style=flat-square" alt="ACE3 Version">
</a>
<a href="https://github.com/acemod/ACE3/issues">
<img src="https://img.shields.io/github/issues-raw/acemod/ACE3.svg?style=flat-square&label=Issues" alt="ACE3 Issues">

View File

@ -17,7 +17,7 @@
*/
//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"];
TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret);
TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret);
if (!(_ammo isKindOf "BulletBase")) exitWith {};
if (!alive _projectile) exitWith {};

View File

@ -22,7 +22,7 @@ private _initStartTime = diag_tickTime;
private _mapSize = worldSize;
if (("ace_advanced_ballistics" callExtension format["init:%1:%2", worldName, _mapSize]) == "Terrain already initialized") exitWith {
INFO_1("Terrain already initialized [world: %1]", worldName);
INFO_1("Terrain already initialized [world: %1]",worldName);
#ifdef DEBUG_MODE_FULL
systemChat "AdvancedBallistics: Terrain already initialized";
#endif
@ -33,14 +33,14 @@ private _gridCells = _mapGrids * _mapGrids;
GVAR(currentGrid) = 0;
INFO_2("Starting Terrain Extension [cells: %1] [world: %2]", _gridCells, worldName);
INFO_2("Starting Terrain Extension [cells: %1] [world: %2]",_gridCells,worldName);
[{
params ["_args","_idPFH"];
_args params ["_mapGrids", "_gridCells", "_initStartTime"];
if (GVAR(currentGrid) >= _gridCells) exitWith {
INFO_2("Finished terrain initialization in %1 seconds [world: %2]", (diag_tickTime - _initStartTime) toFixed 2, worldName);
INFO_2("Finished terrain initialization in %1 seconds [world: %2]",(diag_tickTime - _initStartTime) toFixed 2,worldName);
#ifdef DEBUG_MODE_FULL
systemChat format["AdvancedBallistics: Finished terrain initialization in %1 seconds", (diag_tickTime - _initStartTime) toFixed 2];
#endif
@ -53,7 +53,7 @@ INFO_2("Starting Terrain Extension [cells: %1] [world: %2]", _gridCells, worldNa
private _gridCenter = [_x + 25, _y + 25];
private _gridHeight = round(getTerrainHeightASL _gridCenter);
private _gridNumObjects = count (_gridCenter nearObjects ["Building", 50]);
private _gridSurfaceIsWater = if (surfaceIsWater _gridCenter) then {1} else {0};
private _gridSurfaceIsWater = parseNumber (surfaceIsWater _gridCenter);
"ace_advanced_ballistics" callExtension format["set:%1:%2:%3", _gridHeight, _gridNumObjects, _gridSurfaceIsWater];
GVAR(currentGrid) = GVAR(currentGrid) + 1;
if (GVAR(currentGrid) >= _gridCells) exitWith {};

View File

@ -66,7 +66,7 @@ if ((_typicalSpeed > 0) && {_typicalSpeed < 360}) then {
if (_inheritedBarrelConfig || _inheritedTempConfig) then {
private _parentConfig = inheritsFrom _ammoConfig;
private _parentSpeed = getNumber (_parentConfig >> "typicalSpeed");
WARNING_4("Subsonic Ammo %1 (%2 m/s) missing `ACE_muzzleVelocities` or `ACE_ammoTempMuzzleVelocityShifts` configs, attempting to use parent %3 (%4m/s)",_this,_typicalSpeed,configName _parentConfig, _parentSpeed);
WARNING_4("Subsonic Ammo %1 (%2 m/s) missing `ACE_muzzleVelocities` or `ACE_ammoTempMuzzleVelocityShifts` configs, attempting to use parent %3 (%4m/s)",_this,_typicalSpeed,configName _parentConfig,_parentSpeed);
if (_parentSpeed <= 0) exitWith {//Handle weird or null parent
_muzzleVelocityTable = [];
_ammoTempMuzzleVelocityShifts = [];

View File

@ -21,7 +21,7 @@
private _weaponConfig = (configFile >> "CfgWeapons" >> _this);
private _barrelTwist = 0 max getNumber(_weaponConfig >> "ACE_barrelTwist");
private _twistDirection = [0, 1] select (_barrelTwist != 0);
private _twistDirection = parseNumber (_barrelTwist != 0);
if (isNumber (_weaponConfig >> "ACE_twistDirection")) then {
_twistDirection = getNumber (_weaponConfig >> "ACE_twistDirection");
if !(_twistDirection in [-1, 0, 1]) then {

View File

@ -60,7 +60,7 @@ if (!hasInterface) exitWith {};
}, true] call CBA_fnc_addPlayerEventHandler;
// - Duty factors -------------------------------------------------------------
if (["ace_medical"] call EFUNC(common,isModLoaded)) then {
if (GVAR(medicalLoaded)) then {
[QEGVAR(medical,pain), { // 0->1.0, 0.5->1.05, 1->1.1
linearConversion [0, 1, (_this getVariable [QEGVAR(medical,pain), 0]), 1, 1.1, true];
}] call FUNC(addDutyFactor);

View File

@ -13,5 +13,6 @@ GVAR(dutyList) = createHashMap;
GVAR(setAnimExclusions) = [];
GVAR(inertia) = 0;
GVAR(inertiaCache) = createHashMap;
GVAR(medicalLoaded) = ["ace_medical"] call EFUNC(common,isModLoaded);
ADDON = true;

View File

@ -23,6 +23,12 @@ if (!alive ACE_player) exitWith {
_staminaBarContainer ctrlCommit 1;
};
private _oxygen = 0.9; // Default AF oxygen saturation
if (GVAR(medicalLoaded) && {EGVAR(medical_vitals,simulateSpo2)}) then {
_oxygen = (ACE_player getVariable [QEGVAR(medical,spo2), 97]) / 100;
};
private _currentWork = REE;
private _currentSpeed = (vectorMagnitude (velocity ACE_player)) min 6;
@ -42,8 +48,8 @@ GVAR(muscleDamage) = (GVAR(muscleDamage) + (_currentWork / GVAR(peakPower)) ^ 3.
private _muscleIntegritySqrt = sqrt (1 - GVAR(muscleDamage));
// Calculate available power
private _ae1PathwayPowerFatigued = GVAR(ae1PathwayPower) * sqrt (GVAR(ae1Reserve) / AE1_MAXRESERVE) * OXYGEN * _muscleIntegritySqrt;
private _ae2PathwayPowerFatigued = GVAR(ae2PathwayPower) * sqrt (GVAR(ae2Reserve) / AE2_MAXRESERVE) * OXYGEN * _muscleIntegritySqrt;
private _ae1PathwayPowerFatigued = GVAR(ae1PathwayPower) * sqrt (GVAR(ae1Reserve) / AE1_MAXRESERVE) * _oxygen * _muscleIntegritySqrt;
private _ae2PathwayPowerFatigued = GVAR(ae2PathwayPower) * sqrt (GVAR(ae2Reserve) / AE2_MAXRESERVE) * _oxygen * _muscleIntegritySqrt;
// Calculate how much power is consumed from each reserve
private _ae1Power = _currentWork min _ae1PathwayPowerFatigued;
@ -58,8 +64,8 @@ GVAR(anReserve) = GVAR(anReserve) - _anPower / WATTSPERATP;
GVAR(anFatigue) = GVAR(anFatigue) + _anPower * (0.057 / GVAR(peakPower)) * 1.1;
// Aerobic ATP reserve recovery
GVAR(ae1Reserve) = ((GVAR(ae1Reserve) + OXYGEN * 6.60 * (GVAR(ae1PathwayPower) - _ae1Power) / GVAR(ae1PathwayPower) * GVAR(recoveryFactor)) min AE1_MAXRESERVE) max 0;
GVAR(ae2Reserve) = ((GVAR(ae2Reserve) + OXYGEN * 5.83 * (GVAR(ae2PathwayPower) - _ae2Power) / GVAR(ae2PathwayPower) * GVAR(recoveryFactor)) min AE2_MAXRESERVE) max 0;
GVAR(ae1Reserve) = ((GVAR(ae1Reserve) + _oxygen * 6.60 * (GVAR(ae1PathwayPower) - _ae1Power) / GVAR(ae1PathwayPower) * GVAR(recoveryFactor)) min AE1_MAXRESERVE) max 0;
GVAR(ae2Reserve) = ((GVAR(ae2Reserve) + _oxygen * 5.83 * (GVAR(ae2PathwayPower) - _ae2Power) / GVAR(ae2PathwayPower) * GVAR(recoveryFactor)) min AE2_MAXRESERVE) max 0;
// Anaerobic ATP reserver and fatigue recovery
GVAR(anReserve) = ((GVAR(anReserve)
@ -70,9 +76,9 @@ GVAR(anFatigue) = ((GVAR(anFatigue)
- (_ae1PathwayPowerFatigued + _ae2PathwayPowerFatigued - _ae1Power - _ae2Power) * (0.057 / GVAR(peakPower)) * GVAR(anFatigue) ^ 2 * GVAR(recoveryFactor)
) min 1) max 0;
private _aeReservePercentage = (GVAR(ae1Reserve) / AE1_MAXRESERVE + GVAR(ae2Reserve) / AE2_MAXRESERVE) / 2;
private _anReservePercentage = GVAR(anReserve) / AN_MAXRESERVE;
private _perceivedFatigue = 1 - (_anReservePercentage min _aeReservePercentage);
GVAR(aeReservePercentage) = (GVAR(ae1Reserve) / AE1_MAXRESERVE + GVAR(ae2Reserve) / AE2_MAXRESERVE) / 2;
GVAR(anReservePercentage) = GVAR(anReserve) / AN_MAXRESERVE;
private _perceivedFatigue = 1 - (GVAR(anReservePercentage) min GVAR(aeReservePercentage));
[ACE_player, _perceivedFatigue, _currentSpeed, GVAR(anReserve) == 0] call FUNC(handleEffects);

View File

@ -7,8 +7,8 @@
* 0: The building(s) nearest this position are used <POSITION>
* 1: Limit the building search to those type of building <ARRAY>
* 2: Units that will be garrisoned <ARRAY>
* 3: Radius to fill building(s) <SCALAR> (default: 50)
* 4: 0: even filling, 1: building by building, 2: random filling <SCALAR> (default: 0)
* 3: Radius to fill building(s) <NUMBER> (default: 50)
* 4: 0: even filling, 1: building by building, 2: random filling <NUMBER> (default: 0)
* 5: True to fill building(s) from top to bottom <BOOL> (default: false) (note: only works with filling mode 0 and 1)
* 6: Teleport units <BOOL> (default: false)
@ -128,7 +128,7 @@ switch (_fillingType) do {
} else {
private _pos = _building select 0;
private _nearestUnits = (_pos nearEntities ["CAManBase", 2]);
LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits, {floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]);
LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits,{floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]);
if (count _nearestUnits > 0 && {[_nearestUnits, _pos] call _fnc_comparePos}) then {
LOG(format [ARR_2("fnc_garrison: Unit present | removing position | %1 positions remaining for this building",count (_buildingsIndex select (_buildingsIndex find _building)) - 1)]);
@ -177,7 +177,7 @@ switch (_fillingType) do {
} else {
private _pos = _building select 0;
private _nearestUnits = (_pos nearEntities ["CAManBase", 2]);
LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits, {floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]);
LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits,{floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]);
if (count _nearestUnits > 0 && {[_nearestUnits, _pos] call _fnc_comparePos}) then {
LOG(format [ARR_2("fnc_garrison: Unit present | removing position | %1 positions remaining for this building",count (_buildingsIndex select (_buildingsIndex find _building)) - 1)]);
@ -224,7 +224,7 @@ switch (_fillingType) do {
} else {
private _pos = selectRandom _building;
private _nearestUnits = (_pos nearEntities ["CAManBase", 2]);
LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits, {floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]);
LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits,{floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]);
if (count _nearestUnits > 0 && {[_nearestUnits, _pos] call _fnc_comparePos}) then {
LOG(format [ARR_2("fnc_garrison: Unit present | removing position | %1 positions remaining for this building",count (_buildingsIndex select (_buildingsIndex find _building)) - 1)]);
@ -258,7 +258,7 @@ switch (_fillingType) do {
};
};
TRACE_1(format [ARR_2("fnc_garrison: while loop ended | %1 units ready to be treated by PFH",count _unitMoveList)], _teleport);
TRACE_1(format [ARR_2("fnc_garrison: while loop ended | %1 units ready to be treated by PFH",count _unitMoveList)],_teleport);
// Update the unit list and remove duplicate positions and units
private _garrison_unitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []];
@ -279,5 +279,5 @@ if (_teleport) then {
[_unitMoveList] call FUNC(garrisonMove);
};
TRACE_1(format [ARR_3("fnc_garrison: End | %1 units left | %2 buildings left", count _unitsArray, count _buildingsIndex)], _unitsArray);
TRACE_1(format [ARR_3("fnc_garrison: End | %1 units left | %2 buildings left",count _unitsArray,count _buildingsIndex)],_unitsArray);
_unitsArray

View File

@ -81,13 +81,13 @@ if (isNil QGVAR(garrison_moveUnitPFH)) then {
[QGVAR(enableAttack), [[_unit], true], _unit] call CBA_fnc_targetEvent;
};
LOG(format [ARR_2("garrisonMove PFH: unit in position | %1 units left", count _unitMoveList)]);
LOG(format [ARR_2("garrisonMove PFH: unit in position | %1 units left",count _unitMoveList)]);
};
// Check if unit is alive or even existing
if (!alive _unit || {_unit getVariable [QGVAR(garrisoned), false]}) then {
_unitMoveList deleteAt (_unitMoveList find _x);
LOG(format [ARR_2("garrisonMove PFH: unit dead, deleted or garrisoned via TP | %1 units left", count _unitMoveList)]);
LOG(format [ARR_2("garrisonMove PFH: unit dead, deleted or garrisoned via TP | %1 units left",count _unitMoveList)]);
} else {
private _unitPos = getPos _unit;

View File

@ -28,7 +28,7 @@ _units = _units select {local _x};
private _leader = leader _unit;
TRACE_3("fnc_ungarrison: unit and leader",_unit , _leader, (_leader == _unit));
TRACE_3("fnc_ungarrison: unit and leader",_unit,_leader,(_leader == _unit));
_unit setVariable [QGVAR(garrisonned), false, true];

View File

@ -29,7 +29,10 @@ private _currentLoiterRadius = waypointLoiterRadius _waypoint;
private _currentLoiterType = waypointLoiterType _waypoint;
// Set pos to ATL
_pos set [2, if (_currentHeight >= 50) then { _currentHeight } else { 0 }];
_pos set [
2,
[0, _currentHeight] select (_currentHeight >= 50)
];
// [_group] call CBA_fnc_clearWaypoints;
_waypoint = _group addWaypoint [_pos, 0];

View File

@ -29,7 +29,7 @@
<Russian>Открыть грузовой отсек</Russian>
<Italian>Apri la rampa di carico</Italian>
<Portuguese>Abrir porta de carga</Portuguese>
<Japanese>カーゴ ドアを開く</Japanese>
<Japanese>貨物室ドアを 開く</Japanese>
<Korean>화물칸 개방</Korean>
<Chinese>開啟貨艙門</Chinese>
<Chinesesimp>开启货舱门</Chinesesimp>
@ -46,7 +46,7 @@
<Russian>Закрыть грузовой отсек</Russian>
<Italian>Chiudi la rampa di carico</Italian>
<Portuguese>Fechar porta de carga</Portuguese>
<Japanese>カーゴ ドアを閉じる</Japanese>
<Japanese>貨物室ドアを 閉じる</Japanese>
<Korean>화물칸 폐쇄</Korean>
<Chinese>關閉貨艙門</Chinese>
<Chinesesimp>关闭货舱门</Chinesesimp>

View File

@ -22,7 +22,8 @@ GVAR(lastSortDirectionRight) = DESCENDING;
params ["_object"];
// If the arsenal is already open, refresh arsenal display
if (!isNil QGVAR(currentBox) && {GVAR(currentBox) isEqualTo _object}) then {
// Deliberate == check, fail on objNull
if (!isNil QGVAR(currentBox) && {GVAR(currentBox) == _object}) then {
[true, true] call FUNC(refresh);
};
}] call CBA_fnc_addEventHandler;

View File

@ -12,57 +12,10 @@ PREP_RECOMPILE_END;
#include "initSettings.inc.sqf"
// Arsenal events
[QGVAR(statsToggle), {
params ["_display", "_showStats"];
private _statsCtrlGroupCtrl = _display displayCtrl IDC_statsBox;
private _statsPreviousPageCtrl = _display displayCtrl IDC_statsPreviousPage;
private _statsNextPageCtrl = _display displayCtrl IDC_statsNextPage;
private _statsCurrentPageCtrl = _display displayCtrl IDC_statsCurrentPage;
{
_x ctrlShow (GVAR(showStats) && {_showStats});
} forEach [
_statsCtrlGroupCtrl,
_statsPreviousPageCtrl,
_statsNextPageCtrl,
_statsCurrentPageCtrl
];
}] call CBA_fnc_addEventHandler;
[QGVAR(statsChangePage), {
_this call FUNC(buttonStatsPage);
}] call CBA_fnc_addEventHandler;
[QGVAR(displayStats), {
_this call FUNC(handleStats);
}] call CBA_fnc_addEventHandler;
[QGVAR(actionsChangePage), {
_this call FUNC(buttonActionsPage);
}] call CBA_fnc_addEventHandler;
[QGVAR(displayActions), {
_this call FUNC(handleActions);
}] call CBA_fnc_addEventHandler;
[QGVAR(actionsToggle), {
params ["_display", "_showActions"];
private _actionsCtrlGroupCtrl = _display displayCtrl IDC_actionsBox;
private _actionsPreviousPageCtrl = _display displayCtrl IDC_actionsPreviousPage;
private _actionsNextPageCtrl = _display displayCtrl IDC_actionsNextPage;
private _actionsCurrentPageCtrl = _display displayCtrl IDC_actionsCurrentPage;
{
_x ctrlShow (GVAR(showActions) && {_showActions});
} forEach [
_actionsCtrlGroupCtrl,
_actionsPreviousPageCtrl,
_actionsNextPageCtrl,
_actionsCurrentPageCtrl
];
}] call CBA_fnc_addEventHandler;
[QGVAR(statsChangePage), LINKFUNC(buttonStatsPage)] call CBA_fnc_addEventHandler;
[QGVAR(displayStats), LINKFUNC(handleStats)] call CBA_fnc_addEventHandler;
[QGVAR(actionsChangePage), LINKFUNC(buttonActionsPage)] call CBA_fnc_addEventHandler;
[QGVAR(displayActions), LINKFUNC(handleActions)] call CBA_fnc_addEventHandler;
call FUNC(compileActions);
call FUNC(compileSorts);
@ -83,8 +36,16 @@ call FUNC(compileStats);
EGVAR(common,blockItemReplacement) = false;
}] call CBA_fnc_addEventHandler;
[QGVAR(cargoChanged), {
params ["_display"];
// Only update actions if necessary, this can get performance-intensive using the arrow keys
if (!GVAR(updateActionsOnCargoChange)) exitWith {};
private _actionInfo = [_display];
_actionInfo append GVAR(actionInfo);
[QGVAR(displayActions), _actionInfo] call CBA_fnc_localEvent;
}] call CBA_fnc_addEventHandler;
// Setup Tools tab
[keys (uiNamespace getVariable [QGVAR(configItemsTools), createHashMap]), LLSTRING(toolsTab), TOOLS_TAB_ICON, -1, true] call FUNC(addRightPanelButton);
ADDON = true;

View File

@ -155,6 +155,8 @@
#define IDC_statsNextPage 53
#define IDC_statsCurrentPage 54
#define IDC_actionsBox 90
#define IDC_actionsBackground1 90010
#define IDC_actionsBackground2 90011
#define IDC_actionsText1 9001
#define IDC_actionsButton1 9002
#define IDC_actionsText2 9003

View File

@ -10,6 +10,7 @@
* 3: Actions <ARRAY of ARRAYS>
* 4: Condition <CODE> (default: {true})
* 5: Scope editor <NUMBER> (default: 2)
* 6: Update when cargo content changes <BOOL> (default: false)
*
* Return Value:
* 0: Array of IDs <ARRAY of STRINGS>
@ -30,7 +31,8 @@ params [
["_title", "", [""]],
["_actions", [], [[]]],
["_rootCondition", {true}, [{}]],
["_scopeEditor", 2, [0]]
["_scopeEditor", 2, [0]],
["_updateOnCargoChange", false, [false]]
];
// Compile actions from config (in case this is called before preInit)
@ -38,13 +40,13 @@ call FUNC(compileActions);
// Skip if not allowed in editor and in editor
if (is3DEN && {_scopeEditor != 2}) exitWith {
TRACE_1("Skipping action because in editor", _rootClass);
TRACE_1("Skipping action because in editor",_rootClass);
[]
};
// Class can't contain ~, because it's used for formatting result
if ("~" in _rootClass) exitWith {
TRACE_1("Classname can't contain '~'", _rootClass);
TRACE_1("Classname can't contain '~'",_rootClass);
[]
};
@ -65,7 +67,7 @@ private _fnc_addToGroup = {
// Don't allow two of the same class
if (_group findIf {(_x select 0) == _class} != -1) then {
TRACE_1("An action with this ID already exists", _class);
TRACE_1("An action with this ID already exists",_class);
continue;
};
@ -119,4 +121,8 @@ private _group = [];
};
} forEach _tabs;
if (_updateOnCargoChange) then {
GVAR(updateActionsOnCargoChange) = true;
};
_return

View File

@ -72,7 +72,7 @@ private _fnc_addToTabs = {
_currentTab pushBack _sort;
_return pushBack _sortName;
} else {
TRACE_1("A sort with this ID already exists", _sortName);
TRACE_1("A sort with this ID already exists",_sortName);
};
} forEach _tabsToAddTo;
};

View File

@ -77,7 +77,7 @@ private _fnc_addToTabs = {
// Find if there is an entry with same ID
if (_currentTab findIf {_x select 5 == _statName} != -1) then {
TRACE_1("A stat with this ID already exists", _statName);
TRACE_1("A stat with this ID already exists",_statName);
} else {
_stat = +_finalArray;
_stat set [5, _statName];
@ -109,11 +109,10 @@ private _tabToChange = [];
{
_x params ["_tab", "_tabSide"];
_tabToChange = if (_tabSide == "R") then {
_tabToChange = [
GVAR(statsListLeftPanel),
GVAR(statsListRightPanel)
} else {
GVAR(statsListLeftPanel)
};
] select (_tabSide == "R");
_stats = _tabToChange select _tab;

View File

@ -2,12 +2,12 @@
#include "..\defines.hpp"
/*
* Author: Brett Mayson
* Handles the previous / next page buttons for actions
* Handles the previous / next page buttons for actions.
*
* Arguments:
* 0: Arsenal display <DISPLAY>
* 1: Actions control <CONTROL>
* 2: Previous or next <BOOL> (false = previous, true = next)
* 1: Actions page <CONTROL>
* 2: Previous (false) or next (true) page <BOOL>
*
* Return Value:
* None
@ -17,10 +17,11 @@
params ["_display", "_control", "_nextPage"];
TRACE_1("control enabled", ctrlEnabled _control);
TRACE_1("control enabled",ctrlEnabled _control);
if !(ctrlEnabled _control) exitWith {};
GVAR(currentActionPage) = GVAR(currentActionPage) + ([-1, 1] select _nextPage);
GVAR(actionsInfo) params ["_panelControl", "_curSel", "_itemCfg"];
[QGVAR(displayActions), [_display, _panelControl, _curSel, _itemCfg]] call CBA_fnc_localEvent;

View File

@ -52,10 +52,20 @@ private _ctrl = controlNull;
IDC_buttonCurrentMag2,
IDC_iconBackgroundCurrentMag,
IDC_iconBackgroundCurrentMag2,
IDC_statsBox,
IDC_statsPreviousPage,
IDC_statsNextPage,
IDC_statsCurrentPage
IDC_statsCurrentPage,
IDC_actionsBox,
IDC_actionsPreviousPage,
IDC_actionsNextPage,
IDC_actionsCurrentPage
];
[QGVAR(statsToggle), [_display, _showToggle]] call CBA_fnc_localEvent;
[QGVAR(actionsToggle), [_display, _showToggle]] call CBA_fnc_localEvent;
if (!_showToggle) exitWith {};
// When showing the stats/actions again, update them to fit with currently selected item
GVAR(actionsInfo) params ["_control", "_curSel", "_itemCfg"];
[QGVAR(displayStats), [_display, _control, _curSel, _itemCfg]] call CBA_fnc_localEvent;
[QGVAR(displayActions), [_display, _control, _curSel, _itemCfg]] call CBA_fnc_localEvent;

View File

@ -17,11 +17,11 @@
params ["_display", "_control", "_nextPage"];
TRACE_1("control enabled", ctrlEnabled _control);
TRACE_1("control enabled",ctrlEnabled _control);
if !(ctrlEnabled _control) exitWith {};
GVAR(currentStatPage) = [GVAR(currentStatPage) - 1, GVAR(currentStatPage) + 1] select _nextPage;
GVAR(currentStatPage) = GVAR(currentStatPage) + ([-1, 1] select _nextPage);
GVAR(statsInfo) params ["_isLeftPanel", "_panelControl", "_curSel", "_itemCfg"];
GVAR(statsInfo) params ["", "_panelControl", "_curSel", "_itemCfg"];
[QGVAR(displayStats), [_display, _panelControl, _curSel, _itemCfg]] call CBA_fnc_localEvent;

View File

@ -37,6 +37,8 @@ private _actionList = [
private _configGroupEntries = "true" configClasses (configFile >> QGVAR(actions));
GVAR(updateActionsOnCargoChange) = false;
{
private _scopeEditor = getNumber (_x >> "scopeEditor");
@ -48,6 +50,10 @@ private _configGroupEntries = "true" configClasses (configFile >> QGVAR(actions)
private _rootDisplayName = getText (_x >> "displayName");
private _rootCondition = getText (_x >> "condition");
private _rootTabs = getArray (_x >> "tabs");
private _updateOnCargoChanged = getNumber (_x >> "updateOnCargoChanged");
if (_updateOnCargoChanged > 0) then {
GVAR(updateActionsOnCargoChange) = true;
};
if (_rootCondition != "") then {
_rootCondition = compile _rootCondition;

View File

@ -101,7 +101,7 @@ private _priority = 0;
(_finalArray select 4) set [1, compile (getText (_x >> "textStatement"))];
};
TRACE_3("stats array", _finalArray, _leftTabsList, _rightTabsList);
TRACE_3("stats array",_finalArray,_leftTabsList,_rightTabsList);
if (_leftTabsList isNotEqualTo []) then {
[_statsListLeftPanel, _leftTabsList, "L"] call _fnc_addToTabs;

View File

@ -196,7 +196,7 @@ private _selectedItem = switch (true) do {
_lbAdd = _ctrlPanel lbAdd _displayName;
_ctrlPanel lbSetData [_lbAdd, _x];
_ctrlPanel lbSetTooltip [_lbAdd, format ["%1\n%2", _displayName, _x]];
_ctrlPanel lbSetPictureRight [_lbAdd, _modPicture];
_ctrlPanel lbSetPictureRight [_lbAdd, ["", _modPicture] select GVAR(enableModIcons)];
} forEach (uiNamespace getVariable QGVAR(faceCache));
GVAR(currentFace)

View File

@ -87,7 +87,7 @@ private _fnc_fillRightContainer = {
_ctrlPanel lnbSetText [[_lbAdd, 1], _displayName];
_ctrlPanel lnbSetData [[_lbAdd, 0], _className];
_ctrlPanel lnbSetPicture [[_lbAdd, 0], _picture];
_ctrlPanel lnbSetValue [[_lbAdd, 2], [0, 1] select _isUnique];
_ctrlPanel lnbSetValue [[_lbAdd, 2], parseNumber _isUnique];
_ctrlPanel lnbSetTooltip [[_lbAdd, 0], format ["%1\n%2", _displayName, _className]];
if ((toLower _className) in GVAR(favorites)) then {
_ctrlPanel lnbSetColor [[_lbAdd, 1], FAVORITES_COLOR];

View File

@ -7,7 +7,7 @@
* Arguments:
* 0: Arsenal display <DISPLAY>
* 1: Current panel control <CONTROL>
* 2: Current panel selection <SCALAR>
* 2: Current panel selection <NUMBER>
* 3: Item config entry <CONFIG>
*
* Return Value:
@ -15,7 +15,6 @@
*
* Public: No
*/
params ["_display", "_control", "_curSel", "_itemCfg"];
GVAR(actionsInfo) = [_control, _curSel, _itemCfg];
@ -46,13 +45,12 @@ private _groups = (GVAR(actionList) select _panel) select {
};
private _show = _groups isNotEqualTo [];
private _ctrl = _display displayCtrl IDC_actionsBox;
_ctrl ctrlShow _show;
_ctrl ctrlCommit 0.15;
private _actionsBoxCtrl = _display displayCtrl IDC_actionsBox;
_actionsBoxCtrl ctrlShow _show;
_actionsBoxCtrl ctrlCommit 0.15;
if (!_show) exitWith {};
private _actionsBoxCtrl = _display displayCtrl IDC_actionsBox;
private _actionsCurrentPageCtrl = _display displayCtrl IDC_actionsCurrentPage;
private _currentPage = GVAR(currentActionPage);
@ -83,10 +81,11 @@ _actionsCurrentPageCtrl ctrlSetFade 0;
_actionsCurrentPageCtrl ctrlShow true;
_actionsCurrentPageCtrl ctrlCommit 0;
private _activeCtrls = [];
{
_x params ["", "_type", "_label", "_statement"];
private _idc = 9001 + _forEachIndex * 2;
private _idc = IDC_actionsText1 + _forEachIndex * 2;
private _actionTextCtrl = _display displayCtrl _idc;
private _actionButtonCtrl = _display displayCtrl (_idc + 1);
@ -99,13 +98,23 @@ _actionsCurrentPageCtrl ctrlCommit 0;
[true] call FUNC(refresh);
}] call CBA_fnc_execNextFrame;
}];
if (_activeCtrls isNotEqualTo []) then {
(ctrlPosition (_activeCtrls select -1)) params ["", "_lastPosY", "", "_lastPosH"];
_actionButtonCtrl ctrlSetPositionY (_lastPosY + _lastPosH + GRID_H);
} else {
_actionButtonCtrl ctrlSetPositionY (6 * GRID_H);
};
_actionButtonCtrl ctrlAddEventHandler ["ButtonClick", _statement];
_actionButtonCtrl ctrlSetText _label;
_actionButtonCtrl ctrlSetFade 0;
_actionButtonCtrl ctrlEnable true;
_actionButtonCtrl ctrlCommit 0;
_actionTextCtrl ctrlSetFade 1;
_actionTextCtrl ctrlEnable false;
_actionTextCtrl ctrlCommit 0;
_activeCtrls pushBack _actionButtonCtrl;
};
case ACTION_TYPE_TEXT: {
private _text = call _statement;
@ -113,13 +122,25 @@ _actionsCurrentPageCtrl ctrlCommit 0;
if (isNil "_text") then {
_text = "";
};
if (_text isEqualType []) then {
_text = _text joinString endl;
};
if (_activeCtrls isNotEqualTo []) then {
(ctrlPosition (_activeCtrls select -1)) params ["", "_lastPosY", "", "_lastPosH"];
_actionTextCtrl ctrlSetPositionY (_lastPosY + _lastPosH + GRID_H);
} else {
_actionTextCtrl ctrlSetPositionY (5 * GRID_H);
};
_actionTextCtrl ctrlSetText _text;
_actionTextCtrl ctrlSetPositionH (ctrlTextHeight _actionTextCtrl);
_actionTextCtrl ctrlSetFade 0;
_actionTextCtrl ctrlEnable false;
_actionTextCtrl ctrlCommit 0;
_actionButtonCtrl ctrlSetFade 1;
_actionButtonCtrl ctrlEnable false;
_actionButtonCtrl ctrlCommit 0;
_activeCtrls pushBack _actionTextCtrl;
};
default {
_actionTextCtrl ctrlSetFade 1;
@ -134,7 +155,7 @@ _actionsCurrentPageCtrl ctrlCommit 0;
private _actionCount = count _items;
{
private _idc = 9001 + _x * 2;
private _idc = IDC_actionsText1 + _x * 2;
private _actionTextCtrl = _display displayCtrl _idc;
private _actionButtonCtrl = _display displayCtrl (_idc + 1);
@ -145,6 +166,11 @@ private _actionCount = count _items;
} forEach ([0, 1, 2, 3, 4] select [_actionCount, 5]);
private _pos = ctrlPosition _actionsBoxCtrl;
_pos set [3, ([11, (5 * _actionCount) + 6] select (_actionCount > 0)) * GRID_H];
_actionsBoxCtrl ctrlSetPosition _pos;
(ctrlPosition (_activeCtrls select -1)) params ["", "_lastPosY", "", "_lastPosH"];
private _actionsBoxHeight = _lastPosY + _lastPosH + GRID_H;
_actionsBoxCtrl ctrlSetPositionH _actionsBoxHeight;
_actionsBoxCtrl ctrlCommit 0;
private _background = _display displayCtrl IDC_actionsBackground1;
_background ctrlSetPositionH _actionsBoxHeight;
_background ctrlCommit 0;

View File

@ -115,12 +115,11 @@ GVAR(currentVoice) = nil;
GVAR(currentInsignia) = nil;
GVAR(currentAction) = nil;
GVAR(showStats) = nil;
GVAR(currentStatPage) = nil;
GVAR(statsInfo) = nil;
GVAR(showActions) = nil;
GVAR(currentActionPage) = nil;
GVAR(actionsInfo) = nil;
profileNamespace setVariable [QGVAR(favorites), GVAR(favorites)];
GVAR(favoritesOnly) = nil;

View File

@ -74,12 +74,11 @@ GVAR(currentInsignia) = GVAR(center) call BIS_fnc_getUnitInsignia;
GVAR(currentAction) = "Stand";
GVAR(shiftState) = false;
GVAR(showStats) = true;
GVAR(currentStatPage) = 0;
GVAR(statsInfo) = [true, controlNull, nil, nil];
GVAR(showActions) = true;
GVAR(currentActionPage) = 0;
GVAR(actionsInfo) = [controlNull, nil, nil];
// Update current item list
call FUNC(updateCurrentItemsList);

View File

@ -147,7 +147,7 @@ if (!isNull _loadoutsDisplay) then {
// Right panel lnb + and - buttons
case (_keyPressed in [DIK_LEFT, DIK_RIGHT]): {
if (GVAR(rightTabLnBFocus)) then {
[_display, [1, 0] select (_keyPressed == DIK_LEFT)] call FUNC(buttonCargo);
[_display, parseNumber (_keyPressed != DIK_LEFT)] call FUNC(buttonCargo);
};
};
};

View File

@ -25,6 +25,11 @@ if (canSuspend) exitWith {
[{_this call FUNC(refresh)}, _this] call CBA_fnc_directCall;
};
private _display = findDisplay IDD_ace_arsenal;
// Exit quietly if no display found
if (isNull _display) exitWith {};
if (_updateItems) then {
// Update current item list
call FUNC(updateCurrentItemsList);
@ -65,6 +70,4 @@ if (!_animate) then {
[{GVAR(refreshing) = false}, nil, 3] call CBA_fnc_execAfterNFrames;
};
private _display = findDisplay IDD_ace_arsenal;
[_display, _display displayCtrl GVAR(currentLeftPanel), _animate] call FUNC(fillLeftPanel);

View File

@ -42,8 +42,14 @@ if (_global && {isMultiplayer} && {!isNil "_id"}) then {
};
// If the arsenal is already open and not ignoring content (see FUNC(openBox)), close arsenal display
if (!isNil QGVAR(currentBox) && {GVAR(currentBox) isEqualTo _object} && {isNil QGVAR(ignoredVirtualItems)}) then {
[LLSTRING(noVirtualItems), false, 5, 1] call EFUNC(common,displayText);
// Delay a frame in case this is running on display open
[{(findDisplay IDD_ace_arsenal) closeDisplay 0}] call CBA_fnc_execNextFrame;
// Deliberate == check, fail on objNull
if (!isNil QGVAR(currentBox) && {GVAR(currentBox) == _object} && {isNil QGVAR(ignoredVirtualItems)}) then {
// Delay a frame in case this is running on display open/close
[{
private _display = findDisplay IDD_ace_arsenal;
if (isNull _display) exitWith {};
[LLSTRING(noVirtualItems), false, 5, 1] call EFUNC(common,displayText);
_display closeDisplay 0;
}] call CBA_fnc_execNextFrame;
};

View File

@ -31,9 +31,9 @@ if (_allItems isEqualTo []) then { _allItems = [configName _config] };
|| {_illum && {([_xCfg >> "Flashlight" >> "irLight", "NUMBER", 0] call CBA_fnc_getConfigEntry) == 1}};
private _text = switch (true) do { // shorthand roughly based on PEQ-15
case (_laser && _illum): { if (_isIR) then { "IR-DUAL" } else { "VIS-DUAL" } };
case (_laser): { if (_isIR) then { "IR-AIM" } else { "VIS-AIM" } }; // AIM
case (_illum): { if (_isIR) then { "IR-ILM" } else { "VIS-ILM" } }; // ILLUMIATION
case (_laser && _illum): { ["VIS-DUAL", "IR-DUAL"] select _isIR }; // DUAL
case (_laser): { ["VIS-AIM", "IR-AIM"] select _isIR }; // AIM
case (_illum): { ["VIS-ILM", "IR-ILM"] select _isIR }; // ILLUMIATION
default { "_" }; // there are some purely cosmetic attachements
};
_allModes pushBackUnique _text;

View File

@ -67,7 +67,9 @@ if (!_primaryNVGSupported && {(_opticsModes select {_x select 1}) isEqualTo _opt
_primaryNVGSupported = true;
};
if (_primaryNVGIntegrated) exitWith {LLSTRING(statVisionMode_IntPrim)};
if (_primaryTiIntegrated && _primaryNVGIntegrated) exitWith {LLSTRING(statVisionMode_intPrimTi)};
if (_primaryTiIntegrated) exitWith {LLSTRING(statVisionMode_ti)};
if (_primaryNVGIntegrated) exitWith {LLSTRING(statVisionMode_intPrim)};
if (_primaryNVGSupported) exitWith {LLSTRING(statVisionMode_supPrim)};
if (_secondaryNVGSupported) exitWith {LLSTRING(statVisionMode_supSec)};

View File

@ -46,11 +46,7 @@ private _fnc_toConfigCase = {
// If item doesn't exist in config, "" is returned
// Just return unaltered item name in that case, so it can be documented as being unavailable
if (_name != "") then {
_name
} else {
_x
};
[_x, _name] select (_name != "");
} else {
_x
};

View File

@ -613,7 +613,7 @@
<French>Le set d'équipement suivant a été supprimé :</French>
<German>Folgende Ausrüstung wurde entfernt:</German>
<Polish>Następujący zestaw został skasowany:</Polish>
<Japanese>次の装備は削除されました:</Japanese>
<Japanese>装備を削除しました:</Japanese>
<Italian>Il seguente equipaggiamento è stato eliminato:</Italian>
<Korean>다음 로드아웃이 삭제됨 :</Korean>
<Chinese>以下的裝備已被刪除:</Chinese>
@ -629,7 +629,7 @@
<French>Le set d'équipement suivant n'est plus public :</French>
<German>Folgende Ausrüstung ist nicht mehr öffentlich:</German>
<Polish>Następujący zestaw nie jest już publiczny:</Polish>
<Japanese>次の装備は非公開になりました:</Japanese>
<Japanese>装備を非公開にしました:</Japanese>
<Italian>Il seguente equipaggiamento non è più pubblico:</Italian>
<Korean>다음 로드아웃이 더이상 공용이 아님:</Korean>
<Chinese>以下的裝備已不再被分享:</Chinese>
@ -645,7 +645,7 @@
<French>Le champ "nom" est vide !</French>
<German>Das Feld "Name" ist leer!</German>
<Polish>Pole nazwy jest puste!</Polish>
<Japanese>名前が空です!</Japanese>
<Japanese>名前が空です!</Japanese>
<Italian>Il campo del nome è vuoto!</Italian>
<Korean>이름칸이 비었습니다!</Korean>
<Chinese>名稱欄位為空!</Chinese>
@ -677,7 +677,7 @@
<French>Un de vos sets d'équipement ayant le même nom est public.</French>
<German>Eine deiner Ausrüstungen mit dem gleichen Namen ist öffentlich</German>
<Polish>Jeden z Twoich zestawów nazwany tak samo jest już publiczny</Polish>
<Japanese>あなたの装備は既に公開されているものと同名で</Japanese>
<Japanese>あなたのものと同じ名前の装備が既に公開されていま</Japanese>
<Italian>Un tuo equipaggiamento con lo stesso nome è pubblico</Italian>
<Korean>같은 이름의 로드아웃이 공용에 있습니다.</Korean>
<Chinese>已有相同名稱的裝備在公用分享區</Chinese>
@ -693,7 +693,7 @@
<French>Le set d'équipement suivant a été enregistré :</French>
<German>Folgende Ausrüstung wurde gespeichert:</German>
<Polish>Następujący zestaw został zapisany:</Polish>
<Japanese>次の装備は保存されました:</Japanese>
<Japanese>装備を保存しました:</Japanese>
<Italian>Il seguente equipaggiamento è stato salvato:</Italian>
<Korean>다음 로드아웃이 저장됨:</Korean>
<Chinese>以下的裝備已被保存:</Chinese>
@ -709,7 +709,7 @@
<French>Le set d'équipement suivant a été chargé :</French>
<German>Folgene Ausrüstung wurde geladen:</German>
<Polish>Następujący zestaw został wczytany:</Polish>
<Japanese>次の装備が読み込みされました:</Japanese>
<Japanese>装備を読み込みました:</Japanese>
<Italian>Il seguente equipaggiamento è stato caricato:</Italian>
<Korean>다음 로드아웃을 불러옴:</Korean>
<Chinese>以下的裝備已被載入:</Chinese>
@ -725,7 +725,7 @@
<French>Un set d'équipement ayant le même nom existe déjà !</French>
<German>Eine Ausrüstung mit dem gleichen Namen existiert bereits!</German>
<Polish>Zestaw z tą nazwą już istnieje!</Polish>
<Japanese>既にその名前は装備に使われています!</Japanese>
<Japanese>既に同じ名前の装備が存在しています!</Japanese>
<Italian>Un equipaggiamento con lo stesso nome è gia esistente!</Italian>
<Korean>같은 이름의 로드아웃이 이미 존재합니다!</Korean>
<Chinese>已有相同名稱的裝備!</Chinese>
@ -741,7 +741,7 @@
<French>a été renommé en</French>
<German>wurde umbenannt in</German>
<Polish>zmienił nazwę na</Polish>
<Japanese>次の名前に変更されました</Japanese>
<Japanese>を次の名前に変更しました:</Japanese>
<Italian>È stato rinominato in</Italian>
<Korean>이름이 다음과 같이 변경됨:</Korean>
<Chinese>已被改名為</Chinese>
@ -1181,7 +1181,7 @@
<English>Nightvision Support</English>
<Spanish>Soporte de visión nocturna</Spanish>
<German>Nachtsicht Unterstützung</German>
<Japanese>暗視装置への対応有無</Japanese>
<Japanese>暗視装置への対応</Japanese>
<Polish>Wsparcie noktowizyjne</Polish>
<Italian>Supporto visore notturno</Italian>
<Russian>Поддержка ночного видения</Russian>
@ -1223,7 +1223,7 @@
<Czech>Vedlejší část hledí podporuje</Czech>
<Korean>보조무기 지원여부</Korean>
</Key>
<Key ID="STR_ACE_Arsenal_statVisionMode_IntPrim">
<Key ID="STR_ACE_Arsenal_statVisionMode_intPrim">
<English>Primary integrated</English>
<Spanish>Primaria integrada</Spanish>
<German>Primär Integriert</German>
@ -1238,6 +1238,14 @@
<Czech>Integrováno do hlavní části hledí</Czech>
<Korean>주무기 내장여부</Korean>
</Key>
<Key ID="STR_ACE_Arsenal_statVisionMode_ti">
<English>Thermal integrated</English>
<Japanese>熱画像装置内蔵</Japanese>
</Key>
<Key ID="STR_ACE_Arsenal_statVisionMode_intPrimTi">
<English>Thermal &amp; Primary integrated</English>
<Japanese>熱画像装置内蔵・プライマリに内蔵</Japanese>
</Key>
<Key ID="STR_ACE_Arsenal_statVisionMode_NoSup">
<English>Not Supported</English>
<Spanish>No soportada</Spanish>
@ -1257,7 +1265,7 @@
<Key ID="STR_ACE_Arsenal_statVisionModeGeneric">
<English>Vision Mode</English>
<German>Sichtmodus</German>
<Japanese>ビジョン モード</Japanese>
<Japanese>映像モード</Japanese>
<Italian>Modalità Visiva</Italian>
<Chinese>視覺模式</Chinese>
<Chinesesimp>视觉模式</Chinesesimp>
@ -1495,7 +1503,7 @@
<Spanish>Añade automáticamente accesorios o cargadores (de la categoría seleccionada) a todas las armas de la lista de objetos</Spanish>
<German>Es werden automatisch kompatible Aufsätze oder Magazine für alle ausgewählten Waffen hinzugefügt</German>
<Polish>Automatycznie doda kompatybilne dodatki oraz magazynki (odpowiednio do każdej kategorii) dla wszystkich broni na liście</Polish>
<Japanese>現在のアイテムリスト内にある全武器に対応する アタッチメントと弾倉(選択したカテゴリに基づく)を自動的に追加します</Japanese>
<Japanese>現在のアイテムリスト内全武器に対応する アタッチメントと弾倉(選択したカテゴリに基づく)を自動的に追加します</Japanese>
<Russian>Добавляет совместимые приспособления или магазины (в зависимости от выбранной категории) для всего оружия в текущем списке предметов</Russian>
<Portuguese>Irá automaticamente adicionar acessórios ou carregadores (baseado na categoria selecionada) para todas as armas na lista de itens atual</Portuguese>
<French>Ajoute automatiquement des accessoires ou des chargeurs compatibles (en fonction de la catégorie sélectionnée), pour toutes les armes de la liste actuelle.</French>

View File

@ -450,22 +450,22 @@ class GVAR(display) {
h = QUOTE(55 * GRID_H);
class controls {
class actionsStaticBackground1: ctrlStaticBackground {
idc = -1;
idc = IDC_actionsBackground1;
x = QUOTE(0);
y = QUOTE(0);
w = QUOTE(47 * GRID_W);
h = QUOTE(56 * GRID_H);
h = QUOTE(55 * GRID_H);
colorBackground[]={0.1,0.1,0.1,0.5};
};
class actionsStaticBackground2: ctrlStaticBackground {
idc = -1;
idc = IDC_actionsBackground2;
x = QUOTE(0);
y = QUOTE(0);
w = QUOTE(47 * GRID_W);
h = QUOTE(5 * GRID_H);
colorBackground[]={0.1,0.1,0.1,0.8};
};
class actionsText1: RscText {
class actionsText1: RscTextMulti {
idc = IDC_actionsText1;
fade = 1;
x = QUOTE(0 * GRID_W);
@ -479,6 +479,7 @@ class GVAR(display) {
};
class actionsButton1: ctrlButton {
idc = IDC_actionsButton1;
onMouseEnter = QUOTE(ctrlSetFocus (_this select 0));
fade = 1;
text = "";
x = QUOTE(1 * GRID_W);

View File

@ -65,7 +65,7 @@ GVAR(magModeData) = [];
{
_x params ["_xDisplayNameShort", "_xDisplayName", "_xInitSpeed", "_xAirFriction"];
if (_allSameCharge) then {
_ctrlChargeList lbAdd format ["%1", _xDisplayNameShort];
_ctrlChargeList lbAdd _xDisplayNameShort;
_ctrlChargeList lbSetTooltip [count GVAR(magModeData), format ["%1\n%2 m/s\n%3", _xDisplayName, _xInitSpeed toFixed 1, _xAirFriction]];
GVAR(magModeData) pushBack [_xInitSpeed, _xAirFriction];
} else {

View File

@ -15,7 +15,7 @@
* Public: No
*/
LOG_2("Trying to load gunlist from profile [Version: %1][Count: %2]", profileNamespace getVariable [ARR_2(QGVAR(profileNamespaceVersion), 'none')], count (profileNamespace getVariable [ARR_2(QGVAR(gunList), [])]));
LOG_2("Trying to load gunlist from profile [Version: %1][Count: %2]",profileNamespace getVariable [ARR_2(QGVAR(profileNamespaceVersion),'none')],count (profileNamespace getVariable [ARR_2(QGVAR(gunList),[])]));
private _resetGunList = true;
if ((profileNamespace getVariable ["ACE_ATragMX_profileNamespaceVersion", 0]) == ATRAGMX_PROFILE_NAMESPACE_VERSION && {count (profileNamespace getVariable ["ACE_ATragMX_gunList", []]) > 0}) then {

View File

@ -90,7 +90,7 @@ if (GVAR(showWind2)) then {
_elevationAbs = Round(_elevationAbs * 100) / 100;
if (_elevationAbs > 0) then {
ctrlSetText [400, format["%1", abs(_elevationAbs)]];
ctrlSetText [400, str abs _elevationAbs];
} else {
if (_elevationAbs < 0) then {
ctrlSetText [400, format["%1D", abs(_elevationAbs)]];
@ -100,7 +100,7 @@ if (_elevationAbs > 0) then {
};
_elevationRel = Round(_elevationRel * 100) / 100;
if (_elevationRel > 0) then {
ctrlSetText [401, format["%1", abs(_elevationRel)]];
ctrlSetText [401, str abs _elevationRel];
} else {
if (_elevationRel < 0) then {
ctrlSetText [401, format["%1D", abs(_elevationRel)]];
@ -110,7 +110,7 @@ if (_elevationRel > 0) then {
};
_elevationCur = Round(_elevationCur * 100) / 100;
if (_elevationCur > 0) then {
ctrlSetText [402, format["%1", abs(_elevationCur)]];
ctrlSetText [402, str abs _elevationCur];
} else {
if (_elevationCur < 0) then {
ctrlSetText [402, format["%1D", abs(_elevationCur)]];

View File

@ -16,7 +16,7 @@
*/
params ["_vehicle"];
TRACE_1("params", _vehicle);
TRACE_1("params",_vehicle);
scopeName "main";

View File

@ -15,3 +15,17 @@ class Extended_PostInit_EventHandlers {
init = QUOTE(call COMPILE_SCRIPT(XEH_postInit));
};
};
class Extended_Killed_EventHandlers {
class CAManBase {
class ADDON {
killed = QUOTE((_this select 0) call FUNC(handleDeployInterrupt));
};
};
};
class Extended_DisplayLoad_EventHandlers {
class RscDisplayMission {
ADDON = QUOTE(_this call COMPILE_SCRIPT(XEH_missionDisplayLoad));
};
};

View File

@ -2,10 +2,15 @@ PREP(addCargoItem);
PREP(addCargoVehiclesActions);
PREP(canLoadItemIn);
PREP(canUnloadItem);
PREP(deployCancel);
PREP(deployConfirm);
PREP(getCargoSpaceLeft);
PREP(getNameItem);
PREP(getSelectedItem);
PREP(getSizeItem);
PREP(handleDestroyed);
PREP(handleDeployInterrupt);
PREP(handleScrollWheel);
PREP(initObject);
PREP(initVehicle);
PREP(loadItem);
@ -16,6 +21,7 @@ PREP(removeCargoItem);
PREP(renameObject);
PREP(setSize);
PREP(setSpace);
PREP(startDeploy);
PREP(startLoadIn);
PREP(startUnload);
PREP(unloadCarryItem);

View File

@ -0,0 +1,11 @@
#include "script_component.hpp"
params ["_display"];
_display displayAddEventHandler ["MouseZChanged", {(_this select 1) call FUNC(handleScrollWheel)}];
_display displayAddEventHandler ["MouseButtonDown", {
// Right clicking cancels deployment
if (_this select 1 == 1) then {
ACE_player call FUNC(handleDeployInterrupt);
};
}];

View File

@ -17,10 +17,10 @@
}] call CBA_fnc_addEventHandler;
["ace_unloadCargo", {
params ["_item", "_vehicle", ["_unloader", objNull]];
TRACE_3("UnloadCargo EH",_item,_vehicle,_unloader);
params ["_item", "_vehicle", ["_unloader", objNull], ["_place", []]];
TRACE_4("UnloadCargo EH",_item,_vehicle,_unloader,_place);
private _unloaded = [_item, _vehicle, _unloader] call FUNC(unloadItem); // returns true if successful
private _unloaded = [_item, _vehicle, _unloader, _place] call FUNC(unloadItem); // returns true if successful
// Show hint as feedback
private _hint = [LSTRING(unloadingFailed), LSTRING(unloadedItem)] select _unloaded;
@ -36,13 +36,25 @@
};
}] call CBA_fnc_addEventHandler;
// Direction must be set before setting position according to wiki
[QGVAR(setDirAndUnload), {
params ["_item", "_emptyPosAGL", "_direction"];
_item setDir _direction;
[QGVAR(serverUnload), [_item, _emptyPosAGL]] call CBA_fnc_serverEvent;
}] call CBA_fnc_addEventHandler;
// hideObjectGlobal must be executed before setPos to ensure light objects are rendered correctly
// Do both on server to ensure they are executed in the correct order
[QGVAR(serverUnload), {
params ["_item", "_emptyPosAGL"];
_item hideObjectGlobal false;
_item setPosASL (AGLtoASL _emptyPosAGL);
[_item, "blockDamage", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set);
// Let objects remain invulernable for a short while after placement
[EFUNC(common,statusEffect_set), [_item, "blockDamage", QUOTE(ADDON), false], 2] call CBA_fnc_waitAndExecute;
}] call CBA_fnc_addEventHandler;
[QGVAR(paradropItem), {
@ -166,3 +178,38 @@ if (isServer) then {
_bodyBag setVariable [QGVAR(customName), [_target, false, true] call EFUNC(common,getName), true];
}] call CBA_fnc_addEventHandler;
};
// Set variables, even on machines without interfaces, just to be safe
GVAR(selectedItem) = objNull;
GVAR(itemPreviewObject) = objNull;
GVAR(deployPFH) = -1;
GVAR(deployDistance) = -1;
GVAR(deployDirection) = 0;
GVAR(deployHeight) = 0;
GVAR(canDeploy) = false;
if (!hasInterface) exitWith {};
// Cancel object deployment if interact menu opened
["ace_interactMenuOpened", {ACE_player call FUNC(handleDeployInterrupt)}] call CBA_fnc_addEventHandler;
// Cancel deploy on player change. This does work when returning to lobby, but not when hard disconnecting
["unit", LINKFUNC(handleDeployInterrupt)] call CBA_fnc_addPlayerEventHandler;
["vehicle", {(_this select 0) call FUNC(handleDeployInterrupt)}] call CBA_fnc_addPlayerEventHandler;
["weapon", {(_this select 0) call FUNC(handleDeployInterrupt)}] call CBA_fnc_addPlayerEventHandler;
// When changing feature cameras, stop deployment
["featureCamera", {(_this select 0) call FUNC(handleDeployInterrupt)}] call CBA_fnc_addPlayerEventHandler;
// Handle falling unconscious while trying to deploy
["ace_unconscious", {(_this select 0) call FUNC(handleDeployInterrupt)}] call CBA_fnc_addEventHandler;
// Handle surrendering and handcuffing
["ace_captiveStatusChanged", {
params ["_unit", "_state"];
// If surrendered or handcuffed, stop deployment
if (_state) then {
_unit call FUNC(handleDeployInterrupt);
};
}] call CBA_fnc_addEventHandler;

View File

@ -0,0 +1,39 @@
#include "..\script_component.hpp"
/*
* Author: Garth 'L-H' de Wet, Ruthberg, commy2, Smith
* Cancels unloading when deploying.
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* player call ace_cargo_fnc_deployCancel
*
* Public: No
*/
if (GVAR(deployPFH) == -1) exitWith {};
// Remove deployment pfh
GVAR(deployPFH) call CBA_fnc_removePerFrameHandler;
GVAR(deployPFH) = -1;
params ["_unit"];
// Enable running again
[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set);
[_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set);
// Delete placement dummy
deleteVehicle GVAR(itemPreviewObject);
// Remove mouse button actions
call EFUNC(interaction,hideMouseHint);
[_unit, "DefaultAction", _unit getVariable [QGVAR(deploy), -1]] call EFUNC(common,removeActionEventHandler);
_unit setVariable [QGVAR(deploy), -1];
_unit setVariable [QGVAR(isDeploying), false, true];

View File

@ -0,0 +1,56 @@
#include "..\script_component.hpp"
/*
* Author: Garth 'L-H' de Wet, Ruthberg, commy2, Smith
* Confirms unloading when deploying.
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* player call ace_cargo_fnc_deployConfirm
*
* Public: No
*/
if (GVAR(deployPFH) == -1) exitWith {};
params ["_unit"];
// Delete placement dummy and unload real item from cargo at dummy position
if (!isNull GVAR(itemPreviewObject) && {[GVAR(selectedItem), GVAR(interactionVehicle), _unit, false, true] call FUNC(canUnloadItem)}) then {
// Position is AGL for unloading event
private _position = ASLToAGL getPosASL GVAR(itemPreviewObject);
private _direction = getDir GVAR(itemPreviewObject);
private _duration = GVAR(loadTimeCoefficient) * (GVAR(selectedItem) call FUNC(getSizeItem));
// If unload time is 0, don't show a progress bar
if (_duration <= 0) exitWith {
["ace_unloadCargo", [GVAR(selectedItem), GVAR(interactionVehicle), _unit, [_position, _direction]]] call CBA_fnc_localEvent;
};
[
_duration,
[GVAR(selectedItem), GVAR(interactionVehicle), _unit, [_position, _direction]],
{
TRACE_1("deploy finish",_this);
["ace_unloadCargo", _this select 0] call CBA_fnc_localEvent;
},
{
TRACE_1("deploy fail",_this);
},
format [LLSTRING(unloadingItem), [GVAR(selectedItem), true] call FUNC(getNameItem), getText (configOf GVAR(interactionVehicle) >> "displayName")],
{
(_this select 0) params ["_item", "_vehicle", "_unit"];
[_item, _vehicle, _unit, false, true] call FUNC(canUnloadItem) // don't check for a suitable unloading position when deploying
},
["isNotSwimming"]
] call EFUNC(common,progressBar);
};
// Cleanup EHs and preview object
_unit call FUNC(deployCancel);

View File

@ -0,0 +1,29 @@
#include "..\script_component.hpp"
/*
* Author: Glowbal, Smith
* Get selected item from cargo menu.
*
* Arguments:
* None
*
* Return Value:
* Classname of selected item or selected object <STRING> or <OBJECT> (default: nil)
*
* Example:
* call ace_cargo_fnc_getSelectedItem
*
* Public: No
*/
disableSerialization;
private _display = uiNamespace getVariable QGVAR(menuDisplay);
if (isNil "_display") exitWith {};
private _loaded = GVAR(interactionVehicle) getVariable [QGVAR(loaded), []];
if (_loaded isEqualTo []) exitWith {};
// This can be an object or a classname string
_loaded param [lbCurSel (_display displayCtrl 100), nil]

View File

@ -0,0 +1,30 @@
#include "..\script_component.hpp"
/*
* Author: commy2, Smith
* Handle various interruption types.
*
* Arguments:
* 0: (New) unit <OBJECT>
* 1: Old unit (for player change) <OBJECT> (default: objNull)
*
* Return Value:
* None
*
* Example:
* player call ace_cargo_fnc_handleDeployInterrupt
*
* Public: No
*/
params ["_newPlayer", ["_oldPlayer", objNull]];
TRACE_2("params",_newPlayer,_oldPlayer);
if (!local _newPlayer) exitWith {};
if (_newPlayer getVariable [QGVAR(isDeploying), false]) then {
_newPlayer call FUNC(deployCancel);
};
if (_oldPlayer getVariable [QGVAR(isDeploying), false]) then {
_oldPlayer call FUNC(deployCancel);
};

View File

@ -0,0 +1,58 @@
#include "..\script_component.hpp"
/*
* Author: L-H, commy2, Smith
* Handles rotation of object to unload.
*
* Arguments:
* 0: Scroll amount <NUMBER>
*
* Return Value:
* If the scroll was handled <BOOL>
*
* Example:
* 1.2 call ace_cargo_fnc_handleScrollWheel
*
* Public: No
*/
if (GVAR(deployPFH) == -1) exitWith {false};
params ["_scrollAmount"];
private _deployedItem = GVAR(itemPreviewObject);
if (!CBA_events_control) then {
private _unit = ACE_player;
// Raise/lower
// Move deployed item 15 cm per scroll interval
_scrollAmount = _scrollAmount * 0.15;
private _position = getPosASL _deployedItem;
private _maxHeight = (_unit modelToWorldVisualWorld [0, 0, 0]) select 2;
_position set [2, ((_position select 2) + _scrollAmount min (_maxHeight + 1.5)) max _maxHeight];
// Move up/down object and reattach at current position
detach _deployedItem;
// Uses this method of selecting position because setPosATL did not have immediate effect
private _positionChange = _position vectorDiff (getPosASL _deployedItem);
private _selectionPosition = _unit worldToModel (ASLtoAGL getPosWorld _deployedItem);
_selectionPosition = _selectionPosition vectorAdd _positionChange;
_deployedItem attachTo [_unit, _selectionPosition];
// Reset the deploy direction
private _direction = _deployedItem getVariable [QGVAR(deployDirection_temp), 0];
_deployedItem setDir _direction;
} else {
// Rotate
private _direction = _deployedItem getVariable [QGVAR(deployDirection_temp), 0];
_scrollAmount = _scrollAmount * 10;
_direction = _direction + _scrollAmount;
_deployedItem setDir _direction;
_deployedItem setVariable [QGVAR(deployDirection_temp), _direction];
};
true

View File

@ -44,7 +44,7 @@ if (_item getVariable [QGVAR(initObject),false]) exitWith {};
if (_canLoadConfig) then {
GVAR(initializedItemClasses) pushBack _type;
TRACE_1("Adding load cargo action to class", _type);
TRACE_1("Adding load cargo action to class",_type);
{
[_type, 0, ["ACE_MainActions"], _x] call EFUNC(interact_menu,addActionToClass);
@ -52,7 +52,7 @@ if (_canLoadConfig) then {
} else {
_item setVariable [QGVAR(initObject), true];
TRACE_1("Adding load cargo action to object", _item);
TRACE_1("Adding load cargo action to object",_item);
{
[_item, 0, ["ACE_MainActions"], _x] call EFUNC(interact_menu,addActionToObject);

View File

@ -16,17 +16,23 @@
*/
params ["_vehicle"];
TRACE_1("params", _vehicle);
TRACE_1("params",_vehicle);
private _type = typeOf _vehicle;
private _config = configOf _vehicle;
// If vehicle had space given to it via eden/public, then override config hasCargo setting
private _hasCargoPublic = _vehicle getVariable [QGVAR(hasCargo), false];
private _hasCargoPublic = _item getVariable QGVAR(hasCargo);
private _hasCargoPublicDefined = !isNil "_canLoadPublic";
if (_hasCargoPublicDefined && {!(_hasCargoPublic isEqualType false)}) then {
WARNING_4("%1[%2] - Variable %3 is %4 - Should be bool",_item,_type,QGVAR(hasCargo),_hasCargoPublic);
};
private _hasCargoConfig = getNumber (_config >> QGVAR(hasCargo)) == 1;
// Nothing to do here if vehicle has no cargo space
if !(_hasCargoConfig || _hasCargoPublic) exitWith {};
if !((_hasCargoPublicDefined && {_hasCargoPublic in [true, 1]}) || {!_hasCargoPublicDefined && {_hasCargoConfig}}) exitWith {};
// Check if cargo is in cargo holder types (checked when trying to search for loadable objects)
private _addCargoType = GVAR(cargoHolderTypes) findIf {_type isKindOf _x} == -1;
@ -68,13 +74,13 @@ if (_type in GVAR(initializedVehicleClasses)) exitWith {};
if (_hasCargoConfig) then {
GVAR(initializedVehicleClasses) pushBack _type;
TRACE_1("Adding unload cargo action to class", _type);
TRACE_1("Adding unload cargo action to class",_type);
[_type, 0, ["ACE_MainActions"], GVAR(vehicleAction)] call EFUNC(interact_menu,addActionToClass);
} else {
_vehicle setVariable [QGVAR(initVehicle), true];
TRACE_1("Adding unload cargo action to object", _vehicle);
TRACE_1("Adding unload cargo action to object",_vehicle);
[_vehicle, 0, ["ACE_MainActions"], GVAR(vehicleAction)] call EFUNC(interact_menu,addActionToObject);
};

View File

@ -25,6 +25,9 @@ if (GVAR(interactionParadrop)) then {
(_display displayCtrl 12) ctrlSetText LLSTRING(paradropButton);
};
// Disable deploy option if paradropping or in Zeus
(_display displayCtrl 13) ctrlEnable (GVAR(enableDeploy) && !GVAR(interactionParadrop) && {isNull curatorCamera});
[{
params ["_vehicle", "_pfhID"];
@ -33,7 +36,6 @@ if (GVAR(interactionParadrop)) then {
private _display = uiNamespace getVariable QGVAR(menuDisplay);
if (isNil "_display") exitWith {
GVAR(interactionVehicle) = nil;
GVAR(interactionParadrop) = nil;
_pfhID call CBA_fnc_removePerFrameHandler;
@ -41,18 +43,18 @@ if (GVAR(interactionParadrop)) then {
// Close menu if in invalid state
if (
!alive _vehicle ||
!alive ACE_player ||
{!alive _vehicle} ||
{locked _vehicle >= 2} ||
{!(_vehicle getVariable [QGVAR(hasCargo), true])} || // if the cargo menu could be opened, the vehicle has QGVAR(hasCargo) in its config or the variable is set using FUNC(setSpace)
{
isNull findDisplay 312 && // if in Zeus, ignore the following checks
isNull curatorCamera && // if in Zeus, ignore the checks that follow
{([ACE_player, _vehicle] call EFUNC(interaction,getInteractionDistance)) >= MAX_LOAD_DISTANCE} &&
{(vehicle ACE_player) != _vehicle}
}
) exitWith {
closeDialog 0;
GVAR(interactionVehicle) = nil;
GVAR(interactionParadrop) = nil;
_pfhID call CBA_fnc_removePerFrameHandler;

View File

@ -0,0 +1,86 @@
#include "..\script_component.hpp"
/*
* Author: Garth 'L-H' de Wet, Ruthberg, commy2, Smith
* Starts the deploy process for unloading an object.
*
* Arguments:
* 0: Unit deploying <OBJECT>
*
* Return Value:
* None
*
* Example:
* player call ace_cargo_fnc_startDeploy
*
* Public: No
*/
// Deny creating preview item as it will destroy player vehicle instantly by collision
if (GVAR(interactionParadrop)) exitWith {};
params ["_unit"];
// Don't allow deploying if already deploying
if (_unit getVariable [QGVAR(isDeploying), false]) exitWith {};
// This can be an object or a classname string
private _item = call FUNC(getSelectedItem);
if (isNil "_item") exitWith {};
// Close opened cargo menu
closeDialog 0;
GVAR(selectedItem) = _item;
private _classname = _item;
if (_classname isEqualType objNull) then {
_classname = typeOf _classname;
};
// Prevent the placing unit from running
[_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set);
[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set);
// Create a local preview object
private _itemPreviewObject = createVehicleLocal [_classname, [0, 0, 0], [], 0, "CAN_COLLIDE"];
GVAR(itemPreviewObject) = _itemPreviewObject;
// Prevent collisions with object
_itemPreviewObject disableCollisionWith _unit;
_itemPreviewObject enableSimulation false;
_itemPreviewObject setMass 1e-12;
// Detect radius of zone where collision can damage the player
private _itemPreviewObjectRadius = 1 max ((boundingBoxReal [_itemPreviewObject, "FireGeometry"]) select 2);
// Add height offset of model
private _offset = ((_itemPreviewObject modelToWorldVisual [0, 0, 0]) select 2) - ((_unit modelToWorldVisual [0, 0, 0]) select 2) + 1;
// Attach object
_itemPreviewObject attachTo [_unit, [0, 1.5 * _itemPreviewObjectRadius, _offset]];
// PFH that runs while the deployment is in progress
GVAR(deployPFH) = [{
(_this select 0) params ["_unit", "_vehicle", "_item", "_itemPreviewObject"];
if !(
!isNull _itemPreviewObject &&
{[_item, _vehicle, _unit, false, true] call FUNC(canUnloadItem)} // don't check for a suitable unloading position when deploying
) exitWith {
_unit call FUNC(deployCancel);
};
}, 0.5, [_unit, GVAR(interactionVehicle), _item, _itemPreviewObject]] call CBA_fnc_addPerFrameHandler;
// Add mouse button action and hint
[LLSTRING(unloadObject), localize "STR_DISP_CANCEL", LLSTRING(scrollAction)] call EFUNC(interaction,showMouseHint);
_unit setVariable [QGVAR(deploy), [
_unit, "DefaultAction",
{GVAR(deployPFH) != -1},
{[_this select 0] call FUNC(deployConfirm)}
] call EFUNC(common,addActionEventHandler)];
_unit setVariable [QGVAR(isDeploying), true, true];

View File

@ -64,6 +64,8 @@ if ([_item, _vehicle] call FUNC(canLoadItemIn)) then {
[objNull, _item, true] call EFUNC(common,claim);
[[LSTRING(loadingFailed), [_item, true] call FUNC(getNameItem)], 3] call EFUNC(common,displayTextStructured);
// Fix cancelling loading a carried item
if (!isNull attachedTo _item) then {
detach _item;
@ -76,7 +78,7 @@ if ([_item, _vehicle] call FUNC(canLoadItemIn)) then {
[QEGVAR(common,fixFloating), _item, _item] call CBA_fnc_targetEvent;
};
},
LLSTRING(loadingItem),
format [LLSTRING(loadingItem), [_item, true] call FUNC(getNameItem), getText (configOf _vehicle >> "displayName")],
{
(_this select 0) call FUNC(canLoadItemIn)
},
@ -85,6 +87,9 @@ if ([_item, _vehicle] call FUNC(canLoadItemIn)) then {
true // return
} else {
// Unlock the object
[objNull, _item, true] call EFUNC(common,claim);
[[LSTRING(loadingFailed), [_item, true] call FUNC(getNameItem)], 3] call EFUNC(common,displayTextStructured);
// Fix cancelling loading a carried item

View File

@ -15,18 +15,8 @@
* Public: No
*/
disableSerialization;
private _display = uiNamespace getVariable QGVAR(menuDisplay);
if (isNil "_display") exitWith {};
private _loaded = GVAR(interactionVehicle) getVariable [QGVAR(loaded), []];
if (_loaded isEqualTo []) exitWith {};
// This can be an object or a classname string
private _item = _loaded param [lbCurSel (_display displayCtrl 100), nil];
private _item = call FUNC(getSelectedItem);
if (isNil "_item") exitWith {};
@ -58,13 +48,13 @@ if (GVAR(interactionParadrop)) exitWith {
[LSTRING(unlevelFlightWarning)] call EFUNC(common,displayTextStructured);
};
},
LLSTRING(unloadingItem),
format [LLSTRING(unloadingItem), [_item, true] call FUNC(getNameItem), getText (configOf GVAR(interactionVehicle) >> "displayName")],
{
(_this select 0) params ["", "_target"];
(_this select 0) params ["", "_vehicle"];
if ((acos ((vectorUp _target) select 2)) > 30) exitWith {false}; // check flight level
if (((getPos _target) select 2) < 25) exitWith {false}; // check height
if ((speed _target) < -5) exitWith {false}; // check reverse
if ((acos ((vectorUp _vehicle) select 2)) > 30) exitWith {false}; // check flight level
if (((getPos _vehicle) select 2) < 25) exitWith {false}; // check height
if ((speed _vehicle) < -5) exitWith {false}; // check reverse
true
},
@ -74,7 +64,7 @@ if (GVAR(interactionParadrop)) exitWith {
};
// If in zeus
if (!isNull findDisplay 312) exitWith {
if (!isNull curatorCamera) exitWith {
// Do not check distance to unit, but do check for valid position
if !([_item, GVAR(interactionVehicle), objNull, true] call FUNC(canUnloadItem)) exitWith {
[[LSTRING(unloadingFailed), [_item, true] call FUNC(getNameItem)], 3] call EFUNC(common,displayTextStructured);
@ -109,7 +99,7 @@ if ([_item, GVAR(interactionVehicle), _unit] call FUNC(canUnloadItem)) then {
{
TRACE_1("unload fail",_this);
},
LLSTRING(unloadingItem),
format [LLSTRING(unloadingItem), [_item, true] call FUNC(getNameItem), getText (configOf GVAR(interactionVehicle) >> "displayName")],
{
(_this select 0) params ["_item", "_vehicle", "_unit"];

View File

@ -7,6 +7,9 @@
* 0: Item to be unloaded <STRING> or <OBJECT> (default: "")
* 1: Holder object (vehicle) <OBJECT> (default: objNull)
* 2: Unloader <OBJECT> (default: objNull)
* 3: Deploy parameters <ARRAY> (default: [])
* - 0: Position AGL <ARRAY>
* - 1: Direction <NUMBER>
*
* Return Value:
* Object unloaded <BOOL>
@ -17,8 +20,10 @@
* Public: Yes
*/
params [["_item", "", [objNull, ""]], ["_vehicle", objNull, [objNull]], ["_unloader", objNull, [objNull]]];
TRACE_3("params",_item,_vehicle,_unloader);
params [["_item", "", [objNull, ""]], ["_vehicle", objNull, [objNull]], ["_unloader", objNull, [objNull]], ["_deploy", []]];
_deploy params ["_emptyPosAGL", "_direction"];
TRACE_4("params",_item,_vehicle,_unloader,_deploy);
// Get config sensitive case name
if (_item isEqualType "") then {
@ -41,9 +46,18 @@ if (_itemSize < 0) exitWith {
false // return
};
// This covers testing vehicle stability and finding a safe position
private _emptyPosAGL = [_vehicle, _item, _unloader] call EFUNC(common,findUnloadPosition);
TRACE_1("findUnloadPosition",_emptyPosAGL);
private _deployed = _deploy isNotEqualTo [];
if (!_deployed) then {
// This covers testing vehicle stability and finding a safe position
for "_i" from 1 to 3 do {
_emptyPosAGL = [_vehicle, _item, _unloader] call EFUNC(common,findUnloadPosition);
if (_emptyPosAGL isNotEqualTo []) exitWith {};
};
TRACE_1("findUnloadPosition",_emptyPosAGL);
};
if (_emptyPosAGL isEqualTo []) exitWith {
// Display text saying there are no safe places to exit the vehicle
@ -67,9 +81,12 @@ private _object = _item;
if (_object isEqualType objNull) then {
detach _object;
// hideObjectGlobal must be executed before setPos to ensure light objects are rendered correctly
// Do both on server to ensure they are executed in the correct order
[QGVAR(serverUnload), [_object, _emptyPosAGL]] call CBA_fnc_serverEvent;
// If player unloads via deployment, set direction first, then unload
if (_deployed) then {
[QGVAR(setDirAndUnload), [_object, _emptyPosAGL, _direction], _object] call CBA_fnc_targetEvent;
} else {
[QGVAR(serverUnload), [_object, _emptyPosAGL]] call CBA_fnc_serverEvent;
};
if (["ace_zeus"] call EFUNC(common,isModLoaded)) then {
// Get which curators had this object as editable
@ -81,6 +98,12 @@ if (_object isEqualType objNull) then {
};
} else {
_object = createVehicle [_item, _emptyPosAGL, [], 0, "NONE"];
// If player unloads via deployment, set direction. Must happen before setPosASL command according to wiki
if (_deployed) then {
_object setDir _direction;
};
_object setPosASL (AGLtoASL _emptyPosAGL);
[QEGVAR(common,fixCollision), _object] call CBA_fnc_localEvent;
@ -88,7 +111,9 @@ if (_object isEqualType objNull) then {
};
// Dragging integration
[_unloader, _object] call FUNC(unloadCarryItem);
if (!_deployed) then {
[_unloader, _object] call FUNC(unloadCarryItem);
};
// Invoke listenable event
["ace_cargoUnloaded", [_object, _vehicle, "unload"]] call CBA_fnc_globalEvent;

View File

@ -6,7 +6,7 @@ private _category = [ELSTRING(main,Category_Logistics), LSTRING(openMenu)];
[LSTRING(ModuleSettings_enable), LSTRING(ModuleSettings_enable_Description)],
_category,
true,
true,
1,
{[QGVAR(enable), _this] call EFUNC(common,cbaSettings_settingChanged)}
] call CBA_fnc_addSetting;
@ -16,7 +16,7 @@ private _category = [ELSTRING(main,Category_Logistics), LSTRING(openMenu)];
[LSTRING(loadTimeCoefficient), LSTRING(loadTimeCoefficient_description)],
_category,
[0, 10, 5, 1],
true,
1,
{[QGVAR(loadTimeCoefficient), _this, true] call EFUNC(common,cbaSettings_settingChanged)}
] call CBA_fnc_addSetting;
@ -26,7 +26,7 @@ private _category = [ELSTRING(main,Category_Logistics), LSTRING(openMenu)];
[LSTRING(paradropTimeCoefficent), LSTRING(paradropTimeCoefficent_description)],
_category,
[0, 10, 2.5, 1],
true,
1,
{[QGVAR(paradropTimeCoefficent), _this, true] call EFUNC(common,cbaSettings_settingChanged)}
] call CBA_fnc_addSetting;
@ -36,26 +36,36 @@ private _category = [ELSTRING(main,Category_Logistics), LSTRING(openMenu)];
[LSTRING(openAfterUnload), LSTRING(openAfterUnload_description)],
_category,
[[0, 1, 2, 3], [ELSTRING(common,never), LSTRING(unloadObject), LSTRING(paradropButton), ELSTRING(common,both)], 0],
false,
0,
{[QGVAR(openAfterUnload), _this, true] call EFUNC(common,cbaSettings_settingChanged)}
] call CBA_fnc_addSetting;
[
QGVAR(enableRename),
"CHECKBOX",
[LSTRING(ModuleSettings_enableRename), LSTRING(ModuleSettings_enableRename_Description)],
_category,
true,
false,
{[QGVAR(enableRename), _this, true] call EFUNC(common,cbaSettings_settingChanged)}
] call CBA_fnc_addSetting;
[
QGVAR(carryAfterUnload),
"CHECKBOX",
[LSTRING(carryAfterUnload), LSTRING(carryAfterUnload_description)],
_category,
true,
false,
0,
{[QGVAR(carryAfterUnload), _this] call EFUNC(common,cbaSettings_settingChanged)}
] call CBA_fnc_addSetting;
[
QGVAR(enableDeploy),
"CHECKBOX",
[LSTRING(enableDeploy), LSTRING(enableDeploy_description)],
_category,
true,
1,
{[QGVAR(enableDeploy), _this] call EFUNC(common,cbaSettings_settingChanged)}
] call CBA_fnc_addSetting;
[
QGVAR(enableRename),
"CHECKBOX",
[LSTRING(ModuleSettings_enableRename), LSTRING(ModuleSettings_enableRename_Description)],
_category,
true,
0,
{[QGVAR(enableRename), _this, true] call EFUNC(common,cbaSettings_settingChanged)}
] call CBA_fnc_addSetting;

View File

@ -17,7 +17,7 @@ class GVAR(menu) {
};
class CenterBackground: HeaderBackground {
y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
h = "13.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
h = "14.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
text = "#(argb,8,8,3)color(0,0,0,0.8)";
colorText[] = {0, 0, 0, "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"};
colorBackground[] = {0, 0, 0, "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"};
@ -72,7 +72,7 @@ class GVAR(menu) {
idc = 11;
x = "13.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "14.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "5 * (((safezoneW / safezoneH) min 1.2) / 40)";
w = "6 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)";
@ -96,8 +96,15 @@ class GVAR(menu) {
class btnUnload: btnCancel {
text = CSTRING(unloadObject);
idc = 12;
x = "20.9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
x = "19.9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
action = QUOTE(ACE_player call FUNC(startUnload));
};
class btnPlace: btnUnload {
text = CSTRING(deployObject);
idc = 13;
y = "15.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
action = QUOTE(ACE_player call FUNC(startDeploy));
colorDisabled[] = {0.25, 0.25, 0.25, 1};
};
};
};

View File

@ -33,6 +33,40 @@
<Chinesesimp>卸载</Chinesesimp>
<Turkish>Boşalt</Turkish>
</Key>
<Key ID="STR_ACE_Cargo_deployObject">
<English>Deploy</English>
</Key>
<Key ID="STR_ACE_Cargo_ScrollAction">
<English>Raise/Lower | (Ctrl + Scroll) Rotate</English>
<German>Heben/Senken | (Strg + Scrollen) Drehen</German>
<Italian>Alza/Abbassa | (Ctrl + Rotellina) Ruota</Italian>
<French>Lever/Baisser | (Ctrl + Scroll) Rotation</French>
<Japanese>上げる/下げる | (Ctrl + スクロール) 回転</Japanese>
<Czech>Zvednout/Snížit | (Ctrl + Kolečko myši) Otáčet</Czech>
<Russian>Поднять/опустить | (Ctrl + Скролл) Крутить</Russian>
<Polish>Wyżej/niżej | (Ctrl + Kółko myszy) obracanie</Polish>
<Turkish>Yükselt/Alçalt | (Ctrl + Tekerlek) Döndür</Turkish>
<Spanish>Subir/Bajar | (Ctrl + Scroll) Rotar</Spanish>
<Chinesesimp>抬起/放低 |Ctrl + 鼠标滚轮)旋转</Chinesesimp>
<Korean>높이기/내리기 | (컨트롤 + 스크롤) 회전</Korean>
<Portuguese>Subir/Abaixar | (Ctrl + Scroll) Rotacionar</Portuguese>
</Key>
<Key ID="STR_ACE_Cargo_BlockedAction">
<English>Blocked</English>
<Spanish>Obstruido</Spanish>
<Portuguese>Bloqueado</Portuguese>
<Russian>Заблокировано</Russian>
<Czech>Blokováno</Czech>
<Polish>Zablokowany</Polish>
<Italian>Bloccato</Italian>
<German>Blockiert</German>
<French>Bloqué</French>
<Japanese>取り付け不可</Japanese>
<Korean>막힘</Korean>
<Chinesesimp>断开</Chinesesimp>
<Chinese>斷開</Chinese>
<Turkish>Bloke Edilmiş</Turkish>
</Key>
<Key ID="STR_ACE_Cargo_renamedObject">
<English>Renamed to:&lt;br/&gt;%1</English>
<Japanese>名前を次に変更:&lt;br/&gt;%1</Japanese>
@ -48,7 +82,7 @@
</Key>
<Key ID="STR_ACE_Cargo_clearedCustomName">
<English>Custom name has been cleared.</English>
<Japanese>カスタムネームが削除されました。</Japanese>
<Japanese>カスタムが削除されました。</Japanese>
<French>Le nom personnalisé a été supprimé.</French>
<Russian>Пользовательское название удалено.</Russian>
<German>Eigener Name wurde gelöscht.</German>
@ -108,7 +142,7 @@
<Spanish>Carga</Spanish>
<Italian>Carico</Italian>
<French>Cargaison</French>
<Japanese>カーゴ</Japanese>
<Japanese>貨物</Japanese>
<Korean>화물</Korean>
<Chinese>貨物</Chinese>
<Chinesesimp>货物</Chinesesimp>
@ -124,7 +158,7 @@
<Spanish>Menu de carga</Spanish>
<Italian>Menù del Carico</Italian>
<French>Menu de cargaison</French>
<Japanese>カーゴ メニュー</Japanese>
<Japanese>貨物メニュー</Japanese>
<Korean>화물 메뉴</Korean>
<Chinese>貨物選單</Chinese>
<Chinesesimp>货物菜单</Chinesesimp>
@ -140,7 +174,7 @@
<Spanish>Espacio de carga restante: %1</Spanish>
<Italian>Spazio di carico rimanente: %1</Italian>
<French>Espace de chargement restant : %1</French>
<Japanese>カーゴの空き容量: %1</Japanese>
<Japanese>貨物室の空き容量: %1</Japanese>
<Korean>선적 공간 남음: %1</Korean>
<Chinese>貨物剩餘空間: %1</Chinese>
<Chinesesimp>货物剩余空间:%1</Chinesesimp>
@ -156,7 +190,7 @@
<Spanish>Habilitar carga</Spanish>
<Italian>Abilita Carico</Italian>
<French>Activer la cargaison</French>
<Japanese>カーゴを有効化</Japanese>
<Japanese>貨物を有効化</Japanese>
<Korean>화물 활성화</Korean>
<Chinese>啟用貨物裝載</Chinese>
<Chinesesimp>启用货物装载</Chinesesimp>
@ -172,7 +206,7 @@
<Czech>Umožňuje naložit předměty do nákladového prostoru vozidla</Czech>
<Italian>Abilita il modulo di caricamento nel carico</Italian>
<French>Active la possibilité de charger du matériel dans un module de fret (véhicule/container).</French>
<Japanese>カーゴ モジュールで積み込みを有効化</Japanese>
<Japanese>貨物積載モジュールを有効化</Japanese>
<Korean>화물 모듈을 활성화합니다</Korean>
<Chinese>啟用貨物裝載功能</Chinese>
<Chinesesimp>启用货物装载功能</Chinesesimp>
@ -187,7 +221,7 @@
<Spanish>Ajustes de carga</Spanish>
<Italian>Impostazioni Carico</Italian>
<French>Paramètres de cargaison</French>
<Japanese>カーゴ設定</Japanese>
<Japanese>貨物設定</Japanese>
<Korean>화물 설정</Korean>
<Chinese>貨物設定</Chinese>
<Chinesesimp>货物设定</Chinesesimp>
@ -203,7 +237,7 @@
<Czech>Konfigurace nákladního modulu</Czech>
<Italian>Configura le impostazioni del modulo carico</Italian>
<French>Configure les paramètres du module de cargaison.</French>
<Japanese>カーゴ モジュールの設定を構成</Japanese>
<Japanese>貨物モジュールの設定を変更します</Japanese>
<Korean>화물 모듈의 환경 설정을 바꿉니다</Korean>
<Chinese>配置貨物模塊設定</Chinese>
<Chinesesimp>配置货物模块设定</Chinesesimp>
@ -219,7 +253,7 @@
<Italian>%1&lt;br/&gt;caricato su&lt;br/&gt;%2</Italian>
<Hungarian>%1&lt;br/&gt;berakodva ide:&lt;br/&gt;%2</Hungarian>
<Russian>%1&lt;br/&gt;загружен в&lt;br/&gt;%2</Russian>
<Japanese>%1 &lt;br/&gt;%2 へ&lt;br/&gt;積み込まれました</Japanese>
<Japanese>%1 &lt;br/&gt;%2 に&lt;br/&gt;積み込みました</Japanese>
<Korean>%1은(는)&lt;br/&gt;%2 에 실림</Korean>
<Chinese>%1&lt;br/&gt;裝載至&lt;br/&gt;%2</Chinese>
<Chinesesimp>%1&lt;br/&gt;装载至&lt;br/&gt;%2</Chinesesimp>
@ -235,42 +269,20 @@
<Italian>Hai scaricato&lt;br/&gt;%1 da&lt;br/&gt;%2</Italian>
<Hungarian>1%&lt;br/&gt;kirakodva ebből:&lt;br/&gt;%2</Hungarian>
<Russian>%1&lt;br/&gt;разгружен из&lt;br/&gt;%2</Russian>
<Japanese>%1 &lt;br/&gt;%2 から&lt;br/&gt;降ろされました</Japanese>
<Japanese>%1 &lt;br/&gt;%2 から&lt;br/&gt;降ろしました</Japanese>
<Korean>%1은(는)&lt;br/&gt;%2에서 내려짐</Korean>
<Chinese>&lt;br/&gt;%2卸載&lt;br/&gt;%1</Chinese>
<Chinesesimp>&lt;br/&gt;%2卸载&lt;br/&gt;%1</Chinesesimp>
</Key>
<Key ID="STR_ACE_Cargo_LoadingItem">
<English>Loading Cargo</English>
<German>Belade</German>
<Portuguese>Carregando carga</Portuguese>
<Polish>Ładowanie cargo</Polish>
<Czech>Nakládám</Czech>
<Russian>Погрузка</Russian>
<Italian>Caricando</Italian>
<Spanish>Cargando</Spanish>
<French>Chargement de la cargaison</French>
<Japanese>カーゴへ積み込んでいます</Japanese>
<Korean>화물 싣기</Korean>
<Chinese>裝載貨物中</Chinese>
<Chinesesimp>正在装载货物</Chinesesimp>
<Turkish>Kargo Yükleniyor</Turkish>
<English>Loading %1 into %2...</English>
<Spanish>Cargando %1 en %2...</Spanish>
<Japanese>%1 を %2 に積み込んでいます・・・</Japanese>
</Key>
<Key ID="STR_ACE_Cargo_UnloadingItem">
<English>Unloading Cargo</English>
<German>Entlade</German>
<Portuguese>Descarregando carga</Portuguese>
<Polish>Rozładowywanie cargo</Polish>
<Czech>Vykládám</Czech>
<Russian>Выгрузка</Russian>
<Italian>Scaricando</Italian>
<Spanish>Descargando</Spanish>
<French>Déchargement de la cargaison</French>
<Japanese>カーゴから降ろしています</Japanese>
<Korean>화물 내리기</Korean>
<Chinese>卸載貨物中</Chinese>
<Chinesesimp>正在卸载货物</Chinesesimp>
<Turkish>Kargo Boşaltılıyor</Turkish>
<English>Unloading %1 from %2...</English>
<Spanish>Descargando %1 de %2...</Spanish>
<Japanese>%1 を %2 から降ろしています・・・</Japanese>
</Key>
<Key ID="STR_ACE_Cargo_LoadingFailed">
<English>%1&lt;br/&gt;could not be loaded</English>
@ -309,7 +321,7 @@
<German>Kann nicht entladen werden</German>
<Italian>Impossibile da scaricare</Italian>
<French>Ne peut pas être déchargé</French>
<Japanese>降ろせません</Japanese>
<Japanese>荷降ろし不可能です</Japanese>
<Korean>하역할 수가 없습니다</Korean>
</Key>
<Key ID="STR_ACE_Cargo_SizeMenu">
@ -317,12 +329,12 @@
<German>Frachtgröße: %1</German>
<Italian>Dimensione Carico: %1</Italian>
<French>Encombrement fret: %1</French>
<Japanese>カーゴ サイズ: %1</Japanese>
<Japanese>貨物のサイズ: %1</Japanese>
<Korean>화물 크기: %1</Korean>
</Key>
<Key ID="STR_ACE_Cargo_customName_edenName">
<English>Custom Name</English>
<Japanese>カスタムネーム</Japanese>
<Japanese>カスタム</Japanese>
<French>Nom personnalisé</French>
<German>Eigener Name</German>
<Italian>Nome Personalizzato</Italian>
@ -335,7 +347,7 @@
</Key>
<Key ID="STR_ACE_Cargo_customName_edenDesc">
<English>Set a custom cargo name used in the cargo interface.</English>
<Japanese>カーゴ一覧で使用されるカスタムネームを設定します。</Japanese>
<Japanese>貨物インターフェイスで使用されるカスタム名を設定します。</Japanese>
<French>Définit un nom de fret personnalisé qui sera visible dans le menu de cargaison.</French>
<Russian>Установить пользовательское имя груза, используемое в интерфейсе погрузки.</Russian>
<German>Definiere eigenen Frachtnamen, welcher im Frachtraum genutzt wird.</German>
@ -350,7 +362,7 @@
<English>Cargo Space</English>
<German>Frachtraum</German>
<Italian>Spazio di Carico</Italian>
<Japanese>カーゴ スペース</Japanese>
<Japanese>貨物室の容量</Japanese>
<Chinese>貨物空間</Chinese>
<Chinesesimp>货物空间</Chinesesimp>
<Polish>Przestrzeń ładunkowa</Polish>
@ -366,7 +378,7 @@
<English>The cargo space available in this vehicle/container</English>
<German>Verfügbarer Frachtraum in diesem Fahrzeug/Container</German>
<Italian>Lo spazio disponibile in questo veicolo/container</Italian>
<Japanese>この車両/コンテナでカーゴ スペースを使えるようにします</Japanese>
<Japanese>この車両/コンテナで使用可能な貨物室の容量</Japanese>
<Chinese>設定此載具/集裝箱可裝載多少貨物</Chinese>
<Chinesesimp>设定此载具/集装箱可装载多少货物</Chinesesimp>
<Polish>Dostępna przestrzeń ładunkowa w tym pojeździe/kontenerze</Polish>
@ -381,7 +393,7 @@
<English>Cargo Size</English>
<German>Frachtgröße</German>
<Italian>Dimensioni nel Carico</Italian>
<Japanese>カーゴ サイズ</Japanese>
<Japanese>貨物のサイズ</Japanese>
<Chinese>貨物的大小</Chinese>
<Chinesesimp>货物的大小</Chinesesimp>
<Polish>Wielkość ładunku</Polish>
@ -397,7 +409,7 @@
<English>The cargo space required to hold this object (-1 for not loadable)</English>
<German>Frachtraumgröße, welche zum Einladen dieses Objektes benötigt wird (-1 nicht einladbar)</German>
<Italian>Lo spazio di carico necessario per contenere questo oggetto (-1 per non caricabile)</Italian>
<Japanese>オブジェクトを積載するのに必要なカーゴ スペース (-1 で積載不可にします)</Japanese>
<Japanese>このオブジェクトの積載に必要な貨物室の容量 (-1 で積載不可に)</Japanese>
<Chinese>此貨物會佔掉多少空間(設定-1的話此貨物就不能被裝載)</Chinese>
<Chinesesimp>此货物会占掉多少空间(设定 -1 的话此货物就不能被装载)</Chinesesimp>
<Polish>Wymagana przestrzeń ładunkowa dla tego obiektu (-1 dla niemożliwych do załadowania)</Polish>
@ -456,7 +468,7 @@
<Key ID="STR_ACE_Cargo_paradropTimeCoefficent_description">
<English>Modifier for how long it takes to paradrop a cargo item.</English>
<German>Beeinflusst die zusätzliche Zeit für Türlastabwürfe.</German>
<Japanese>カーゴ アイテムを空中投下するまでの時間を変更します。</Japanese>
<Japanese>貨物の空中投下に掛かる時間を変更します。</Japanese>
<Italian>Modifica quanto tempo viene impiegato per paracadutare oggetti dal carico.</Italian>
<French>Modifie le temps nécessaire au paralargage d'une cargaison.</French>
<Chinese>設定空投所需消耗的時間</Chinese>
@ -471,7 +483,7 @@
<Key ID="STR_ACE_Cargo_loadTimeCoefficient">
<English>Load Time Coefficient</English>
<German>Ladezeitmultiplikator</German>
<Japanese>積載所要時間係数</Japanese>
<Japanese>積載所要時間係数</Japanese>
<Polish>Współczynnik czasu załadowania</Polish>
<Italian>Coefficente Tempo Caricamento</Italian>
<Russian>Коэф. времени погрузки</Russian>
@ -486,7 +498,7 @@
<Key ID="STR_ACE_Cargo_loadTimeCoefficient_description">
<English>Modifies how long it takes to load/unload items.\nTime, in seconds, is the size of the item multiplied by this value.</English>
<German>Gibt an, wie lange das Laden / Entladen von Gegenständen dauern soll.\nZeit in Sekunden, die mit der Größe des Gegenstandes multipliziert wird.</German>
<Japanese>アイテムのロード/アンロードに掛かる時間を変更します。\n時間 (秒) は、アイテムのサイズにこの値を掛けたものです。</Japanese>
<Japanese>貨物の積み込み/積み下ろしに掛かる時間を変更します。\n時間 (秒) は、貨物のサイズにこの値を掛けたものです。</Japanese>
<Polish>Modyfikuje, jak długo zajmuje załadowywanie/wyładowywanie przedmiotów. \nCzasem, w sekundach, jest wielkość przedmiotu razy jego wartość.</Polish>
<Italian>Modifica il tempo impiegato per caricare o scaricare gli oggetti.\nIl tempo, in secondi, equivale alla dimensione dell'oggetto moltiplicata per questo valore</Italian>
<Russian>Изменяет время для загрузки/выгрузки предметов. \n Время (сек) - это размер предмета, умноженный на это значение.</Russian>
@ -501,7 +513,7 @@
<Key ID="STR_ACE_Cargo_openAfterUnload">
<English>Reopen Cargo Menu</English>
<Turkish>Kargo Menüsünü Tekrar Aç</Turkish>
<Japanese>カーゴ メニューを再度開く</Japanese>
<Japanese>貨物メニューを再度開く</Japanese>
<French>Rouvrir le menu de cargaison</French>
<Russian>Переоткрыть меню погрузки</Russian>
<German>Frachtmenü erneut öffnen</German>
@ -515,7 +527,7 @@
<Key ID="STR_ACE_Cargo_openAfterUnload_description">
<English>Reopen the Cargo Menu after successful unload.</English>
<Turkish>Başarılı bir yük indirmeden sonra Kargo Menüsünü tekrar göster.</Turkish>
<Japanese>カーゴを降ろした後に再びカーゴ メニューを開きます。</Japanese>
<Japanese>貨物を降ろした後に再び貨物メニューを開きます。</Japanese>
<French>Réouvre le menu de cargaison après un déchargement réussi.</French>
<Russian>Переоткрыть меню погрузки после успешной выгрузки.</Russian>
<German>Frachtmenü erneut öffnen, nach erfolgreichen Entladen.</German>
@ -531,7 +543,7 @@
<Korean>화물 내린 후 운반</Korean>
<Russian>Нести после выгрузки</Russian>
<Spanish>Llevar encima tras la descarga</Spanish>
<Japanese>荷降ろし後の運搬</Japanese>
<Japanese>荷降ろし後に持ち運ぶ</Japanese>
<Polish>Niesienie Po Rozładowaniu</Polish>
<German>Nach dem Entladen tragen</German>
<Italian>Trasporta dopo aver Scaricato</Italian>
@ -543,12 +555,18 @@
<Korean>화물 아이템을 내린 후 들거나 끌지 여부를 결정합니다.</Korean>
<Russian>Нужно ли переносить или тащить предметы после их выгрузки.</Russian>
<Spanish>Controla si los objetos de carga son llevados encima o arrastrados despues de la descarga.</Spanish>
<Japanese>荷降ろし後、貨物アイテムを運ぶか引きずるかを制御する。</Japanese>
<Japanese>荷降ろし後、貨物を運ぶか引きずるかを制御する。</Japanese>
<Polish>Kontroluje, czy przedmioty z ładunku są przenoszone lub ciągnięte po ich wyładowaniu.</Polish>
<German>Steuert, ob Objekte nach dem Entladen getragen oder gezogen werden.</German>
<Italian>Determina se un oggetto verrà subito trasportato o trascinato dopo essere stato scaricato.</Italian>
<French>Active si les éléments de cargaison sont portés ou traînés après le déchargement.</French>
<Portuguese>Controla se os itens de carga são carregados ou arrastados após a descarga.</Portuguese>
</Key>
<Key ID="STR_ACE_Cargo_enableDeploy">
<English>Enable deploy</English>
</Key>
<Key ID="STR_ACE_Cargo_enableDeploy_description">
<English>Controls whether cargo items can be unloaded via the deploy method.</English>
</Key>
</Package>
</Project>

View File

@ -29,7 +29,7 @@
["blockRadio", false, [QEGVAR(captives,Handcuffed), QEGVAR(captives,Surrendered), "ace_unconscious"]] call FUNC(statusEffect_addType);
["blockSpeaking", false, ["ace_unconscious"]] call FUNC(statusEffect_addType);
["disableWeaponAssembly", false, ["ace_common", "ace_common_lockVehicle", "ace_csw"]] call FUNC(statusEffect_addType);
["lockInventory", true, []] call FUNC(statusEffect_addType);
["lockInventory", true, [], true] call FUNC(statusEffect_addType);
[QGVAR(forceWalk), {
params ["_object", "_set"];
@ -96,7 +96,7 @@
_object setVariable ["acre_sys_core_isDisabled", _set > 0, true];
};
if (["task_force_radio"] call FUNC(isModLoaded)) then {
_object setVariable ["tf_voiceVolume", [1, 0] select (_set > 0), true];
_object setVariable ["tf_voiceVolume", parseNumber (_set == 0), true];
};
}] call CBA_fnc_addEventHandler;
@ -142,7 +142,7 @@ if (isServer) then {
if ((!isNil "_zeusLogic") && {!isNull _zeusLogic}) then {
{
if ((_x getvariable ["bis_fnc_moduleRemoteControl_owner", objnull]) isEqualTo _dcPlayer) exitWith {
INFO_3("[%1] DC - Was Zeus [%2] while controlling unit [%3] - manually clearing `bis_fnc_moduleRemoteControl_owner`", [_x] call FUNC(getName), _dcPlayer, _x);
INFO_3("[%1] DC - Was Zeus [%2] while controlling unit [%3] - manually clearing `bis_fnc_moduleRemoteControl_owner`",[_x] call FUNC(getName),_dcPlayer,_x);
_x setVariable ["bis_fnc_moduleRemoteControl_owner", nil, true];
};
nil

View File

@ -32,6 +32,7 @@ ACE_COUNTERS = [];
GVAR(statusEffect_Names) = [];
GVAR(statusEffect_isGlobal) = [];
GVAR(statusEffect_sendJIP) = [];
GVAR(setHearingCapabilityMap) = [];

View File

@ -5,7 +5,7 @@
if (isFilePatchingEnabled) then {
private _notLoaded = configProperties [configfile >> "ace_notLoaded", "isText _x"];
{
INFO_2("%1 not loaded because %2",configName _x, getText _x);
INFO_2("%1 not loaded because %2",configName _x,getText _x);
} forEach _notLoaded;
};

File diff suppressed because it is too large Load Diff

View File

@ -18,11 +18,11 @@ private _allUnits = [];
{
private _class = configFile >> "CfgVehicles" >> _x;
if (isNull _class) then {
WARNING_1("in units[] but null - %1", _x);
WARNING_1("in units[] but null - %1",_x);
_testPass = false;
} else {
// if (((getNumber (_class >> "scope")) != 2) && {((getNumber (_class >> "scopeCurator")) != 2)}) then {
// WARNING_2("in units[] but not public - %1 from %2", configName _class, configSourceMod _class);
// WARNING_2("in units[] but not public - %1 from %2",configName _class,configSourceMod _class);
// _testPass = false;
// };
};
@ -36,11 +36,11 @@ private _allWeapons = [];
{
private _class = configFile >> "CfgWeapons" >> _x;
if (isNull _class) then {
WARNING_1("in weapons[] but null - %1", _x);
WARNING_1("in weapons[] but null - %1",_x);
_testPass = false;
} else {
// if (((getNumber (_class >> "scope")) != 2) && {((getNumber (_class >> "scopeCurator")) != 2)}) then {
// WARNING_2("in weapons[] but not public - %1 from %2", configName _class, configSourceMod _class);
// WARNING_2("in weapons[] but not public - %1 from %2",configName _class,configSourceMod _class);
// _testPass = false;
// };
};
@ -51,7 +51,7 @@ private _vics = "(configName _x) select [0,3] == 'ace'" configClasses (configFil
{
if (((getNumber (_x >> "scope")) == 2) || {((getNumber (_x >> "scopeCurator")) == 2)}) then {
if (!((toLower configName _x) in _allUnits)) then {
WARNING_2("Not in any units[] - %1 from %2", configName _x, configSourceMod _x);
WARNING_2("Not in any units[] - %1 from %2",configName _x,configSourceMod _x);
_testPass = false;
};
};
@ -63,7 +63,7 @@ private _weapons = "(configName _x) select [0,3] == 'ace'" configClasses (config
private _type = toLower configName _x;
if (((getNumber (_x >> "scope")) == 2) || {((getNumber (_x >> "scopeCurator")) == 2)}) then {
if (!((toLower configName _x) in _allWeapons)) then {
WARNING_2("Not in any weapons[] - %1 from %2", configName _x, configSourceMod _x);
WARNING_2("Not in any weapons[] - %1 from %2",configName _x,configSourceMod _x);
_testPass = false;
};
};

View File

@ -27,7 +27,7 @@ if (isServer) then {
params ["_eventName", "_client"];
if !(_eventName in GVAR(syncedEvents)) exitWith {
ERROR_1("Request for synced event - key [%1] not found.", _eventName);
ERROR_1("Request for synced event - key [%1] not found.",_eventName);
false
};

View File

@ -20,7 +20,7 @@
params ["_name", "_args", "_ttl"];
if !(_name in GVAR(syncedEvents)) exitWith {
ERROR_1("Synced event key [%1] not found (_handleSyncedEvent).", _name);
ERROR_1("Synced event key [%1] not found (_handleSyncedEvent).",_name);
false
};

View File

@ -22,7 +22,7 @@ private _output = [format ["// CBA Settings [ADDON: %1]:", _addon]];
private _addonSearch = _addon + "_";
private _addonSearchCount = count _addonSearch;
TRACE_2("",_addonSearch, _addonSearchCount);
TRACE_2("",_addonSearch,_addonSearchCount);
private _settings = configProperties [configFile >> "ACE_Settings", "(isClass _x) && {((configName _x) select [0, _addonSearchCount]) == _addonSearch}"];

View File

@ -34,7 +34,7 @@ private _aceSettings = configProperties [configFile >> "ACE_Settings", "isClass
if (_isClientSettable && {_currentValue isNotEqualTo _profileVar}) then {
// CBA_settings_fnc_set will do type checking for the old profile var
private _ret = [_settingName, _profileVar, 0, "client", true] call CBA_settings_fnc_set;
INFO_3("Transfering setting [%1: %2] returned %3", _settingName, _profileVar, _ret);
INFO_3("Transfering setting [%1: %2] returned %3",_settingName,_profileVar,_ret);
};
};
} forEach _aceSettings;

View File

@ -80,7 +80,7 @@ if (_oldCompats isNotEqualTo []) then {
_oldCompats = _oldCompats apply {format ["%1 (%2)", _x select 0, _x select 1]};
[{
// Lasts for ~10 seconds
ERROR_WITH_TITLE_3("The following ACE compatiblity PBOs are outdated", "%1. ACE Main version is %2 from %3.",_this select 0,_this select 1,_this select 2);
ERROR_WITH_TITLE_3("The following ACE compatiblity PBOs are outdated","%1. ACE Main version is %2 from %3.",_this select 0,_this select 1,_this select 2);
}, [_oldCompats, _mainVersion, _mainSource], 1] call CBA_fnc_waitAndExecute;
};

View File

@ -1,7 +1,7 @@
#include "..\script_component.hpp"
/*
* Author: commy2, PabstMirror
* Unit claims the ownership over an object. This is used to prevent multiple players from draging the same ammo box or using up the same wheel when repairing etc.
* Unit claims the ownership over an object. This is used to prevent multiple players from dragging the same ammo box or using up the same wheel when repairing etc.
* This function only runs on the server and handles the "ace_common_claimSafe" event. It provides a network safe way claiming objects as all claims are run on server.
* Return event is passed [_unit, _target, _success] for new claims, no event on claim release
*

View File

@ -219,7 +219,7 @@ if (_state) then {
_keyPressedInfo set [1, ((_keyPressedInfo select 1) - 1) max 0];
if (_keyPressedInfo isEqualTo [false, 0]) then {
GVAR(keyboardInputMain) deleteAt _key,
GVAR(keyboardInputMain) deleteAt _key;
};
}, _key, 0.5] call CBA_fnc_waitAndExecute;
}];

View File

@ -24,7 +24,7 @@
BEGIN_COUNTER(firedEH);
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile"];
TRACE_7("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile);
TRACE_7("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
if (_unit isKindOf "CAManBase") then {
// The unit it on foot

View File

@ -27,7 +27,7 @@ if (getNumber (_unitAnimationCfg >> "terminal") == 1) exitWith {_animationState}
private _unitActionsCfg = configFile >> "CfgMovesBasic" >> "Actions" >> getText (_unitAnimationCfg >> "actions");
TRACE_2("Animation/Action", configName _unitAnimationCfg, configName _unitActionsCfg);
TRACE_2("Animation/Action",configName _unitAnimationCfg,configName _unitActionsCfg);
if (vehicle _unit != _unit) then {
private _interpolateArray = getArray (_unitAnimationCfg >> "interpolateTo");

View File

@ -25,7 +25,7 @@ private _pov = getText (_turret >> "memoryPointGunnerOptics");
private _gunBeg = getText (_turret >> "gunBeg");
private _gunEnd = getText (_turret >> "gunEnd");
TRACE_3("", _pov, _gunBeg, _gunEnd);
TRACE_3("",_pov,_gunBeg,_gunEnd);
// Pull the PIP pov or barrel direction, depending on how the model is set up
private _povPos = _vehicle modelToWorldVisualWorld (_vehicle selectionPosition _pov);

View File

@ -17,4 +17,4 @@
params [["_vehicle", objNull, [objNull]]];
crew _vehicle select {getText (configOf _x >> "simulation") == "UAVPilot"} // return
(crew _vehicle) select {unitIsUAV _x} // return

View File

@ -5,10 +5,10 @@
*
* Arguments:
* 0: The Unit (usually the player) <OBJECT>
* 1: Force a return type <SCALAR, BOOLEAN>
* 1: Return imperial units <NUMBER, BOOLEAN>
*
* Return Value:
* The return value <NUMBER>
* Weight string <STRING>
*
* Example:
* [player] call ace_common_fnc_getWeight

View File

@ -22,7 +22,7 @@ params ["_soundClass", "_posASL", "_volume", "_distance"];
private _sound = getArray (configFile >> "CfgSounds" >> _soundClass >> "sound");
if (_sound isEqualTo []) exitWith {
ERROR_1("CfgSounds class [%1] does not exist or contains empty sound array", _soundClass);
ERROR_1("CfgSounds class [%1] does not exist or contains empty sound array",_soundClass);
};
TRACE_2("sound",_soundClass,_sound);

View File

@ -23,7 +23,7 @@ params ["_logic", "_settingName", "_moduleVariable"];
// Check if the variable is already defined
if (isNil _settingName) exitWith {
ERROR_1("readSettingFromModule - param [%1] is not an ace_setting", _settingName);
ERROR_1("readSettingFromModule - param [%1] is not an ace_setting",_settingName);
};
// Check if the parameter is defined in the module

View File

@ -32,7 +32,7 @@ TRACE_1("Reading missionConfigFile params",_paramsArray);
// Check if the variable is already defined
if (isNil _settingName) exitWith {
ERROR_1("readSettingsFromParamsArray - param [%1] is not an ace_setting", _settingName);
ERROR_1("readSettingsFromParamsArray - param [%1] is not an ace_setting",_settingName);
};
// The setting is not forced, so update the value
@ -52,7 +52,7 @@ TRACE_1("Reading missionConfigFile params",_paramsArray);
};
if (!_validValue) exitWith {
WARNING_3("readSettingsFromParamsArray - param [%1] type not valid [%2] - expected type [%3]", _settingName,_settingValue,_settingType);
WARNING_3("readSettingsFromParamsArray - param [%1] type not valid [%2] - expected type [%3]",_settingName,_settingValue,_settingType);
};
if ([_settingName, "mission"] call CBA_settings_fnc_isForced) then {

View File

@ -31,7 +31,7 @@ if (isLocalized _requestMessage) then {
_requestMessage = format [_requestMessage, [_caller, false, true] call FUNC(getName)];
};
hint format ["%1", _requestMessage]; // @todo ?
hint str _requestMessage; // @todo ?
if (!isNil QGVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT)) then {
terminate GVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT);

View File

@ -18,7 +18,7 @@
params ["_name"];
if !(_name in GVAR(syncedEvents)) exitWith {
ERROR_1("Synced event key [%1] not found (removeSyncedEventHandler).", _name);
ERROR_1("Synced event key [%1] not found (removeSyncedEventHandler)",_name);
false
};

View File

@ -22,7 +22,7 @@ private _startTime = diag_tickTime;
private _fails = [];
private _total = 0;
INFO_1("ace_common_fnc_runTests starting for [%1]", _specificTest);
INFO_1("ace_common_fnc_runTests starting for [%1]",_specificTest);
{
private _testName = configName _x;
@ -41,8 +41,8 @@ INFO_1("ace_common_fnc_runTests starting for [%1]", _specificTest);
};
} forEach (configProperties [configFile >> "ACE_Tests"]);
INFO_1("ace_common_fnc_runTests finished in %1 ms", (1000 * (diag_tickTime - _startTime)) toFixed 1);
INFO_2("[%1 / %2] Tests Passed", (_total - (count _fails)), _total);
INFO_1("ace_common_fnc_runTests finished in %1 ms",(1000 * (diag_tickTime - _startTime)) toFixed 1);
INFO_2("[%1 / %2] Tests Passed",(_total - (count _fails)),_total);
if (_fails isNotEqualTo []) then {
INFO_1("Failed: %1", _fails);
INFO_1("Failed: %1",_fails);
};

View File

@ -38,4 +38,4 @@ if (abs(_value - _oldValue) < _tolerance) exitWith {};
_object setVariable [_varName, _value, true];
_object setVariable [_oldVarName, _value];
TRACE_2("Published variable:", _varName, _value);
TRACE_2("Published variable:",_varName,_value);

View File

@ -34,7 +34,7 @@ if (_object isEqualTo (_object getVariable [format ["ACE_onEmbargo_%1", _varName
_object setVariable [_varName, _value, true];
_object setVariable [format ["ACE_onEmbargo_%1", _varName], _object];
TRACE_2("Starting Embargo", _varName, _delay);
TRACE_2("Starting Embargo",_varName,_delay);
[{
params ["_object", "_varName", "_value"];
@ -43,7 +43,7 @@ TRACE_2("Starting Embargo", _varName, _delay);
_object setVariable [format ["ACE_onEmbargo_%1", _varName], nil]; //Remove Embargo
private _curValue = _object getVariable _varName;
TRACE_4("End of embargo", _object, _varName, _value, _curValue);
TRACE_4("End of embargo",_object,_varName,_value,_curValue);
//If value at start of embargo doesn't equal current, then broadcast and start new embargo
if (_value isNotEqualTo _curValue) then {

View File

@ -41,11 +41,11 @@ if (isArray (missionConfigFile >> "showHUD")) then {
if (_reason != "") then {
_reason = toLower _reason;
if (_mask isEqualTo []) then {
TRACE_2("Removing", _reason, _mask);
TRACE_2("Removing",_reason,_mask);
GVAR(showHudHash) deleteAt _reason;
} else {
while {(count _mask) < 10} do { _mask pushBack true; };
TRACE_2("Setting", _reason, _mask);
TRACE_2("Setting",_reason,_mask);
GVAR(showHudHash) set [_reason, _mask];
};
};
@ -63,7 +63,7 @@ for "_index" from 0 to 9 do {
_resultMask pushBack _set;
};
TRACE_2("showHud", _resultMask, keys GVAR(showHudHash));
TRACE_2("showHud",_resultMask,keys GVAR(showHudHash));
showHud _resultMask;
_resultMask

View File

@ -5,8 +5,9 @@
*
* Arguments:
* 0: Status Effect Name, this should match a corresponding event name <STRING>
* 1: Send event globaly <BOOL>
* 1: Send event globally <BOOL>
* 2: Common Effect Reaons to pre-seed durring init <ARRAY>
* 3: Send event to JIP (requires sending event globally) <BOOL>
*
* Return Value:
* None
@ -17,14 +18,16 @@
* Public: No
*/
params [["_name", "", [""]], ["_isGlobal", false, [false]], ["_commonReasonsArray", [], [[]]]];
params [["_name", "", [""]], ["_isGlobal", false, [false]], ["_commonReasonsArray", [], [[]]], ["_sendJIP", false, [false]]];
TRACE_3("params",_name,_isGlobal,_commonReasonsArray);
if (_name == "") exitWith {ERROR_1("addStatusEffect - Bad Name %1", _this)};
if (_name in GVAR(statusEffect_Names)) exitWith {WARNING_1("addStatusEffect - Effect Already Added (note, will not update global bit) %1", _this)};
if (_name == "") exitWith {ERROR_1("addStatusEffect - Bad Name %1",_this)};
if (_name in GVAR(statusEffect_Names)) exitWith {WARNING_1("addStatusEffect - Effect Already Added (note, will not update global bit) %1",_this)};
if (_sendJIP && !_isGlobal) exitWith {WARNING_1("addStatusEffect - Trying to add non-global JIP effect %1",_this)};
GVAR(statusEffect_Names) pushBack _name;
GVAR(statusEffect_isGlobal) pushBack _isGlobal;
GVAR(statusEffect_sendJIP) pushBack _sendJIP;
//We add reasons at any time, but more efficenet to add all common ones at one time during init
if (isServer && {_commonReasonsArray isNotEqualTo []}) then {

View File

@ -22,12 +22,12 @@ TRACE_2("params",_object,_isLocal);
//Only run this after the settings are initialized
//Need to wait for all EH to be installed (local event will happen between pre and post init)
if !(GVAR(settingsInitFinished)) exitWith {
TRACE_1("pushing to runAtSettingsInitialized", _this);
TRACE_1("pushing to runAtSettingsInitialized",_this);
GVAR(runAtSettingsInitialized) pushBack [FUNC(statusEffect_localEH), _this];
};
if (!_isLocal) exitWith {TRACE_1("object no longer local", _this)};
if (isNull _object) exitWith {TRACE_1("object null", _this)};
if (!_isLocal) exitWith {TRACE_1("object no longer local",_this)};
if (isNull _object) exitWith {TRACE_1("object null",_this)};
//Reset any variables because of respawn
[_object, false] call FUNC(statusEffect_resetVariables);

View File

@ -21,12 +21,12 @@ TRACE_1("params",_object);
//Only run this after the settings are initialized
//Need to wait for all EH to be installed (local event will happen between pre and post init)
if !(GVAR(settingsInitFinished)) exitWith {
TRACE_1("pushing to runAtSettingsInitialized", _this);
TRACE_1("pushing to runAtSettingsInitialized",_this);
GVAR(runAtSettingsInitialized) pushBack [FUNC(statusEffect_respawnEH), _this];
};
if (!local _object) exitWith {TRACE_1("object no longer local", _this)};
if (isNull _object) exitWith {TRACE_1("object null", _this)};
if (!local _object) exitWith {TRACE_1("object no longer local",_this)};
if (isNull _object) exitWith {TRACE_1("object null",_this)};
//Reset any variables on "real" respawn
[_object, false] call FUNC(statusEffect_resetVariables);

View File

@ -30,12 +30,21 @@ if (isNull _object) exitWith {};
TRACE_2("checking if event is nil",_x,_effectNumber);
if (_effectNumber != -1) then {
private _eventName = format [QGVAR(%1), _x];
if (GVAR(statusEffect_isGlobal) select _forEachIndex) then {
TRACE_2("Sending Global Event", _object, _effectNumber);
[_eventName, [_object, _effectNumber]] call CBA_fnc_globalEvent;
} else {
TRACE_2("Sending Target Event", _object, _effectNumber);
[_eventName, [_object, _effectNumber], _object] call CBA_fnc_targetEvent;
switch (true) do {
case (GVAR(statusEffect_sendJIP) select _forEachIndex): {
TRACE_2("Sending Global JIP Event",_object,_effectNumber);
private _jipID = format [QGVAR(effect_%1_%2), _eventName, hashValue _object];
[_eventName, [_object, _effectNumber], _jipID] call CBA_fnc_globalEventJIP;
[_jipID, _object] call CBA_fnc_removeGlobalEventJIP;
};
case (GVAR(statusEffect_isGlobal) select _forEachIndex): {
TRACE_2("Sending Global Event",_object,_effectNumber);
[_eventName, [_object, _effectNumber]] call CBA_fnc_globalEvent;
};
default {
TRACE_2("Sending Target Event",_object,_effectNumber);
[_eventName, [_object, _effectNumber], _object] call CBA_fnc_targetEvent;
};
};
};
};

View File

@ -23,7 +23,7 @@ TRACE_4("params",_object,_effectName,_ID,_set);
//Only run this after the settings are initialized
if !(GVAR(settingsInitFinished)) exitWith {
TRACE_1("pushing to runAtSettingsInitialized", _this);
TRACE_1("pushing to runAtSettingsInitialized",_this);
GVAR(runAtSettingsInitialized) pushBack [FUNC(statusEffect_set), _this];
};

View File

@ -20,7 +20,7 @@
params ["_name", "_args", ["_ttl", 0]];
if !(_name in GVAR(syncedEvents)) exitWith {
ERROR_1("Synced event key [%1] not found (syncedEvent).", _name);
ERROR_1("Synced event key [%1] not found (syncedEvent)",_name);
false
};

View File

@ -35,7 +35,7 @@ if (_emptyPos isEqualTo []) then {
};
if (count _emptyPos != 3) exitwith {
WARNING_4("Could not find unload pos %1-ASL: %2 isTouchingGround: %3 Speed: %4",_vehicle, getPosASL _vehicle, isTouchingGround _vehicle, speed _vehicle);
WARNING_4("Could not find unload pos %1-ASL: %2 isTouchingGround: %3 Speed: %4",_vehicle,getPosASL _vehicle,isTouchingGround _vehicle,speed _vehicle);
if ((!isNull _unloader) && {[_unloader] call FUNC(isPlayer)}) then {
//display text saying there are no safe places to exit the vehicle
[QGVAR(displayTextStructured), [localize LSTRING(NoRoomToUnload)], [_unloader]] call CBA_fnc_targetEvent;

View File

@ -1641,7 +1641,7 @@
<French>Renommer</French>
<German>Umbenennen</German>
<Polish>Zmień nazwę</Polish>
<Japanese></Japanese>
<Japanese>前変更</Japanese>
<Italian>Rinomina</Italian>
<Korean>이름 바꾸기</Korean>
<Chinese>重新命名</Chinese>

View File

@ -0,0 +1 @@
z\ace\addons\compat_cup_terrains

View File

@ -0,0 +1,5 @@
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_SCRIPT(XEH_postInit));
};
};

View File

@ -0,0 +1,48 @@
class CfgVehicles {
class House;
class House_Small_F;
class Strategic;
class House_EP1: House {};
class Land_Benzina_schnell: House {
transportFuel = 0;
EGVAR(refuel,hooks)[] = {{-1.5,-3.93,-1.25}, {2.35,-3.93,-1.25}};
EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL;
class ACE_Actions {
class ACE_MainActions {
displayName = ECSTRING(interaction,MainAction);
position = "[0,-3.93,-1.25]";
distance = 5;
condition = "true";
};
};
};
class Land_A_FuelStation_Feed: Strategic {
transportFuel = 0;
EGVAR(refuel,hooks)[] = {{-0.34,0,0}, {0.34,0,0}};
EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL;
};
class Land_Ind_FuelStation_Feed_EP1: House_EP1 {
transportFuel = 0;
EGVAR(refuel,hooks)[] = {{-0.34,0,0}, {0.34,0,0}};
EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL;
};
class Land_FuelStation_Feed_PMC: Strategic {
transportFuel = 0;
EGVAR(refuel,hooks)[] = {{-0.34,0,0}, {0.34,0,0}};
EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL;
};
class FuelStation: House_Small_F {
transportFuel = 0;
EGVAR(refuel,hooks)[] = {{1.25, .2, -1.1}};
EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL;
class ACE_Actions {
class ACE_MainActions {
displayName = ECSTRING(interaction,MainAction);
position = "[1.25, .2, -1]";
distance = 5;
condition = "true";
};
};
};
};

View File

@ -0,0 +1,5 @@
#include "script_component.hpp"
if (["CUP_Terrains_ACE_compat"] call EFUNC(common,isModLoaded)) exitWith {
ERROR_WITH_TITLE("Duplicate CUP/ACE Compats","Compats are now part of ACE - Uninstall 'CUP ACE3 Compatibility Addon - Terrains'");
};

Some files were not shown because too many files have changed in this diff Show More