mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
7f998c3234
Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
41 lines
1.0 KiB
Plaintext
41 lines
1.0 KiB
Plaintext
#include "..\script_component.hpp"
|
|
/*
|
|
* Author: commy2
|
|
* Executed every time an inventory display is opened.
|
|
*
|
|
* Arguments:
|
|
* 0: Inventory display <DISPLAY>
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [DISPLAY] call ace_inventory_fnc_displayNameWeight
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
params ["_display"];
|
|
|
|
// Forces player name control to display irrespective of isStreamFriendlyUIEnabled
|
|
(_display displayCtrl 111) ctrlShow true;
|
|
|
|
private _fnc_update = {
|
|
params ["_display"];
|
|
|
|
private _control = _display displayCtrl 111;
|
|
private _format = ["%1 - %2 %3 (%4)", "%2 %3 (%4)"] select isStreamFriendlyUIEnabled;
|
|
|
|
_control ctrlSetText format [_format,
|
|
[GVAR(unit), false, true] call EFUNC(common,getName),
|
|
LELSTRING(common,Weight),
|
|
GVAR(unit) call EFUNC(common,getWeight),
|
|
[GVAR(unit), true] call EFUNC(common,getWeight)
|
|
];
|
|
};
|
|
|
|
_display displayAddEventHandler ["MouseMoving", _fnc_update];
|
|
_display displayAddEventHandler ["MouseHolding", _fnc_update];
|
|
|
|
_display call _fnc_update;
|