Skip to content

Commit

Permalink
Merge branch 'master' into release-3.16.2
Browse files Browse the repository at this point in the history
  • Loading branch information
PabstMirror committed Jan 8, 2024
2 parents effbaed + e9cb274 commit 4924ea6
Show file tree
Hide file tree
Showing 115 changed files with 1,871 additions and 548 deletions.
3 changes: 3 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ branches:
name-template: 'Version $NEXT_PATCH_VERSION'
tag-template: 'v$NEXT_PATCH_VERSION'

sort-by: title # sort alphabetically
sort-direction: ascending

categories:
- title: '**ADDED:**'
labels:
Expand Down
3 changes: 0 additions & 3 deletions .hemtt/project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ exclude = [
"zeus/functions/fnc_zeusAttributes.sqf",
]

[hemtt.config]
preset = "Hemtt"

[hemtt.launch]
workshop = [
"450814997", # CBA_A3
Expand Down
4 changes: 2 additions & 2 deletions addons/advanced_fatigue/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ if (!hasInterface) exitWith {};
}, true] call CBA_fnc_addPlayerEventHandler;

// - Duty factors -------------------------------------------------------------
if (["ACE_Medical"] call EFUNC(common,isModLoaded)) then {
if (["ace_medical"] call EFUNC(common,isModLoaded)) 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);
[QEGVAR(medical,bloodVolume), { // 6->1.0, 5->1.167, 4->1.33
linearConversion [6, 0, (_this getVariable [QEGVAR(medical,bloodVolume), 6]), 1, 2, true];
}] call FUNC(addDutyFactor);
};
if (["ACE_Dragging"] call EFUNC(common,isModLoaded)) then {
if (["ace_dragging"] call EFUNC(common,isModLoaded)) then {
[QEGVAR(dragging,isCarrying), {
[1, 3] select (_this getVariable [QEGVAR(dragging,isCarrying), false]);
}] call FUNC(addDutyFactor);
Expand Down
5 changes: 3 additions & 2 deletions addons/arsenal/functions/fnc_addDefaultLoadout.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@

params [["_name", "", [""]], ["_loadout", [], [[]]], ["_global", false, [false]]];

if (_global) then {
[QGVAR(addDefaultLoadout), [_name, _loadout]] call CBA_fnc_remoteEvent;
if (_global) exitWith {
private _eventID = format [QGVAR(loadouts_%1), _name];
[QGVAR(addDefaultLoadout), [_name, _loadout], _eventID] call CBA_fnc_globalEventJIP;
};

private _extendedInfo = createHashMap;
Expand Down
14 changes: 7 additions & 7 deletions addons/arsenal/functions/fnc_buttonCargo.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ private _container = switch (GVAR(currentLeftPanel)) do {
};
};

/// Get all items from container (excluding container itself)
_containerItems = [GVAR(center), 0, 3, 0, 0, false] call EFUNC(common,uniqueUnitItems);
// Get all items from container
_containerItems = uniformItems GVAR(center);

// Update currentItems
GVAR(currentItems) set [IDX_CURR_UNIFORM_ITEMS, ((getUnitLoadout GVAR(center)) select IDX_LOADOUT_UNIFORM) param [1, []]];
Expand All @@ -75,8 +75,8 @@ private _container = switch (GVAR(currentLeftPanel)) do {
};
};

// Get all items from container (excluding container itself)
_containerItems = [GVAR(center), 0, 0, 3, 0, false] call EFUNC(common,uniqueUnitItems);
// Get all items from container
_containerItems = vestItems GVAR(center);

// Update currentItems
GVAR(currentItems) set [IDX_CURR_VEST_ITEMS, ((getUnitLoadout GVAR(center)) select IDX_LOADOUT_VEST) param [1, []]];
Expand All @@ -103,8 +103,8 @@ private _container = switch (GVAR(currentLeftPanel)) do {
};
};

// Get all items from container (excluding container itself)
_containerItems = [GVAR(center), 0, 0, 0, 3, false] call EFUNC(common,uniqueUnitItems);
// Get all items from container
_containerItems = backpackItems GVAR(center);

