Skip to content

Commit

Permalink
global marker sets and map upgrade
Browse files Browse the repository at this point in the history
New global marker sets and functions.
Replace all markers for events and locations(fully configurable in CfgMarkerSets)
New MapScale marker zoom feature.
  • Loading branch information
ravmustang committed Oct 18, 2017
1 parent 90f7b5c commit b2cf56a
Show file tree
Hide file tree
Showing 19 changed files with 368 additions and 93 deletions.
Expand Up @@ -34,7 +34,7 @@ if(_mClass isEqualTo "") exitWith {
};

// get config for custom marker sets
_config = 'CfgLocalMarkerSets' call EPOCH_returnConfig;
_config = 'CfgMarkerSets' call EPOCH_returnConfig;
if !(isclass (_config >> _mClass)) exitwith {
diag_log "EPOCHDebug: createLocalMarkerSet -2- not a class markerClass, nothing to create";
};
Expand Down
Expand Up @@ -26,7 +26,7 @@ if(_mClass isEqualTo "") exitWith {
};

// get config for custom marker sets
_config = 'CfgLocalMarkerSets' call EPOCH_returnConfig;
_config = 'CfgMarkerSets' call EPOCH_returnConfig;
if !(isclass (_config >> _mClass)) exitwith {
diag_log "EPOCHDebug: deleteLocalMarkerSet -2- not a class markerClass, nothing to delete";
};
Expand Down
49 changes: 48 additions & 1 deletion Sources/epoch_code/compile/setup/masterLoop/Event1.sqf
Expand Up @@ -359,7 +359,7 @@ if !(_playerTempKey isEqualTo "EPOCH_playerTemp") then {
};

// Check for PlayerMarker and Update or Remove it
_config = 'CfgLocalMarkerSets' call EPOCH_returnConfig;
_config = 'CfgMarkerSets' call EPOCH_returnConfig;
_markerArray = getArray(_config >> 'PlayerMarker' >> 'markerArray');
_markerName = (_markerArray select 0) select 0;

Expand All @@ -377,6 +377,53 @@ if(_markerName in allMapMarkers)then{
};
};

if(visibleMap)then{
_mapControl = (findDisplay 12) displayCtrl 51;
_mapScale = ctrlMapScale _mapControl;
_zoomMarkers = allMapMarkers;
if(isNil {EPOCH_lastMapScale})then{EPOCH_lastMapScale = 0};
for "_i" from 0 to ((count _zoomMarkers) - 1) do {
_zoomMarker = _zoomMarkers select _i;
switch(true)do{
case ( (_mapScale >= 0.95) && (_mapScale <= 1) ): {
_zoomMarker setMarkerSizeLocal [0.666,0.666];
//_zoomMarker setMarkerAlphaLocal 0;
};
case ( (_mapScale >= 0.75) && (_mapScale < 0.95) ): {
_zoomMarker setMarkerSizeLocal [0.8,0.8];
};
case ( (_mapScale >= 0.55) && (_mapScale < 0.75) ): {
_zoomMarker setMarkerSizeLocal [1,1];
};
case ( (_mapScale >= 0.5) && (_mapScale < 0.55) ): {
_zoomMarker setMarkerSizeLocal [1.1,1.1];
};
case ( (_mapScale >= 0.45) && (_mapScale < 0.5) ): {
_zoomMarker setMarkerSizeLocal [1.2,1.2];
};
case ( (_mapScale >= 0.35) && (_mapScale < 0.45) ): {
_zoomMarker setMarkerSizeLocal [1.4,1.4];
};
case ( (_mapScale >= 0.25) && (_mapScale < 0.35) ): {
_zoomMarker setMarkerSizeLocal [1.666,1.666];
};
case ( (_mapScale >= 0.15) && (_mapScale < 0.25) ): {
_zoomMarker setMarkerSizeLocal [1.8,1.8];
};
case ( (_mapScale >= 0.1) && (_mapScale < 0.15) ): {
_zoomMarker setMarkerSizeLocal [1.9,1.9];
};
case ( (_mapScale >= 0.0666) && (_mapScale < 0.1) ): {
_zoomMarker setMarkerSizeLocal [2.2,2.2];
};
case ( (_mapScale >= 0) && (_mapScale < 0.0666) ): {
_zoomMarker setMarkerSizeLocal [2.666,2.666];
};
};
};
EPOCH_lastMapScale = _mapScale;
};

