Option to overwrite Marker Text

Added Option to overwrite marker text and use it for Service Points
This commit is contained in:
He-Man 2017-10-19 19:10:52 +02:00
parent 6216fecf6a
commit 96f72fc98a
4 changed files with 26 additions and 34 deletions

View File

@ -28,7 +28,7 @@
*/
private["_config", "_markerArray", "_markerName", "_ccText"];
params [ ["_mClass",""], ["_mPos",[0,0,0]], ["_data",[]] ];
params [ ["_mClass",""], ["_mPos",[0,0,0]], ["_OverrideTxt",""] ];
if(_mClass isEqualTo "") exitWith {
diag_log "EPOCHDebug: createLocalMarkerSet -1- empty markerClass, nothing to create";
};
@ -83,13 +83,19 @@ if(isNil {Epoch_markerCounter})then{Epoch_markerCounter = 0};
_mName setMarkerSizeLocal _mSize;
_mName setMarkerDirLocal _mDir;
if(_mText isEqualTo "playerName")then{
_mText = str(name player);
if (!(_OverrideTxt isequalto "") && _OverrideTxt isequaltype "") then {
_mName setMarkerText _OverrideTxt;
}
else {
if(_mText isEqualTo "playerName")then{
_mText = str(name player);
};
if!(_mText isEqualTo "")then{
_ccText = call compile _mText;
_mName setMarkerText _ccText;
};
};
_ccText = call compile _mText;
_mName setMarkerTextLocal _ccText;
if!(_mColor isEqualTo "")then{
_mName setMarkerColorLocal _mColor
};

View File

@ -9,26 +9,20 @@ class CfgServicePoint {
pos1,
dist1,
{VehType_1,VehType_1,...},
"Markertype1",
"MarkerColor1",
"MarkerText1"
},
{
pos2,
dist2,
{VehType,VehType,...},
"Markertype2",
"MarkerColor2",
"MarkerText2"
}
*/
{ // Central
{13325,14477,0}, // Pos
40, // max distance
{"Landvehicle","Ship","Tank","AIR"}, // Vehicle Types for SP
"loc_BusStop", // Marker Type
"ColorWhite", // Marker Color
"Service Point Land / Ship / Air" // Marker Text
{"Landvehicle","Ship","Tank","AIR"}, // Vehicle Types for SP
"Service Point Land / Ship / Air" // Marker Text (Leave it Blank to disable Marker)
}
};
};

View File

@ -28,7 +28,7 @@
*/
private["_config", "_markerArray", "_ccText"];
params [ ["_mClass",""], ["_mPos",[0,0,0]], ["_data",[]] ];
params [ ["_mClass",""], ["_mPos",[0,0,0]], ["_OverrideTxt",""] ];
if(_mClass isEqualTo "") exitWith {
diag_log "EPOCHDebug: createGlobalMarkerSet -1- empty markerClass, nothing to create";
};
@ -76,9 +76,14 @@ _return = [];
_mName setMarkerSize _mSize;
_mName setMarkerDir _mDir;
if!(_mText isEqualTo "")then{
_ccText = call compile _mText;
_mName setMarkerText _ccText;
if (!(_OverrideTxt isequalto "") && _OverrideTxt isequaltype "") then {
_mName setMarkerText _OverrideTxt;
}
else {
if!(_mText isEqualTo "")then{
_ccText = call compile _mText;
_mName setMarkerText _ccText;
};
};
if!(_mColor isEqualTo "")then{

View File

@ -225,28 +225,15 @@ _config = 'CfgServicePoint' call EPOCH_returnConfig;
_servicepoints = getArray (_config >> worldname >> 'ServicePoints');
{
_pos = _x;
_markertype = "mil_dot";
_markercolor = "ColorBlack";
_markertxt = "Service Point";
if (count _x > 3) then {
_pos = _x select 0;
if ((_x select 3) isequaltype "") then {
_markertype = _x select 3;
};
if (count _x > 4) then {
if ((_x select 4) isequaltype "") then {
_markercolor = _x select 4;
};
};
if (count _x > 5) then {
if ((_x select 5) isequaltype "") then {
_markertxt = _x select 5;
};
_markertxt = _x select 3;
};
};
if !(_markertype isequalto "") then {
//_marker = createMarker [('ServicePointMarker'+(str _foreachindex)), _pos];
_markers = ["ServicePoint", _pos] call EPOCH_server_createGlobalMarkerSet;
if !(_markertxt isequalto "") then {
_markers = ["ServicePoint", _pos,_markertxt] call EPOCH_server_createGlobalMarkerSet;
if !(surfaceiswater _pos) then {
"Land_HelipadCircle_F" createvehicle _pos;
};