// Update currentItems
GVAR(currentItems) set [IDX_CURR_BACKPACK_ITEMS, ((getUnitLoadout GVAR(center)) select IDX_LOADOUT_BACKPACK) param [1, []]];
Expand All @@ -117,7 +117,7 @@ private _container = switch (GVAR(currentLeftPanel)) do {
};

// Find out how many items of that type there are and update the number displayed
_ctrlList lnbSetText [[_lnbCurSel, 2], str (_containerItems getOrDefault [_item, 0])];
_ctrlList lnbSetText [[_lnbCurSel, 2], str ({_item == _x} count _containerItems)];

[QGVAR(cargoChanged), [_display, _item, _addOrRemove, GVAR(shiftState)]] call CBA_fnc_localEvent;

Expand Down
6 changes: 1 addition & 5 deletions addons/arsenal/functions/fnc_buttonLoadoutsRename.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@ private _loadoutIndex = _data findIf {(_x select 0) == _loadoutName};
(_data select _loadoutIndex) set [0, _editBoxContent];

if (GVAR(currentLoadoutsTab) == IDC_buttonDefaultLoadouts) then {
if (is3DEN) then {
set3DENMissionAttributes [[QGVAR(DummyCategory), QGVAR(DefaultLoadoutsListAttribute), GVAR(defaultLoadoutsList)]];
} else {
[QGVAR(renameDefaultLoadout), [_loadoutName, _editBoxContent]] call CBA_fnc_remoteEvent;
};
set3DENMissionAttributes [[QGVAR(DummyCategory), QGVAR(DefaultLoadoutsListAttribute), GVAR(defaultLoadoutsList)]];
};

private _currentLoadoutsTab = str GVAR(currentLoadoutsTab);
Expand Down
93 changes: 40 additions & 53 deletions addons/arsenal/functions/fnc_fillRightPanel.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,14 @@ private _cfgMagazines = configFile >> "CfgMagazines";
private _cfgWeapons = configFile >> "CfgWeapons";
private _rightPanelCache = uiNamespace getVariable QGVAR(rightPanelCache);

private _currentCargo = itemsWithMagazines GVAR(center);
private _currentCargo = []; // we only need this if we're filtering for favorites
if (GVAR(favoritesOnly)) then {
_currentCargo = itemsWithMagazines GVAR(center) + backpacks GVAR(center);
_currentCargo = _currentCargo arrayIntersect _currentCargo;
};

private _fnc_fillRightContainer = {
params ["_configCategory", "_className", "_hasItemInfo", ["_isUnique", false, [false]], ["_unknownOrigin", false, [false]]];
params ["_configCategory", "_className", ["_isUnique", false, [false]], ["_unknownOrigin", false, [false]]];

if (GVAR(favoritesOnly) && {!(_className in _currentCargo)} && {!((toLower _className) in GVAR(favorites))}) exitWith {};

Expand All @@ -64,7 +68,6 @@ private _fnc_fillRightContainer = {
// "Misc. items" magazines (e.g. spare barrels, intel, photos)
if (_className in (uiNamespace getVariable QGVAR(magazineMiscItems))) then {
_configPath = _cfgMagazines >> _className;
_hasItemInfo = false;
};

// If an item with unknown origin is in the arsenal list, try to find it
Expand All @@ -75,34 +78,15 @@ private _fnc_fillRightContainer = {
if (isNull _configPath) then {
_configPath = _className call CBA_fnc_getObjectConfig;
};

// Check if item is has item info
_itemInfo = isClass (_cfgWeapons >> configName _configPath);
};

// Get mass
private _mass = if (!_hasItemInfo) then {
getNumber (_configPath >> "mass")
} else {
private _mass = getNumber (_configPath >> "itemInfo" >> "mass");

if (_mass == 0) then {
_mass = getNumber (_configPath >> "WeaponSlotsInfo" >> "mass");
};

_mass
};

_rightPanelCache set [_className, _mass]; // Needed because this provides more accurate weight for FUNC(updateRightPanel)

[getText (_configPath >> "displayName"), getText (_configPath >> "picture"), _mass]
}, true]) params ["_displayName", "_picture", "_mass"];
[getText (_configPath >> "displayName"), getText (_configPath >> "picture")]
}, true]) params ["_displayName", "_picture"];