// force update
if (EPOCH_forceUpdateNow) then {
EPOCH_forceUpdateNow = false;
Expand Down
Expand Up @@ -41,12 +41,12 @@ class CfgActionMenu
dyna_WeapsMagsTurret = "call {_out = [];if (dyna_inVehicle) then {_added = [];{_weapon = _x;_WeaponMags = ((vehicle player) magazinesTurret dyna_Turret) select {(_x in (getArray (configFile >> 'CfgWeapons' >> _weapon >> 'magazines'))) && !((getText (configFile >> 'CfgMagazines' >> _x >> 'picture')) isequalto '')};if !(_WeaponMags isequalto []) then {{if !(_x in _added) then {_out pushback [_weapon,_x];_added pushback _x;};} foreach _WeaponMags;};} foreach dyna_weaponsTurret;};_out}";

dyna_mapPlayerMarkerON = "(getNumber(('CfgEpochClient' call EPOCH_returnConfig) >> 'playerLocationMarkerGPSOnly') isEqualTo 1)";
dyna_mapPlayerMarker = "(((getArray(('CfgLocalMarkerSets' call EPOCH_returnConfig) >> 'PlayerMarker' >> 'markerArray') select 0) select 0) in allMapMarkers)";
dyna_mapPlayerMarker = "(((getArray(('CfgMarkerSets' call EPOCH_returnConfig) >> 'PlayerMarker' >> 'markerArray') select 0) select 0) in allMapMarkers)";

dyna_deathMarkerON = "(getNumber(('CfgEpochClient' call EPOCH_returnConfig) >> 'playerDeathMarkerGPSOnly') isEqualTo 1)";
dyna_deathMarker = "profileNameSpace getVariable['EPOCHLastKnownDeath',[]]";
dyna_deathMarkerAvail = "!(dyna_deathMarker isEqualTo [])";
dyna_mapDeathMarker = "(((getArray(('CfgLocalMarkerSets' call EPOCH_returnConfig) >> 'DeathMarker' >> 'markerArray') select 0) select 0) in allMapMarkers)";
dyna_mapDeathMarker = "(((getArray(('CfgMarkerSets' call EPOCH_returnConfig) >> 'DeathMarker' >> 'markerArray') select 0) select 0) in allMapMarkers)";
};

