2015-01-11 16:42:31 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
*
|
|
|
|
* Display a structured text.
|
|
|
|
*
|
|
|
|
* Argument:
|
|
|
|
* 0: Text (Anything)
|
|
|
|
* 1: Size of the textbox (Number, optional default: 1)
|
|
|
|
*
|
|
|
|
* Return value:
|
|
|
|
* Nothing
|
|
|
|
*/
|
2015-01-13 19:56:02 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
private ["_text", "_size", "_isShown", "_ctrlHint"];
|
|
|
|
|
|
|
|
_text = _this select 0;
|
|
|
|
_size = _this select 1;
|
|
|
|
|
|
|
|
if (isNil "_size") then {_size = 1};
|
|
|
|
|
|
|
|
if (typeName _text != "TEXT") then {
|
|
|
|
_text = composeText [lineBreak, parseText format ["<t align='center'>%1</t>", _text]];
|
|
|
|
};
|
|
|
|
|
2015-01-12 04:02:33 +00:00
|
|
|
_isShown = ctrlShown (uiNamespace getVariable ["ACE_ctrlHint", controlNull]);
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-01-12 04:02:33 +00:00
|
|
|
("ACE_RscHint" call BIS_fnc_rscLayer) cutRsc ["ACE_RscHint", "PLAIN", 0, true];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
disableSerialization;
|
2015-01-12 04:02:33 +00:00
|
|
|
_ctrlHint = uiNamespace getVariable "ACE_ctrlHint";
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
_ctrlHint ctrlSetPosition [
|
|
|
|
safeZoneW + safeZoneX - 0 * safezoneW,
|
|
|
|
safeZoneY + 0.2 * safezoneH,
|
|
|
|
0.2 * safeZoneW,
|
|
|
|
_size * 0.1 * SafeZoneH
|
|
|
|
];
|
|
|
|
_ctrlHint ctrlCommit 0;
|
|
|
|
|
|
|
|
_ctrlHint ctrlSetStructuredText _text;
|
|
|
|
_ctrlHint ctrlSetPosition [
|
|
|
|
safeZoneW + safeZoneX - 0.2 * safezoneW,
|
|
|
|
safeZoneY + 0.2 * safezoneH,
|
|
|
|
0.2 * safeZoneW,
|
|
|
|
_size * 0.1 * SafeZoneH
|
|
|
|
];
|
|
|
|
_ctrlHint ctrlCommit ([0.2, 0] select _isShown);
|