ACE3/addons/zeus/functions/fnc_showMessage.sqf
Ozan Eğitmen 3aa55b1452 New Function to Show BIS Style Curator Messages (#4844)
* Add showMessage fnc that shows BIS curator messages

* Add documentation

* Make function simpler

* Modify to fir new syntax

* Handle non-string args
2017-03-02 17:47:49 -06:00

25 lines
732 B
Plaintext

/*
* Author: 654wak654
* Shows a zeus message through the BIS function, handles localization.
* If multiple args are given, they get formatted.
*
* Arguments:
* 0: The message <STRING>
* N: Anything <ANY><OPTIONAL>
*
* Return Value:
* Nothing
*
* Example:
* ["something"] call ace_zeus_fnc_showMessage
* ["something %1 in %2", "strange", getPos neighborhood] call ace_zeus_fnc_showMessage
*
* Public: Yes
*/
#include "script_component.hpp"
if (!(_this isEqualTypeParams [""])) exitWith {ERROR_1("First arg must be string [%1]",_this);};
private _message = _this apply {if ((_x isEqualType "") && {isLocalized _x}) then {localize _x} else {_x}};
[objNull, format _message] call BIS_fnc_showCuratorFeedbackMessage;