class self
Expand Down
156 changes: 148 additions & 8 deletions Sources/epoch_config/Configs/CfgMarkerSets.hpp
Expand Up @@ -5,24 +5,164 @@
Use ['Name',position] call EPOCH_fnc_createLocalMarkerSet;
Global Markers are mostly for server use
Use ['Name',position] call EPOCH_fnc_createGlobalMarkerSet;
Use ['Name',position] call EPOCH_server_createGlobalMarkerSet;
*/
class CfgLocalMarkerSets
class CfgMarkerSets
{
brushes[] = {"Solid","SolidFull","Horizontal","Vertical","Grid","FDiagonal","BDiagonal","DiagGrid","Cross","Border","SolidBorder"};
class PlayerMarker {
markerArray[] = {
{"PlayerMarker1","ICON","EpochGPS","ColorBlue",1,{0.8,0.8},0,"format['%1/%2',(format[mapGridPosition player]) select [0,3],(format[mapGridPosition player]) select [3,3]]"},
{"PlayerMarker2","ICON","EpochActive_Hex","ColorBlue",1,{0.8,0.8}},
{"PlayerMarker3","ICON","EpochBG_Hex","ColorWhite",0.3,{0.8,0.8}}
{"PlayerMarker1","ICON","EpochActive_Hex","ColorBlue",1,{0.9,0.9}},
{"PlayerMarker2","ICON","EpochBG_Hex","ColorWhite",0.3,{0.9,0.9}},
{"PlayerMarker3","ICON","EpochGPS","ColorBlue",1,{0.8,0.8},0,"format['%1/%2',(format[mapGridPosition player]) select [0,3],(format[mapGridPosition player]) select [3,3]]"}
};
};
class DeathMarker {
markerArray[] = {
{"DeathMarker1","ICON","EpochSkull","ColorRed",1,{0.8,0.8},0,"str(name player)"},
{"DeathMarker2","ICON","EpochActive_Circle","ColorRed",1,{0.8,0.8}},
{"DeathMarker3","ICON","EpochBG_Circle","ColorPink",0.3,{0.8,0.8}}

{"DeathMarker1","ICON","EpochActive_Circle","ColorRed",1,{0.9,0.9}},
{"DeathMarker2","ICON","EpochBG_Circle","ColorPink",0.3,{0.9,0.9}},
{"DeathMarker3","ICON","EpochSkull","ColorRed",1,{0.8,0.8},0,"str(name player)"}
};
};
class EpochDebugBox {
markerArray[] = {
{"","ICON","EpochActive_Square","ColorGreen",1,{1,1}},
{"","ICON","EpochBG_Square","ColorBlack",0.2,{1,1}},
{"","ICON","EpochRespawn","ColorGreen",0.75,{1,1}}
};
};
class PlantSpawn {
markerArray[] = {
{"","ICON","EpochActive_Diamond","ColorGreen",1,{1.1,1.1}},
{"","ICON","EpochBG_Diamond","ColorBlack",0.2,{1.1,1.1}},
{"","ICON","EpochPlant","ColorGreen",0.9,{1.2,1.2}}
};
};
class AirDrop {
markerArray[] = {
{"","ICON","EpochActive_Diamond","ColorGreen",1,{1.1,1.1}},
{"","ICON","EpochBG_Diamond","ColorBlack",0.2,{1.1,1.1}},
{"","ICON","EpochAirdrop","ColorGreen",0.75,{1.2,1.2}}
};
};
class Carnival {
markerArray[] = {
{"","ICON","EpochActive_Diamond","ColorOrange",1,{1.2,1.2}},
{"","ICON","EpochBG_Diamond","ColorBlack",0.2,{1.2,1.2}},
{"","ICON","EpochCarnival","ColorOrange",0.75,{1.3,1.3}}
};
};
class Container {
markerArray[] = {
{"","ICON","EpochActive_Diamond","ColorOrange",1,{1.2,1.2}},
{"","ICON","EpochBG_Diamond","ColorBlack",0.2,{1.2,1.2}},
{"","ICON","EpochContainer","ColorOrange",0.75,{1.3,1.3}}
};
};
class EarthQuake {
markerArray[] = {
{"","ICON","EpochActive_Circle","ColorGrey",1,{1.2,1.2}},
{"","ICON","EpochBG_Circle","ColorBlack",0.2,{1.2,1.2}},
{"","ICON","EpochGem","ColorRed",1,{1.3,1.3}}
};
};
class ServicePoint {
markerArray[] = {
{"","ICON","EpochBG_Circle","ColorGrey",0.25,{0.85,0.85}},
{"","ICON","EpochActive_Circle","ColorBlack",1,{0.85,0.85}},
{"","ICON","EpochService","ColorGrey",1,{0.9,0.9},0,"'Service Point'"}
};
};
class Radiation {
markerArray[] = {
{"","ICON","EpochBG_Triangle","ColorBlack",0.3,{1.8,1.8}},
{"","ICON","EpochActive_Triangle","ColorYellow",1,{1.7,1.7}},
{"","ICON","EpochRadiation","ColorYellow",1,{0.95,0.95}}
};
};
class Satellite {
markerArray[] = {
{"","ICON","EpochBG_Triangle","ColorBlack",0.15,{1.5,1.5},58},
{"","ICON","EpochActive_Triangle","ColorYellow",0.5,{1.3,1.3},58},
{"","ICON","EpochSatellite","ColorYellow",1,{0.75,0.75},58}
};
};
class MissionNoob {
markerArray[] = {
{"","ICON","EpochBG_Square","ColorBlack",0.15,{1.2,1.2}},
{"","ICON","EpochActive_Square","ColorGreen",0.5,{1.2,1.2}},
{"","ICON","EpochMissionNoob1","ColorYellow",1,{1,1}}
};
};
class MissionNoobPlus {
markerArray[] = {
{"","ICON","EpochBG_Square","ColorBlack",0.15,{1.2,1.2}},
{"","ICON","EpochActive_Square","ColorGreen",0.75,{1.2,1.2}},
{"","ICON","EpochMissionNoob2","ColorYellow",1,{1,1}}
};
};
class MissionSurvivor {
markerArray[] = {
{"","ICON","EpochBG_Square","ColorBlack",0.15,{1.2,1.2}},
{"","ICON","EpochActive_Square","ColorBlue",0.5,{1.2,1.2}},
{"","ICON","EpochMissionMedium1","ColorGreen",1,{1,1}}
};
};
class MissionSurvivorPlus {
markerArray[] = {
{"","ICON","EpochBG_Square","ColorBlack",0.15,{1.2,1.2}},
{"","ICON","EpochActive_Square","ColorBlue",0.75,{1.2,1.2}},
{"","ICON","EpochMissionMedium2","ColorGreen",1,{1,1}}
};
};
class MissionSlaughter {
markerArray[] = {
{"","ICON","EpochBG_Square","ColorBlack",0.15,{1.2,1.2}},
{"","ICON","EpochActive_Square","ColorRed",0.5,{1.2,1.2}},
{"","ICON","EpochMissionVeteran1","ColorBlue",1,{1,1}}
};
};
class MissionSlaughterPlus {
markerArray[] = {
{"","ICON","EpochBG_Square","ColorBlack",0.15,{1.2,1.2}},
{"","ICON","EpochActive_Square","ColorRed",0.75,{1.2,1.2}},
{"","ICON","EpochMissionVeteran2","ColorBlue",1,{1,1}}
};
};
class IGSafeZones {
markerArray[] = {
{"","ICON","mil_warning","ColorRed",1,{1,1},0,"format['SafeZone%1',IGSZCounter];IGSZCounter = IGSZCounter+1"},
{"","ELLIPSE","Grid","ColorGreen",1,{250,250}}
};
};
class StaticTrader {
markerArray[] = {
{"","ICON","EpochBG_Circle","ColorWhite",0.15,{0.8,0.8}},
{"","ICON","EpochActive_Circle","ColorRed",0.75,{0.8,0.8}},
{"","ICON","EpochStaticTrader","ColorBlack",1,{0.7,0.7}}
};
};
class DynamicTrader {
markerArray[] = {
{"","ICON","EpochBG_Circle","ColorWhite",0.15,{0.8,0.8}},
{"","ICON","EpochActive_Circle","ColorGreen",0.75,{0.8,0.8}},
{"","ICON","EpochDynamicTrader","ColorBrown",1,{0.7,0.7}}
};
};
class NewDynamicTrader {
markerArray[] = {
{"","ICON","EpochBG_Circle","ColorWhite",0.15,{0.8,0.8}},
{"","ICON","EpochActive_Circle","ColorKhaki",0.75,{0.8,0.8}},
{"","ICON","EpochStaticTrader","ColorKhaki",1,{0.7,0.7}}
};
};
class Shipwreck {
markerArray[] = {
{"","ICON","EpochBG_Circle","ColorWhite",0.15,{1.2,1.2}},
{"","ICON","EpochActive_Circle","ColorOrange",1,{1.2,1.2}},
{"","ICON","EpochShipwreck","ColorOrange",1,{1.3,1.3}}
};
};
};
Expand Up @@ -22,11 +22,7 @@ private ["_item","_marker"];
_item setMass 220;