private _lbAdd = _ctrlPanel lnbAddRow ["", _displayName, "0"];
_ctrlPanel lnbSetText [[_lbAdd, 1], _displayName];
_ctrlPanel lnbSetData [[_lbAdd, 0], _className];
_ctrlPanel lnbSetPicture [[_lbAdd, 0], _picture];
_ctrlPanel lnbSetValue [[_lbAdd, 0], _mass];
_ctrlPanel lnbSetValue [[_lbAdd, 2], [0, 1] select _isUnique];
_ctrlPanel lnbSetTooltip [[_lbAdd, 0], format ["%1\n%2", _displayName, _className]];
if ((toLower _className) in GVAR(favorites)) then {
Expand Down Expand Up @@ -230,11 +214,11 @@ switch (_ctrlIDC) do {
} forEach _compatibleItems;
} else {
{
["CfgWeapons", _x, true] call _fnc_fillRightContainer;
["CfgWeapons", _x] call _fnc_fillRightContainer;
} forEach (keys ((GVAR(virtualItems) get IDX_VIRT_ATTACHMENTS) get _index));

{
["CfgWeapons", _x, true, true] call _fnc_fillRightContainer;
["CfgWeapons", _x, true] call _fnc_fillRightContainer;
} forEach (keys ((GVAR(virtualItems) get IDX_VIRT_UNIQUE_ATTACHMENTS) get _index));
};
};
Expand All @@ -253,44 +237,44 @@ switch (_ctrlIDC) do {
case IDC_buttonMag: {
{
if (_x in (GVAR(virtualItems) get IDX_VIRT_ITEMS_ALL)) then {
["CfgMagazines", _x, false] call _fnc_fillRightContainer;
["CfgMagazines", _x] call _fnc_fillRightContainer;

continue;
};

if (_x in (GVAR(virtualItems) get IDX_VIRT_UNIQUE_VIRT_ITEMS_ALL)) then {
["CfgMagazines", _x, false, true] call _fnc_fillRightContainer;
["CfgMagazines", _x, true] call _fnc_fillRightContainer;
};
} forEach (keys _compatibleMagsAll);
};
// All magazines
case IDC_buttonMagALL: {
{
["CfgMagazines", _x, false] call _fnc_fillRightContainer;
["CfgMagazines", _x] call _fnc_fillRightContainer;
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_ITEMS_ALL));

{
["CfgMagazines", _x, false, true] call _fnc_fillRightContainer;
["CfgMagazines", _x, true] call _fnc_fillRightContainer;
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_UNIQUE_VIRT_ITEMS_ALL));
};
// Grenades
case IDC_buttonThrow: {
{
["CfgMagazines", _x, false] call _fnc_fillRightContainer;
["CfgMagazines", _x] call _fnc_fillRightContainer;
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_GRENADES));

{
["CfgMagazines", _x, false, true] call _fnc_fillRightContainer;
["CfgMagazines", _x, true] call _fnc_fillRightContainer;
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_UNIQUE_GRENADES));
};
// Explosives
case IDC_buttonPut: {
{
["CfgMagazines", _x, false] call _fnc_fillRightContainer;
["CfgMagazines", _x] call _fnc_fillRightContainer;
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_EXPLOSIVES));

