Arsenal - Add mod icons to editor arsenal attribute (#9797)

This commit is contained in:
johnb432 2024-02-12 19:15:48 +01:00 committed by GitHub
parent 1002dfe31b
commit 05a5ccd140
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 24 additions and 7 deletions

View File

@ -110,7 +110,7 @@ class Cfg3DEN {
h = QUOTE(65 * ATTRIBUTE_H);
drawSideArrows = 1;
disableOverflow = 1;
columns[] = {0.05, 0.15, 0.85};
columns[] = {0.05, 0.15, 0.83, 0.87};
};
class ArrowLeft: ctrlButton {
idc = IDC_ATTRIBUTE_LIST_LEFT;

View File

@ -46,6 +46,7 @@ private _cfgWeapons = configFile >> "CfgWeapons";
private _cfgMagazines = configFile >> "CfgMagazines";
private _cfgVehicles = configFile >> "CfgVehicles";
private _cfgGlasses = configFile >> "CfgGlasses";
private _dlcName = "";
// Exit with current items (no specific category)
if (_category == IDX_CAT_ALL) exitWith {
@ -73,6 +74,12 @@ if (_category == IDX_CAT_ALL) exitWith {
_listbox lnbSetData [[_index, 1], _x];
_listbox lnbSetPicture [[_index, 0], getText (_config >> "picture")];
_listbox lnbSetTooltip [[_index, 0], _x];
_dlcName = _config call EFUNC(common,getAddon);
if (_dlcName != "") then {
_listbox lnbSetPicture [[_index, 2], (modParams [_dlcName, ["logo"]]) param [0, ""]];
};
};
} forEach _attributeItems;
@ -130,12 +137,20 @@ private _config = _cfgClass;
_alpha = 0.5;
};
_index = _listbox lnbAddRow ["", _displayName, _symbol];
_index = _listbox lnbAddRow ["", _displayName, "", _symbol];
_listbox lnbSetData [[_index, 1], _x];
_listbox lnbSetPicture [[_index, 0], getText (_config >> _x >> "picture")];
_listbox lnbSetTooltip [[_index, 0], _x];
_listbox lnbSetColor [[_index, 1], [1, 1, 1, _alpha]];
_listbox lnbSetColor [[_index, 2], [1, 1, 1, _alpha]];
_listbox lnbSetColor [[_index, 3], [1, 1, 1, _alpha]];
// Mod icon is in column 2
_dlcName = (_config >> _x) call EFUNC(common,getAddon);
if (_dlcName != "") then {
_listbox lnbSetPicture [[_index, 2], (modParams [_dlcName, ["logo"]]) param [0, ""]];
_listbox lnbSetPictureColor [[_index, 2], [1, 1, 1, _alpha]];
};
};
} forEach (keys _categoryItems);

View File

@ -35,9 +35,10 @@ if (_addItem && {_itemIndex == -1}) exitWith {
_attributeItems pushBack _itemClassname;
// Change symbol and increase alpha
_listbox lnbSetText [[_currentRow, 2], [SYMBOL_ITEM_VIRTUAL, SYMBOL_ITEM_REMOVE] select _attributeMode];
_listbox lnbSetText [[_currentRow, 3], [SYMBOL_ITEM_VIRTUAL, SYMBOL_ITEM_REMOVE] select _attributeMode];
_listbox lnbSetColor [[_currentRow, 1], [1, 1, 1, 1]];
_listbox lnbSetColor [[_currentRow, 2], [1, 1, 1, 1]];
_listbox lnbSetPictureColor [[_currentRow, 2], [1, 1, 1, 1]]; // mod icon is in column 2
_listbox lnbSetColor [[_currentRow, 3], [1, 1, 1, 1]];
};
// Remove item if in list
@ -45,7 +46,8 @@ if (!_addItem && {_itemIndex != -1}) exitWith {
_attributeItems deleteAt _itemIndex;
// Change symbol and reduce alpha
_listbox lnbSetText [[_currentRow, 2], SYMBOL_ITEM_NONE];
_listbox lnbSetText [[_currentRow, 3], SYMBOL_ITEM_NONE];
_listbox lnbSetColor [[_currentRow, 1], [1, 1, 1, 0.5]];
_listbox lnbSetColor [[_currentRow, 2], [1, 1, 1, 0.5]];
_listbox lnbSetPictureColor [[_currentRow, 2], [1, 1, 1, 0.5]]; // mod icon is in column 2
_listbox lnbSetColor [[_currentRow, 3], [1, 1, 1, 0.5]];
};