if (EPOCH_SHOW_BOATLOOT) then {
_marker = createMarker[str(_x), _x];
_marker setMarkerShape "ICON";
_marker setMarkerType "mil_dot";
// _marker setMarkerText "Shipwreck";
_marker setMarkerColor "ColorOrange";
_markers = ["Shipwreck",_x] call EPOCH_server_createGlobalMarkerSet;
};
};
} foreach (getArray (configFile >> "CfgEpoch" >> worldname >> "containerPos"));
@@ -0,0 +1,91 @@
/*
Author: DirtySanchez
Contributors:
Description:
Utilize new Epoch Active Markers, Backgrounds and Icons courtesy of DrokZ.
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_server/EPOCH_server_createGlobalMarkerSet.sqf
usage:
[_markerClass, _position] call EPOCH_server_createGlobalMarkerSet;
_markerClass(_mClass) - use one of the class markers in the epoch_configs/Configs/CfgMarkerSets.hpp or create new
_position(_mPos) - position you would like to place the marker set on the map
Example:
1. ['DeathMarker',_pos] call EPOCH_server_createGlobalMarkerSet;
2. ['PlayerMarker',_pos] call EPOCH_server_createGlobalMarkerSet;
*/
private["_config", "_markerArray", "_ccText"];

params [ ["_mClass",""], ["_mPos",[0,0,0]], ["_data",[]] ];
if(_mClass isEqualTo "") exitWith {
diag_log "EPOCHDebug: createGlobalMarkerSet -1- empty markerClass, nothing to create";
};