{
["CfgMagazines", _x, false, true] call _fnc_fillRightContainer;
["CfgMagazines", _x, true] call _fnc_fillRightContainer;
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_UNIQUE_EXPLOSIVES));
};
// Misc. items
Expand All @@ -309,33 +293,35 @@ switch (_ctrlIDC) do {
// "Regular" misc. items
{
if !(_x in _items) then {
["CfgWeapons", _x, true] call _fnc_fillRightContainer;
["CfgWeapons", _x] call _fnc_fillRightContainer;
};
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_MISC_ITEMS));
// Unique items
{
if !(_x in _items) then {
["CfgWeapons", _x, true, true] call _fnc_fillRightContainer;
["CfgWeapons", _x, true] call _fnc_fillRightContainer;
};
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_UNIQUE_MISC_ITEMS));
// Unique backpacks
{
if !(_x in _items) then {
["CfgVehicles", _x, false, true] call _fnc_fillRightContainer;
["CfgVehicles", _x, true] call _fnc_fillRightContainer;
};
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_UNIQUE_BACKPACKS));
// Unique goggles
{
if !(_x in _items) then {
["CfgGlasses", _x, false, true] call _fnc_fillRightContainer;
// _y indicates if an item is truly unique or if it's a non-inventory item in a container (e.g. goggles in backpack)
["CfgGlasses", _x, _y] call _fnc_fillRightContainer;
};
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_UNIQUE_GOGGLES));
} forEach (GVAR(virtualItems) get IDX_VIRT_UNIQUE_GOGGLES);
// Unknown items
{
if !(_x in _items) then {
["CfgWeapons", _x, true, true, true] call _fnc_fillRightContainer;
// _y indicates if an item is truly unique or if it's a non-inventory item in a container (e.g. helmet in backpack)
["CfgWeapons", _x, _y, true] call _fnc_fillRightContainer;
};
} forEach (keys (GVAR(virtualItems) get IDX_VIRT_UNIQUE_UNKNOWN_ITEMS));
} forEach (GVAR(virtualItems) get IDX_VIRT_UNIQUE_UNKNOWN_ITEMS); // if an item is here but in virtual items, it's just in the wrong place
};
// Custom buttons
default {
Expand All @@ -347,23 +333,23 @@ switch (_ctrlIDC) do {
switch (true) do {
// "Regular" misc. items
case (_x in (GVAR(virtualItems) get IDX_VIRT_MISC_ITEMS)): {
["CfgWeapons", _x, true] call _fnc_fillRightContainer;
["CfgWeapons", _x] call _fnc_fillRightContainer;
};
// Unique items
case (_x in (GVAR(virtualItems) get IDX_VIRT_UNIQUE_MISC_ITEMS)): {
["CfgWeapons", _x, true, true] call _fnc_fillRightContainer;
["CfgWeapons", _x, true] call _fnc_fillRightContainer;
};
// Unique backpacks
case (_x in (GVAR(virtualItems) get IDX_VIRT_UNIQUE_BACKPACKS)): {
["CfgVehicles", _x, false, true] call _fnc_fillRightContainer;
["CfgVehicles", _x, true] call _fnc_fillRightContainer;
};
// Unique goggles
case (_x in (GVAR(virtualItems) get IDX_VIRT_UNIQUE_GOGGLES)): {
["CfgGlasses", _x, false, true] call _fnc_fillRightContainer;
["CfgGlasses", _x, GVAR(virtualItems) get IDX_VIRT_UNIQUE_GOGGLES get _x] call _fnc_fillRightContainer;
};
// Unknown items
case (_x in (GVAR(virtualItems) get IDX_VIRT_UNIQUE_UNKNOWN_ITEMS)): {
["CfgWeapons", _x, true, true, true] call _fnc_fillRightContainer;
["CfgWeapons", _x, GVAR(virtualItems) get IDX_VIRT_UNIQUE_UNKNOWN_ITEMS get _x, true] call _fnc_fillRightContainer;
};
};
} forEach _items;
Expand All @@ -389,8 +375,8 @@ if (_isContainer) then {
// Update load bar
(_display displayCtrl IDC_loadIndicatorBar) progressSetPosition (loadUniform GVAR(center));

// Get all items from container (excluding container itself)
_containerItems = [GVAR(center), 0, 3, 0, 0, false] call EFUNC(common,uniqueUnitItems);
// Get all items from container
_containerItems = uniformItems GVAR(center);

uniformContainer GVAR(center)
};
Expand All @@ -399,8 +385,8 @@ if (_isContainer) then {
// Update load bar
(_display displayCtrl IDC_loadIndicatorBar) progressSetPosition (loadVest GVAR(center));

// Get all items from container (excluding container itself)
_containerItems = [GVAR(center), 0, 0, 3, 0, false] call EFUNC(common,uniqueUnitItems);
// Get all items from container
_containerItems = vestItems GVAR(center);

vestContainer GVAR(center)
};
Expand All @@ -409,16 +395,17 @@ if (_isContainer) then {
// Update load bar
(_display displayCtrl IDC_loadIndicatorBar) progressSetPosition (loadBackpack GVAR(center));

// Get all items from container (excluding container itself)
_containerItems = [GVAR(center), 0, 0, 0, 3, false] call EFUNC(common,uniqueUnitItems);
// Get all items from container
_containerItems = backpackItems GVAR(center);

backpackContainer GVAR(center)
};
};

