From f8a7a569ced606145093b9d37075df5f46aaa17b Mon Sep 17 00:00:00 2001 From: "DESKTOP-UH65DCE\\MusTanG" Date: Mon, 23 Oct 2017 22:31:38 -0500 Subject: [PATCH] mapOnZoomSetMarkerSize upgrade Add exitWith to remove wasted resizing during scrolling Add config entry for custom adjustments Change how adjustment calculation is made. Added new min calculation. Adjust cfg marker sets sizing to fit new setup :metal: --- .../compile/setup/masterLoop/Event1.sqf | 14 ++- .../epoch_config/Configs/CfgMarkerSets.hpp | 105 ++++++++++-------- 2 files changed, 66 insertions(+), 53 deletions(-) diff --git a/Sources/epoch_code/compile/setup/masterLoop/Event1.sqf b/Sources/epoch_code/compile/setup/masterLoop/Event1.sqf index 452b3425..54ab1adf 100644 --- a/Sources/epoch_code/compile/setup/masterLoop/Event1.sqf +++ b/Sources/epoch_code/compile/setup/masterLoop/Event1.sqf @@ -391,16 +391,20 @@ if(getNumber(('CfgEpochClient' call EPOCH_returnConfig) >> 'mapOnZoomSetMarkerSi if(_mapScale != EPOCH_lastMapScale)then{ EPOCH_lastMapScale = _mapScale; for "_i" from 0 to ((count _mapMarkers) - 1) do { + if(_mapScale != EPOCH_lastMapScale)exitWith{}; _zoomMarker = _mapMarkers select _i; private "_markerString"; _markerString = toArray _zoomMarker; _markerString resize 6; if (toString _markerString == "EPOCH_") then { - _mSize = missionNamespace getVariable[_zoomMarker,[0.8,0.8]]; - _adjusted = _mapScale * 2.25; - _sizeX = (((_mSize select 0) / _adjusted) min 2.333) max 0.666; - _sizeY = (((_mSize select 1) / _adjusted) min 2.333) max 0.666; - _zoomMarker setMarkerSizeLocal [_sizeX,_sizeY]; + _mSize = missionNamespace getVariable[_zoomMarker,[0.666,0.666]]; + _adj = 1.666; + _mapScaler = getArray(_config >> "mapScalerPresets"); + { + if(_mapScale <= (_x select 0))then{_adj = (_x select 1)}; + }forEach _mapScaler; + _min = (0.666/_mapScale) min 2.666; + _zoomMarker setMarkerSizeLocal [(((_mSize select 0) / (_mapScale * _adj)) min _min) max 0.666, (((_mSize select 1) / (_mapScale * _adj)) min _min) max 0.666]; }; }; }; diff --git a/Sources/epoch_config/Configs/CfgMarkerSets.hpp b/Sources/epoch_config/Configs/CfgMarkerSets.hpp index fada205d..89dfdc01 100644 --- a/Sources/epoch_config/Configs/CfgMarkerSets.hpp +++ b/Sources/epoch_config/Configs/CfgMarkerSets.hpp @@ -40,6 +40,15 @@ class CfgMarkerSets { brushes[] = {"Solid","SolidFull","Horizontal","Vertical","Grid","FDiagonal","BDiagonal","DiagGrid","Cross","Border","SolidBorder"}; + mapScalerPresets[] = { + {1.00,2}, + {0.80,2.25}, + {0.60,2.5}, + {0.30,2.75}, + {0.21,3.25}, + {0.12,3.5}, + {0.8,3.75} + }; class PlayerMarker { markerArray[] = { {"EPOCH_PlayerMarker1","ICON","EpochActive_Hex","ColorBlue",1,{0.6,0.6}}, @@ -64,9 +73,9 @@ class CfgMarkerSets }; 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}} + {"","ICON","EpochActive_Diamond","ColorGreen",1,{0.8,0.8}}, + {"","ICON","EpochBG_Diamond","ColorBlack",0.2,{0.8,0.8}}, + {"","ICON","EpochPlant","ColorGreen",0.9,{0.9,0.9}} }; }; class AirDrop { @@ -78,23 +87,23 @@ class CfgMarkerSets }; 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}} + {"","ICON","EpochActive_Diamond","ColorOrange",1,{1,1}}, + {"","ICON","EpochBG_Diamond","ColorBlack",0.2,{1,1}}, + {"","ICON","EpochCarnival","ColorOrange",0.75,{1.1,1.1}} }; }; 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}} + {"","ICON","EpochActive_Diamond","ColorOrange",1,{1,1}}, + {"","ICON","EpochBG_Diamond","ColorBlack",0.2,{1,1}}, + {"","ICON","EpochContainer","ColorOrange",0.75,{1.1,1.1}} }; }; 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}} + {"","ICON","EpochActive_Circle","ColorGrey",1,{0.8,0.8}}, + {"","ICON","EpochBG_Circle","ColorBlack",0.2,{0.8,0.8}}, + {"","ICON","EpochGem","ColorRed",1,{0.9,0.9}} }; }; class ServicePoint { @@ -106,58 +115,58 @@ class CfgMarkerSets }; class Radiation { markerArray[] = { - {"","ICON","EpochBG_Triangle","ColorBlack",0.3,{1.3,1.3}}, - {"","ICON","EpochActive_Triangle","ColorYellow",1,{1.1,1.1}}, - {"","ICON","EpochRadiation","ColorYellow",1,{0.6,0.6}} + {"","ICON","EpochBG_Triangle","ColorBlack",0.3,{0.7,0.7}}, + {"","ICON","EpochActive_Triangle","ColorYellow",1,{0.7,0.7}}, + {"","ICON","EpochRadiation","ColorYellow",1,{0.9,0.9}} }; }; class Satellite { markerArray[] = { - {"","ICON","EpochBG_Triangle","ColorBlack",0.15,{1.3,1.3},58}, - {"","ICON","EpochActive_Triangle","ColorYellow",0.5,{1.1,1.1},58}, - {"","ICON","EpochSatellite","ColorYellow",1,{0.6,0.6},58} + {"","ICON","EpochBG_Triangle","ColorBlack",0.15,{0.7,0.7},58}, + {"","ICON","EpochActive_Triangle","ColorYellow",0.5,{0.7,0.7},58}, + {"","ICON","EpochSatellite","ColorYellow",1,{0.9,0.9},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}} + {"","ICON","EpochBG_Square","ColorBlack",0.15,{1,1}}, + {"","ICON","EpochActive_Square","ColorGreen",0.5,{1,1}}, + {"","ICON","EpochMissionNoob1","ColorYellow",1,{0.9,0.9}} }; }; 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}} + {"","ICON","EpochBG_Square","ColorBlack",0.15,{1,1}}, + {"","ICON","EpochActive_Square","ColorGreen",0.75,{1,1}}, + {"","ICON","EpochMissionNoob2","ColorYellow",1,{0.9,0.9}} }; }; 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}} + {"","ICON","EpochBG_Square","ColorBlack",0.15,{1,1}}, + {"","ICON","EpochActive_Square","ColorBlue",0.5,{1,1}}, + {"","ICON","EpochMissionMedium1","ColorGreen",1,{0.9,0.9}} }; }; 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}} + {"","ICON","EpochBG_Square","ColorBlack",0.15,{1,1}}, + {"","ICON","EpochActive_Square","ColorBlue",0.75,{1,1}}, + {"","ICON","EpochMissionMedium2","ColorGreen",1,{0.9,0.9}} }; }; 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}} + {"","ICON","EpochBG_Square","ColorBlack",0.15,{1,1}}, + {"","ICON","EpochActive_Square","ColorRed",0.5,{1,1}}, + {"","ICON","EpochMissionVeteran1","ColorBlue",1,{0.9,0.9}} }; }; 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}} + {"","ICON","EpochBG_Square","ColorBlack",0.15,{1,1}}, + {"","ICON","EpochActive_Square","ColorRed",0.75,{1,1}}, + {"","ICON","EpochMissionVeteran2","ColorBlue",1,{0.9,0.9}} }; }; class IGSafeZones { @@ -168,30 +177,30 @@ class CfgMarkerSets }; 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}} + {"","ICON","EpochBG_Circle","ColorWhite",0.15,{0.6,0.6}}, + {"","ICON","EpochActive_Circle","ColorRed",0.75,{0.6,0.6}}, + {"","ICON","EpochStaticTrader","ColorBlack",1,{0.5,0.5}} }; }; 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}} + {"","ICON","EpochBG_Circle","ColorWhite",0.15,{0.6,0.6}}, + {"","ICON","EpochActive_Circle","ColorGreen",0.75,{0.6,0.6}}, + {"","ICON","EpochDynamicTrader","ColorBrown",1,{0.5,0.5}} }; }; 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}} + {"","ICON","EpochBG_Circle","ColorWhite",0.15,{0.6,0.6}}, + {"","ICON","EpochActive_Circle","ColorKhaki",0.75,{0.6,0.6}}, + {"","ICON","EpochStaticTrader","ColorKhaki",1,{0.5,0.5}} }; }; class Shipwreck { markerArray[] = { - {"","ICON","EpochBG_Circle","ColorWhite",0.15,{0.8,0.8}}, - {"","ICON","EpochActive_Circle","ColorOrange",1,{0.8,0.8}}, - {"","ICON","EpochShipwreck","ColorOrange",1,{0.7,0.7}} + {"","ICON","EpochBG_Circle","ColorWhite",0.15,{0.6,0.6}}, + {"","ICON","EpochActive_Circle","ColorOrange",1,{0.6,0.6}}, + {"","ICON","EpochShipwreck","ColorOrange",1,{0.5,0.5}} }; }; };