2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2017-11-07 21:21:58 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
* Executed every time an inventory display is opened.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Inventory display <DISPLAY>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2024-01-06 21:26:46 +00:00
|
|
|
* [DISPLAY] call ace_inventory_fnc_displayNameWeight
|
2017-11-07 21:21:58 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2016-02-21 20:24:39 +00:00
|
|
|
|
2017-12-16 03:50:17 +00:00
|
|
|
params ["_display"];
|
2016-02-21 20:24:39 +00:00
|
|
|
|
2024-01-06 21:26:46 +00:00
|
|
|
// Forces player name control to display irrespective of isStreamFriendlyUIEnabled
|
2019-08-14 08:47:24 +00:00
|
|
|
(_display displayCtrl 111) ctrlShow true;
|
|
|
|
|
2017-12-16 03:50:17 +00:00
|
|
|
private _fnc_update = {
|
|
|
|
params ["_display"];
|
2024-01-06 21:26:46 +00:00
|
|
|
|
2017-12-16 03:50:17 +00:00
|
|
|
private _control = _display displayCtrl 111;
|
2019-08-14 08:47:24 +00:00
|
|
|
private _format = ["%1 - %2 %3 (%4)", "%2 %3 (%4)"] select isStreamFriendlyUIEnabled;
|
2016-02-21 20:24:39 +00:00
|
|
|
|
2019-08-14 08:47:24 +00:00
|
|
|
_control ctrlSetText format [_format,
|
2024-01-06 21:26:46 +00:00
|
|
|
[GVAR(unit), false, true] call EFUNC(common,getName),
|
|
|
|
LELSTRING(common,Weight),
|
|
|
|
GVAR(unit) call EFUNC(common,getWeight),
|
|
|
|
[GVAR(unit), true] call EFUNC(common,getWeight)
|
2017-12-16 03:50:17 +00:00
|
|
|
];
|
|
|
|
};
|
2016-02-21 20:24:39 +00:00
|
|
|
|
2017-12-16 03:50:17 +00:00
|
|
|
_display displayAddEventHandler ["MouseMoving", _fnc_update];
|
|
|
|
_display displayAddEventHandler ["MouseHolding", _fnc_update];
|
|
|
|
|
|
|
|
_display call _fnc_update;
|