Skip to content

Commit

Permalink
Arsenal - Improve missing item tooltip setting (#10623)
Browse files Browse the repository at this point in the history
Co-authored-by: PabstMirror <[email protected]>
  • Loading branch information
LinkIsGrim and PabstMirror authored Jan 5, 2025
1 parent e6a46cc commit 25381d9
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 26 deletions.
24 changes: 22 additions & 2 deletions addons/arsenal/functions/fnc_fillLoadoutsList.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,20 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then {
// Change color on loadout lines that have items that aren't available or don't exist
if (_nullItemsList isNotEqualTo []) then {
_contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 0, 0, 0.8]]; // Red

if (GVAR(showUnavailableItems) == 2) then {
_contentPanelCtrl lnbSetTooltip [[_newRow, 0], format [LLSTRING(missingItems), (_nullItemsList arrayIntersect _nullItemsList) joinString endl]];
};
} else {
if (_unavailableItemsList isNotEqualTo []) then {
_contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 1, 1, 0.25]]; // Gray

if (GVAR(unavailableItemsTooltip)) then {
_contentPanelCtrl lnbSetTooltip [[_newRow, 0], format ["Missing Items: %1", _unavailableItemsList arrayIntersect _unavailableItemsList]];
if (GVAR(showUnavailableItems) > 0) then {
private _itemDisplayNames = _unavailableItemsList arrayIntersect _unavailableItemsList;
if (GVAR(showUnavailableItems) != 2) then { // Prettify
_itemDisplayNames = _itemDisplayNames apply {getText (_x call CBA_fnc_getItemConfig >> "displayName")};
};
_contentPanelCtrl lnbSetTooltip [[_newRow, 0], format [LLSTRING(unavailableItems), _itemDisplayNames joinString endl]];
};
};
};
Expand Down Expand Up @@ -152,9 +160,21 @@ if (GVAR(currentLoadoutsTab) != IDC_buttonSharedLoadouts) then {
// Change color on loadout lines that have items that aren't available or don't exist
if (_nullItemsList isNotEqualTo []) then {
_contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 0, 0, 0.8]]; // Red

if (GVAR(showUnavailableItems) == 2) then {
_contentPanelCtrl lnbSetTooltip [[_newRow, 0], format [LLSTRING(missingItems), (_nullItemsList arrayIntersect _nullItemsList) joinString endl]];
};
} else {
if (_unavailableItemsList isNotEqualTo []) then {
_contentPanelCtrl lnbSetColor [[_newRow, 1], [1, 1, 1, 0.25]]; // Gray

if (GVAR(showUnavailableItems) > 0) then {
private _itemDisplayNames = _unavailableItemsList arrayIntersect _unavailableItemsList;
if (GVAR(showUnavailableItems) != 2) then { // Prettify
_itemDisplayNames = _itemDisplayNames apply {getText (_x call CBA_fnc_getItemConfig >> "displayName")};
};
_contentPanelCtrl lnbSetTooltip [[_newRow, 0], format [LLSTRING(unavailableItems), _itemDisplayNames joinString endl]];
};
};
};
};
Expand Down
20 changes: 11 additions & 9 deletions addons/arsenal/initSettings.inc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,7 @@ private _category = LLSTRING(settingCategory);
"LIST",
[LSTRING(modIconsSetting), LSTRING(modIconsTooltip)],
_category,
[[0, 1, 2], [ELSTRING(common,Disabled), ELSTRING(common,Enabled), LSTRING(DLCRequirement)], 1]
] call CBA_fnc_addSetting;

[
QGVAR(unavailableItemsTooltip),
"CHECKBOX",
LLSTRING(unavailableItemsTooltip),
_category,
[[0, 1, 2], [ELSTRING(common,Disabled), ELSTRING(common,Enabled), LSTRING(DLCRequirement)], 1],
false
] call CBA_fnc_addSetting;

Expand Down Expand Up @@ -80,14 +73,23 @@ private _loadoutCategory = LLSTRING(loadoutSubcategory);
true
] call CBA_fnc_addSetting;

[
QGVAR(showUnavailableItems),
"LIST",
[LSTRING(unavailableItemsSetting), LSTRING(unavailableItemsTooltip)],
[_category, _loadoutCategory],
[[0, 1, 2], [ELSTRING(common,Disabled), ELSTRING(common,Enabled), ELSTRING(common,Debug)], 0],
2 // never overwrite the client
] call CBA_fnc_addSetting;

