2024-01-11 20:01:50 +00:00
|
|
|
#include "..\script_component.hpp"
|
2024-01-08 21:22:52 +00:00
|
|
|
/*
|
|
|
|
* Author: Lambda.Tiger
|
2024-01-18 00:20:47 +00:00
|
|
|
* Add a colored sphere at a specified point.
|
2024-01-08 21:22:52 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
2024-02-16 02:59:58 +00:00
|
|
|
* 0: Position (posASL) to add sphere <ARRAY>
|
|
|
|
* 1: Color of sphere <STRING> (default: "blue")
|
2024-01-08 21:22:52 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
2024-03-03 00:00:11 +00:00
|
|
|
* The created sphere object <OBJECT>
|
2024-01-08 21:22:52 +00:00
|
|
|
*
|
|
|
|
* Example:
|
2024-02-16 02:59:58 +00:00
|
|
|
* [getPosASL player, "red"] call ace_frag_fnc_dev_sphereDraw;
|
2024-01-08 21:22:52 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2024-01-18 02:52:25 +00:00
|
|
|
|
2024-02-16 02:59:58 +00:00
|
|
|
params ["_posASL", ["_color", "blue"]];
|
|
|
|
|
|
|
|
if (!isServer) exitWith {};
|
2024-01-08 21:22:52 +00:00
|
|
|
|
2024-01-15 19:13:59 +00:00
|
|
|
if (_color select [0,1] != "(") then {
|
2024-01-16 00:44:15 +00:00
|
|
|
_color = switch (toLowerANSI _color) do {
|
|
|
|
case "blue": {"(0,0,0.8,0.5)"};
|
|
|
|
case "black": {"(1,1,1,0.5)"};
|
|
|
|
case "white": {"(0,0,0,0.5)"};
|
|
|
|
case "red": {"(0.8,0,0,0.5)"};
|
|
|
|
case "green": {"(0,0.8,0,0.5)"};
|
|
|
|
case "yellow": {"(0.8,0.8,0,0.5)"};
|
|
|
|
case "orange": {"(0.8,0.518,0,0.5)"};
|
|
|
|
default {"(0.8,0.8,0,0.5)"};
|
2024-01-08 21:22:52 +00:00
|
|
|
};
|
|
|
|
};
|
2024-01-15 19:13:59 +00:00
|
|
|
private _colorString = "#(argb,8,8,3)color" + _color;
|
2024-01-08 21:22:52 +00:00
|
|
|
|
2024-03-03 00:00:11 +00:00
|
|
|
private _sphere = createVehicle ["Sign_Sphere10cm_F", ASLtoATL _posASL, [], 0, "CAN_COLLIDE"];
|
2024-01-15 19:13:59 +00:00
|
|
|
_sphere setObjectTextureGlobal [0, _colorString];
|
2024-01-08 21:22:52 +00:00
|
|
|
GVAR(dev_eventSpheres) pushBack _sphere;
|
2024-03-03 00:00:11 +00:00
|
|
|
_sphere
|