ACE3/addons/common/functions/fnc_sendDisplayInformationTo.sqf

54 lines
1.3 KiB
Plaintext
Raw Normal View History

2015-09-19 18:17:38 +00:00
/*
* Author: Glowbal
* Sends a display information hint to a receiver
2015-01-16 23:21:47 +00:00
*
2015-09-19 18:17:38 +00:00
* Arguments:
* 0: receiver <OBJECT>
* 1: title <STRING>
* 2: content <ARRAY>
* 3: type (optional) <NUMBER>
*
* Return Value:
* None
*
* Public: Yes
2015-01-16 23:21:47 +00:00
*/
#include "script_component.hpp"
2015-09-19 18:17:38 +00:00
params [["_reciever", objNull], ["_title", ""], ["_content", ""], ["_type", 0], ["_parameters", []]];
2015-01-16 23:21:47 +00:00
if (isPlayer _reciever) then {
if (!local _reciever) then {
2015-09-19 18:17:38 +00:00
[_this, QFUNC(sendDisplayInformationTo), _reciever, false] call FUNC(execRemoteFnc);
} else {
if (isLocalized _title) then {
_title = localize _title;
};
2015-09-19 18:17:38 +00:00
private "_localizationArray";
_localizationArray = [_title];
2015-09-19 18:17:38 +00:00
{
_localizationArray pushback _x;
2015-09-19 18:17:38 +00:00
false
} count _parameters;
_title = format _localizationArray;
2015-01-16 23:21:47 +00:00
{
if (isLocalized _x) then {
_localizationArray = [localize _x];
2015-09-19 18:17:38 +00:00
{
2015-09-19 18:17:38 +00:00
_localizationArray pushBack _x;
false
} count _parameters;
2015-01-16 23:21:47 +00:00
2015-09-19 18:17:38 +00:00
_content set [_forEachIndex, format _localizationArray];
};
2015-09-19 18:17:38 +00:00
} forEach _content;
2015-01-16 23:21:47 +00:00
2015-09-19 18:17:38 +00:00
[_title, _content, _type] call FUNC(displayInformation);
};
2015-09-19 18:17:38 +00:00
};