[
QGVAR(EnableRPTLog),
"CHECKBOX",
[LSTRING(printToRPTSetting),
LSTRING(printToRPTTooltip)],
[_category, _loadoutCategory],
false,
false
2 // never overwrite the client
] call CBA_fnc_addSetting;

[
Expand Down
11 changes: 10 additions & 1 deletion addons/arsenal/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -958,8 +958,11 @@
<Chinesesimp>反转摄影机控制</Chinesesimp>
<Turkish>Kamera kontrollerini ters çevir</Turkish>
</Key>
<Key ID="STR_ACE_Arsenal_unavailableItemsSetting">
<English>Show missing / unavailable items</English>
</Key>
<Key ID="STR_ACE_Arsenal_unavailableItemsTooltip">
<English>Unavailable Items Tooltip</English>
<English>Show missing / unavailable items when hovering over a loadout</English>
</Key>
<Key ID="STR_ACE_Arsenal_loadoutDeleted">
<English>The following loadout was deleted:</English>
Expand Down Expand Up @@ -1096,6 +1099,9 @@
<Japanese>声の保存</Japanese>
<Chinesesimp>保存声音</Chinesesimp>
</Key>
<Key ID="STR_ACE_Arsenal_missingItems">
<English>Missing items:\n%1</English>
</Key>
<Key ID="STR_ACE_Arsenal_modIconsSetting">
<English>Enable mod icons</English>
<Czech>Zapnout ikony modů</Czech>
Expand Down Expand Up @@ -1128,6 +1134,9 @@
<Chinesesimp>在左面板中显示/隐藏模组图示</Chinesesimp>
<Turkish>Sol panel de mod ikonlarını göster/gizle</Turkish>
</Key>
<Key ID="STR_ACE_Arsenal_unavailableItems">
<English>Unavailable items:\n%1</English>
</Key>
<Key ID="STR_ACE_Arsenal_noVirtualItems">
<English>No virtual items available</English>
<Czech>Není dostupný žádný virtuální předmět</Czech>
Expand Down
11 changes: 11 additions & 0 deletions addons/common/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,17 @@
<Chinesesimp>确认</Chinesesimp>
<Turkish>Onayla</Turkish>
</Key>
<Key ID="STR_ACE_Common_Debug">
<English>Debug</English>
<French>Debug</French>
<Spanish>Debug</Spanish>
<Italian>Debug</Italian>
<Russian>Отладка</Russian>
<German>Debug</German>
<Korean>디버그</Korean>
<Japanese>デバッグ</Japanese>
<Chinesesimp>开发者模式</Chinesesimp>
</Key>
<Key ID="STR_ACE_Common_DeployedSwayFactor">
<English>Deployed sway factor</English>
<French>Facteur de balancement déployé</French>
Expand Down
6 changes: 3 additions & 3 deletions addons/frag/initSettingsDebug.inc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ private _category = format ["ACE %1", LLSTRING(Module_DisplayName)];
QGVAR(debugOptions),
"CHECKBOX",
[LSTRING(EnableDebugTrace), LSTRING(EnableDebugTrace_Desc)],
[_category, LSTRING(Debug)],
[_category, ELSTRING(common,Debug)],
true
] call CBA_fnc_addSetting;

[
QGVAR(dbgSphere),
"CHECKBOX",
[LSTRING(HitSphereEnable), LSTRING(HitSphereEnable_Desc)],
[_category, LSTRING(Debug)],
[_category, ELSTRING(common,Debug)],
false
] call CBA_fnc_addSetting;

[
QGVAR(drawHitBox),
"CHECKBOX",
[LSTRING(DrawHitBox), LSTRING(DrawHitBox_Desc)],
[_category, LSTRING(Debug)],
[_category, ELSTRING(common,Debug)],
true
] call CBA_fnc_addSetting;
11 changes: 0 additions & 11 deletions addons/frag/stringtable.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project name="ACE">
<Package name="Frag">
<Key ID="STR_ACE_Frag_Debug">
<English>Debug</English>
<French>Debug</French>
<Spanish>Debug</Spanish>
<Italian>Debug</Italian>
<Russian>Отладка</Russian>
<German>Debug</German>
<Korean>디버그</Korean>
<Japanese>デバッグ</Japanese>
<Chinesesimp>开发者模式</Chinesesimp>
</Key>
<Key ID="STR_ACE_Frag_DrawHitBox">
<English>Draw Hitboxes</English>
<French>Afficher les hitboxes</French>
Expand Down

0 comments on commit 25381d9

Please sign in to comment.