Handle Marker in Masterloop (for later E-Pad use)

This commit is contained in:
He-Man 2018-06-12 20:22:37 +02:00
parent 32e1836d1e
commit 1e64f6702a
4 changed files with 33 additions and 16 deletions

View File

@ -364,17 +364,30 @@ if !(_playerTempKey isEqualTo "EPOCH_playerTemp") then {
}; };
// Check for PlayerMarker and Update or Remove it // Check for PlayerMarker and Update or Remove it
if(_PlayerMarkerName in allMapMarkers)then{ if (_PlayerMarkerEnabled && EPOCH_PlayerMarkerOn && 'ItemGPS' in (assignedItems player)) then {
if!('ItemGPS' in (assignedItems player))then{ if (_PlayerMarkerName in allMapMarkers) then {
['PlayerMarker'] call EPOCH_fnc_deleteLocalMarkerSet;
if(_DeathMarkerName in allMapMarkers)then{
['DeathMarker'] call EPOCH_fnc_deleteLocalMarkerSet;
};
}else{
{ {
(_x select 0) setMarkerPosLocal (position player); (_x select 0) setMarkerPosLocal (position player);
if(count(_x) >= 8)then{(_x select 0) setMarkerTextLocal (call compile (_x select 7))}; if(count(_x) >= 8)then{(_x select 0) setMarkerTextLocal (call compile (_x select 7))};
}forEach _PlayerMarkerArray; }forEach _PlayerMarkerArray;
}
else {
['PlayerMarker',position player] call EPOCH_fnc_createLocalMarkerSet;
};
}
else {
if (_PlayerMarkerName in allMapMarkers) then {
['PlayerMarker'] call EPOCH_fnc_deleteLocalMarkerSet;
};
};
if (_DeathMarkerEnabled && EPOCH_DeathMarkerOn && !(_DeathMarker isEqualTo [])) then {
if !(_DeathMarkerName in allMapMarkers) then {
['DeathMarker',_DeathMarker] call EPOCH_fnc_createLocalMarkerSet
};
}
else {
if (_DeathMarkerName in allMapMarkers) then {
['DeathMarker'] call EPOCH_fnc_deleteLocalMarkerSet;
}; };
}; };
if(_mapOnZoomSetMarkerSize isEqualTo 1)then{ if(_mapOnZoomSetMarkerSize isEqualTo 1)then{

View File

@ -136,7 +136,9 @@ _PlayerMarkerArray = getArray(('CfgMarkerSets' call EPOCH_returnConfig) >> 'Play
_PlayerMarkerName = (_PlayerMarkerArray param [0,[]]) param [0,"EPOCH_PlayerMarker1"]; _PlayerMarkerName = (_PlayerMarkerArray param [0,[]]) param [0,"EPOCH_PlayerMarker1"];
_DeathMarkerName = ((getArray (('CfgMarkerSets' call EPOCH_returnConfig) >> 'DeathMarker' >> 'markerArray')) param [0,[]]) param [0,"EPOCH_DeathMarker1"]; _DeathMarkerName = ((getArray (('CfgMarkerSets' call EPOCH_returnConfig) >> 'DeathMarker' >> 'markerArray')) param [0,[]]) param [0,"EPOCH_DeathMarker1"];
_mapOnZoomSetMarkerSize = ["CfgEpochClient", "mapOnZoomSetMarkerSize", 0] call EPOCH_fnc_returnConfigEntryV2; _mapOnZoomSetMarkerSize = ["CfgEpochClient", "mapOnZoomSetMarkerSize", 0] call EPOCH_fnc_returnConfigEntryV2;
_PlayerMarkerEnabled = (["CfgEpochClient", "playerLocationMarkerGPSOnly", 0] call EPOCH_fnc_returnConfigEntryV2) isequalto 1;
_DeathMarkerEnabled = (["CfgEpochClient", "playerDeathMarkerGPSOnly", 0] call EPOCH_fnc_returnConfigEntryV2) isequalto 1;
_DeathMarker = profileNameSpace getVariable ['EPOCHLastKnownDeath',[]];
_chargeRate = 0; _chargeRate = 0;
_antagonistChanceDefaults = [ _antagonistChanceDefaults = [

View File

@ -59,6 +59,8 @@ EPOCH_nearestLocations = [];
EPOCH_lastFiredLocation = []; EPOCH_lastFiredLocation = [];
EPOCH_IsAutoRunning = false; EPOCH_IsAutoRunning = false;
EPOCH_LastAutoRunKeyPressed = diag_ticktime; EPOCH_LastAutoRunKeyPressed = diag_ticktime;
EPOCH_PlayerMarkerOn = false;
EPOCH_DeathMarkerOn = false;
//Radiation //Radiation
EPOCH_geiger_shown = false; EPOCH_geiger_shown = false;

View File

@ -15,29 +15,29 @@
class playerMarker_on class playerMarker_on
{ {
condition = "dyna_mapPlayerMarkerON && 'ItemGPS' in dyna_assignedItems && !dyna_mapPlayerMarker"; condition = "!EPOCH_PlayerMarkerOn";
action = "['PlayerMarker',position player] call EPOCH_fnc_createLocalMarkerSet"; action = "EPOCH_PlayerMarkerOn = true; if !('ItemGPS' in dyna_assignedItems) then {['You need a GPS to see your Position',5] call epoch_message}";
icon = "x\addons\a3_epoch_community\buttons\gps.paa"; icon = "x\addons\a3_epoch_community\buttons\gps.paa";
tooltip = "Toggle ON player marker"; tooltip = "Toggle ON player marker";
}; };
class playerMarker_off class playerMarker_off
{ {
condition = "dyna_mapPlayerMarkerON && dyna_mapPlayerMarker"; condition = "EPOCH_PlayerMarkerOn";
action = "['PlayerMarker'] call EPOCH_fnc_deleteLocalMarkerSet"; action = "EPOCH_PlayerMarkerOn = false";
icon = "x\addons\a3_epoch_community\buttons\gps.paa"; icon = "x\addons\a3_epoch_community\buttons\gps.paa";
tooltip = "Toggle OFF player marker"; tooltip = "Toggle OFF player marker";
}; };
class deathMarker_on class deathMarker_on
{ {
condition = "dyna_deathMarkerON && dyna_deathMarkerAvail && !dyna_mapDeathMarker"; condition = "!EPOCH_DeathMarkerOn";
action = "['DeathMarker',dyna_deathMarker] call EPOCH_fnc_createLocalMarkerSet"; action = "EPOCH_DeathMarkerOn = true; if ((profileNameSpace getVariable ['EPOCHLastKnownDeath',[]]) isequalto []) then {['You had no GPS on last death',5] call epoch_message}";
icon = "x\addons\a3_epoch_community\icons\skull.paa"; icon = "x\addons\a3_epoch_community\icons\skull.paa";
tooltip = "Toggle ON death marker"; tooltip = "Toggle ON death marker";
}; };
class deathMarker_off class deathMarker_off
{ {
condition = "dyna_deathMarkerON && dyna_mapDeathMarker"; condition = "EPOCH_DeathMarkerOn";
action = "['DeathMarker'] call EPOCH_fnc_deleteLocalMarkerSet"; action = "EPOCH_DeathMarkerOn = false";
icon = "x\addons\a3_epoch_community\icons\skull.paa"; icon = "x\addons\a3_epoch_community\icons\skull.paa";
tooltip = "Toggle OFF death marker"; tooltip = "Toggle OFF death marker";
}; };