ACE3/addons/common/functions/fnc_sendDisplayInformationTo.sqf
Glowbal 155503d4a1 Merged GUI into common.
Removed unnecessary GUI functions.
Updated displayIcon function to be more dynamic
Added client side settings for displaying icons.
2015-02-14 20:06:55 +01:00

47 lines
1.3 KiB
Plaintext

/**
* fn_sendDisplayInformationTo.sqf
* @Descr: Sends a display information hint to a receiver
* @Author: Glowbal
*
* @Arguments: [receiver OBJECT, title STRING, content ARRAY (An array with strings), type NUMBER (Optional)]
* @Return: void
* @PublicAPI: true
*/
#include "script_component.hpp"
private ["_reciever","_title","_content","_type", "_parameters", "_localizationArray"];
_reciever = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param;
_title = [_this, 1, "",[""]] call BIS_fnc_Param;
_content = [_this, 2, [""],[[""]]] call BIS_fnc_Param;
_type = [_this, 3, 0,[0]] call BIS_fnc_Param;
_parameters = [_this, 4, [], [[]]] call BIS_fnc_Param;
if (isPlayer _reciever) then {
if (!local _reciever) then {
[_this, QUOTE(FUNC(sendDisplayInformationTo)), _reciever, false] call EFUNC(common,execRemoteFnc);
} else {
if (isLocalized _title) then {
_title = localize _title;
};
_localizationArray = [_title];
{
_localizationArray pushback _x;
}foreach _parameters;
_title = format _localizationArray;
{
if (isLocalized _x) then {
_localizationArray = [localize _x];
{
_localizationArray pushback _x;
}foreach _parameters;
_content set [_foreachIndex, format _localizationArray];
};
}foreach _content;
[_title,_content,_type] call EFUNC(common,displayInformation);
};
};