ACE3/addons/arsenal/functions/fnc_onPanelDblClick.sqf
Grim e06c6f7835
General - Replace toLower with toLowerANSI where applicable (#9790)
* General - Replace toLower with toLowerANSI where applicable

* whoops

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

* Update addons/repair/functions/fnc_setHitPointDamage.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* Update addons/repair/dev/draw_showRepairInfo.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* Update addons/tagging/XEH_preStart.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* Update addons/vehicle_damage/functions/fnc_handleCookoff.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* Update addons/tagging/XEH_preStart.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* comparment -> compartment

* Update fnc_showHud.sqf

* Update fnc_registerObjects.sqf

* Update addons/common/functions/fnc_cbaSettings_settingChanged.sqf

---------

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
2024-03-07 22:08:13 +01:00

51 lines
1.2 KiB
Plaintext

#include "..\script_component.hpp"
#include "..\defines.hpp"
#include "\a3\ui_f\hpp\defineResincl.inc"
/*
* Author: LinkIsGrim
* Add or remove item(s) to favorites when LShift is pressed
*
* Arguments:
* 0: Left panel control <CONTROL>
* 1: Left panel selection <NUMBER>
*
* Return Value:
* None
*
* Public: No
*/
params ["_control", "_curSel"];
if !(GVAR(shiftState)) exitWith {};
if (GVAR(currentLeftPanel) in [IDC_buttonFace, IDC_buttonVoice, IDC_buttonInsigina]) exitWith {};
private _isLnB = (ctrlType _control) == CT_LISTNBOX;
private _favorited = false;
// Favorites/blacklist will always be lowercase to handle configCase changes
private _item = "";
if (_isLnB) then {
_item = toLowerANSI (_control lnbData [_curSel, 0]);
} else {
_item = toLowerANSI (_control lbData _curSel);
};
if (_item in GVAR(favorites)) then {
GVAR(favorites) deleteAt _item;
} else {
GVAR(favorites) set [_item, nil];
_favorited = true;
};
private _color = ([[1, 1, 1], GVAR(favoritesColor)] select _favorited) + [1];
if (_isLnB) then {
_control lnbSetColor [[_curSel, 1], _color];
_control lnbSetColorRight [[_curSel, 1], _color];
} else {
_control lbSetColor [_curSel, _color];
_control lbSetSelectColor [_curSel, _color];
};