2015-08-06 21:51:17 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
|
|
|
* Update the activity log
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: display <DISPLAY>
|
|
|
|
* 1: log collection <ARRAY>
|
|
|
|
*
|
|
|
|
* Return Value:
|
2015-08-07 03:37:41 +00:00
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2015-10-13 07:01:59 +00:00
|
|
|
* [some_display, log] call ace_medical_menu_fnc_updateActivityLog
|
2015-08-06 21:51:17 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-07 03:37:41 +00:00
|
|
|
private "_logCtrl";
|
|
|
|
|
|
|
|
params ["_display", "_logs"];
|
2015-08-06 21:51:17 +00:00
|
|
|
|
2015-08-07 03:37:41 +00:00
|
|
|
_logCtrl = _display displayCtrl 214;
|
2015-08-06 21:51:17 +00:00
|
|
|
lbClear _logCtrl;
|
|
|
|
|
|
|
|
{
|
2015-10-13 07:01:59 +00:00
|
|
|
_x params ["_message", "_moment", "", "_arguments"];
|
2015-08-07 03:37:41 +00:00
|
|
|
|
2015-08-06 21:51:17 +00:00
|
|
|
if (isLocalized _message) then {
|
|
|
|
_message = localize _message;
|
|
|
|
};
|
|
|
|
|
|
|
|
{
|
2015-11-20 17:40:31 +00:00
|
|
|
if (_x isEqualType "" && {isLocalized _x}) then {
|
2015-08-06 21:51:17 +00:00
|
|
|
_arguments set [_foreachIndex, localize _x];
|
|
|
|
};
|
2015-08-07 03:37:41 +00:00
|
|
|
} forEach _arguments;
|
|
|
|
|
|
|
|
_message = format ([_message] + _arguments);
|
|
|
|
_logCtrl lbAdd format ["%1 %2", _moment, _message];
|
|
|
|
nil
|
|
|
|
} count _logs;
|