// Find out how many items of a type there are and update the number displayed
for "_lbIndex" from 0 to (lnbSize _ctrlPanel select 0) - 1 do {
_ctrlPanel lnbSetText [[_lbIndex, 2], str (_containerItems getOrDefault [_ctrlPanel lnbData [_lbIndex, 0], 0])];
private _xItem = _ctrlPanel lnbData [_lbIndex, 0];
_ctrlPanel lnbSetText [[_lbIndex, 2], str ({_xItem == _x} count _containerItems)];
};

// Refresh availibility of items based on space remaining in container
Expand Down
1 change: 1 addition & 0 deletions addons/arsenal/functions/fnc_loadoutsChangeTab.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ switch (ctrlIDC _control) do {
_saveButtonCtrl ctrlSetTooltip LLSTRING(buttonSaveTooltip);
};

_renameButtonCtrl ctrlEnable is3DEN; // no renaming mid-mission
_saveButtonCtrl ctrlEnable call FUNC(canEditDefaultLoadout);
_saveButtonCtrl ctrlCommit 0;
};
Expand Down
7 changes: 0 additions & 7 deletions addons/arsenal/functions/fnc_onArsenalClose.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,6 @@ if (is3DEN) then {
["ShowInterface", true] call BIS_fnc_3DENInterface;
GVAR(visionMode) call BIS_fnc_3DENVisionMode;
} else {
// Select correct weapon
switch (GVAR(selectedWeaponType)) do {
case 0: {GVAR(center) selectWeapon (primaryWeapon GVAR(center))};
case 1: {GVAR(center) selectWeapon (secondaryWeapon GVAR(center))};
case 2: {GVAR(center) selectWeapon (handgunWeapon GVAR(center))};
};

if (!isNull curatorCamera && {ACE_player == player}) then {
curatorCamera cameraEffect ["Internal", "BACK"];
} else {
Expand Down
10 changes: 9 additions & 1 deletion addons/arsenal/functions/fnc_onArsenalOpen.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,15 @@ GVAR(refreshing) = false;
_panel ctrlCommit 0;
} forEach [IDC_leftTabContent, IDC_rightTabContent, IDC_rightTabContentListnBox];

[_display, _display displayCtrl IDC_buttonPrimaryWeapon] call FUNC(fillLeftPanel);
// Open left panel for current weapon, do some math
GVAR(selectedWeaponType) = [primaryWeapon GVAR(center), secondaryWeapon GVAR(center), handgunWeapon GVAR(center), binocular GVAR(center)] find (currentWeapon GVAR(center));
if (GVAR(selectedWeaponType) == -1) then {
GVAR(selectedWeaponType) = 0; // default to primary
};

private _leftPanelIDC = [IDC_buttonPrimaryWeapon, IDC_buttonSecondaryWeapon, IDC_buttonHandgun, IDC_buttonBinoculars] select GVAR(selectedWeaponType);

[_display, _display displayCtrl _leftPanelIDC] call FUNC(fillLeftPanel);

//--------------- Init camera
if (isNil QGVAR(cameraPosition)) then {
Expand Down
Loading

0 comments on commit 4924ea6

Please sign in to comment.