// get config for custom marker sets
_config = 'CfgMarkerSets' call EPOCH_returnConfig;
if !(isclass (_config >> _mClass)) exitwith {
diag_log "EPOCHDebug: createGlobalMarkerSet -2- not a class markerClass, nothing to create";
};

// get array for custom marker set
_markerArray = getArray(_config >> _mClass >> "markerArray");
if(_markerArray isEqualTo []) exitWith {
diag_log "EPOCHDebug: createGlobalMarkerSet -3- empty markerArray, nothing to create";
};

// check for defined Marker counter
if(isNil {Epoch_markerCounterGlobal})then{Epoch_markerCounterGlobal = 0};

_return = [];
// run forEach loop on array
{
// double check all, use these defaults if not defined
_x params [
["_mName",format["globalMarker__%1", Epoch_markerCounterGlobal]],
["_mShape","ICON"],
["_mType","hd_dot"],
["_mColor","ColorBlack"],
["_mAlpha",1],
["_mSize",[0.8,0.8]],
["_mDir",0],
["_mText",""]
];
_mName = format["globalMarker_%1", Epoch_markerCounterGlobal];
_marker = createMarker [_mName, _mPos];
_return pushBack _mName;
_mName setMarkerShape _mShape;
if!(_mShape isEqualTo "ICON")then{
if!(_mType in (getArray(_config >> "brushes")))exitWith{
diag_log "EPOCHDebug: createGlobalMarkerSet -5- Shape is Ellipse or Rectangle and needs a Brush Type";
};
};
_mName setMarkerType _mType;
_mName setMarkerAlpha _mAlpha;
_mName setMarkerSize _mSize;
_mName setMarkerDir _mDir;

if!(_mText isEqualTo "")then{
_ccText = call compile _mText;
_mName setMarkerText _ccText;
};

if!(_mColor isEqualTo "")then{
_mName setMarkerColor _mColor
};

Epoch_markerCounterGlobal = Epoch_markerCounterGlobal + 1;
}forEach _markerArray;

_return

0 comments on commit b2cf56a

Please sign in to comment.