ACE3/addons/medical_gui/functions/fnc_updateLogList.sqf
BrettMayson 67fa53fd2c
General - Events for Mods (#9813)
* full heal local

* update body image

* log list

* better _enable in categories

* update injury list

* cardiac output internal variable

* typo

* remove duplicate event

* rename event

* add docs

* Update docs/wiki/framework/events-framework.md

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

---------

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
2024-03-04 15:08:12 -06:00

42 lines
986 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: mharis001
* Updates list control with given logs.
*
* Arguments:
* 0: Log list <CONTROL>
* 1: Log to add <ARRAY>
*
* Return Value:
* None
*
* Example:
* [_ctrlActivityLog, _activityLog] call ace_medical_gui_fnc_updateLogList
*
* Public: No
*/
params ["_ctrl", "_logs"];
lbClear _ctrl;
{
_x params ["_message", "_timeStamp", "_arguments"];
private _unlocalizedMessage = _message;
// Localize message and arguments
if (isLocalized _message) then {
_message = localize _message;
};
_arguments = _arguments apply {if (_x isEqualType "" && {isLocalized _x}) then {localize _x} else {_x}};
// Format message with arguments
_message = format ([_message] + _arguments);
private _row = _ctrl lbAdd format ["%1 %2", _timeStamp, _message];
[QGVAR(logListAppended), [_ctrl, _row, _message, _unlocalizedMessage, _timeStamp, _arguments]] call CBA_fnc_localEvent;
} forEach _logs;