ACE3/TO_MERGE/cse/main/messages/functions/fn_sendDisplayMessageTo.sqf

46 lines
1.2 KiB
Plaintext
Raw Normal View History

2015-01-12 22:35:40 +00:00
/**
* fn_sendDisplayMessageTo.sqf
* @Descr: Displays a message on locality of receiver
* @Author: Glowbal
*
* @Arguments: [receiver OBJECT, title STRING, content STRING, type NUMBER (Optional)]
* @Return: void
* @PublicAPI: true
*/
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;
[_this] call cse_fnc_debug;
if (isPlayer _reciever) then {
if (!local _reciever) then {
[_this, "cse_fnc_sendDisplayMessageTo", _reciever, false] spawn BIS_fnc_MP;
} else {
if (isLocalized _title) then {
_title = localize _title;
};
if (isLocalized _content) then {
_content = localize _content;
};
_localizationArray = [_title];
{
_localizationArray pushback _x;
}foreach _parameters;
_title = format _localizationArray;
_localizationArray = [_content];
{
_localizationArray pushback _x;
}foreach _parameters;
_content = format _localizationArray;
[_title,_content,_type] call cse_fnc_gui_displayMessage;
};
};