mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Change stringToColoredText to accept a hex string (#6241)
This commit is contained in:
parent
d41779dc74
commit
50abe911a5
@ -4,7 +4,7 @@
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Text <ANY>
|
||||
* 1: Color <ARRAY>
|
||||
* 1: Color <ARRAY, STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* Text <STRING>
|
||||
@ -20,12 +20,14 @@ params ["_string", "_color"];
|
||||
|
||||
_string = format ["%1", _string];
|
||||
|
||||
_color = (
|
||||
[255 * (_color select 0), 2] call FUNC(toHex)
|
||||
) + (
|
||||
[255 * (_color select 1), 2] call FUNC(toHex)
|
||||
) + (
|
||||
[255 * (_color select 2), 2] call FUNC(toHex)
|
||||
);
|
||||
if (_color isEqualType []) then {
|
||||
_color = "#" + (
|
||||
[255 * (_color select 0), 2] call FUNC(toHex)
|
||||
) + (
|
||||
[255 * (_color select 1), 2] call FUNC(toHex)
|
||||
) + (
|
||||
[255 * (_color select 2), 2] call FUNC(toHex)
|
||||
);
|
||||
};
|
||||
|
||||
parseText format ["<t align='center' color='#%2' >%1</t>", _string, _color]
|
||||
parseText format ["<t align='center' color='%1' >%2</t>", _color, _string]
|
||||
|
@ -45,7 +45,7 @@ for "_a" from (_count + 1) to 12 do {
|
||||
|
||||
TRACE_3("",_temperature,_color,_string);
|
||||
|
||||
_text = composeText [_text, [_string, [0.5, 0.5, 0.5]] call EFUNC(common,stringToColoredText)];
|
||||
_text = composeText [_text, [_string, "#808080"] call EFUNC(common,stringToColoredText)];
|
||||
|
||||
private _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
|
||||
|
||||
|
@ -95,7 +95,7 @@ private _ammoBarsStructuredText = if (_showNumber) then {
|
||||
_string = _string + "|";
|
||||
};
|
||||
|
||||
composeText [_text, [_string, [0.5, 0.5, 0.5]] call EFUNC(common,stringToColoredText)];
|
||||
composeText [_text, [_string, "#808080"] call EFUNC(common,stringToColoredText)];
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user