Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion addons/zeus/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ PREP(artyFireMissionSMOKE);
PREP(artyFireMissionILLUM);
PREP(calcArtyShellQueue);
PREP(compileArtilleryShells);
PREP(contextMeasureDistance);
PREP(execFireMission);
PREP(getModuleDestination);
PREP(getTargetKnowledge);
Expand Down
2 changes: 0 additions & 2 deletions addons/zeus/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,5 @@ if (hasInterface) then {
call FUNC(moduleUnflipVehicle);
call FUNC(moduleTargetKnowledge);
call FUNC(moduleSuicideDrone);

call FUNC(contextMeasureDistance);
};

42 changes: 0 additions & 42 deletions addons/zeus/functions/fnc_contextMeasureDistance.sqf

This file was deleted.

6 changes: 0 additions & 6 deletions addons/zeus/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,6 @@
<German>Kein Fahrzeug ausgewählt!</German>
</Key>
</Container>
<Container name="misc">
<Key ID="STR_mts_zeus_measureDistance">
<Original>Measure distance</Original>
<German>Entfernung messen</German>
</Key>
</Container>
<Container name="AI">
<Key ID="STR_mts_zeus_AI_knowledgeCategory">
<Original>Knowledge</Original>
Expand Down
1 change: 1 addition & 0 deletions addons/zeus_plotting/$PBOPREFIX$
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
z\mts_enhanced\addons\zeus_plotting
39 changes: 39 additions & 0 deletions addons/zeus_plotting/CfgContext.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
class zen_context_menu_actions {
class Plots {
displayName = CSTRING(DisplayName);
icon = QPATHTOF(ui\ruler.paa);
statement = QUOTE(call FUNC(selectPosition));
args = "LINE";
priority = 15;

class MeasureDistance {
displayName = CSTRING(MeasureDistance);
icon = QPATHTOF(ui\ruler.paa);
statement = QUOTE(call FUNC(selectPosition));
args = "LINE";
};
class MeasureDistanceFromCamera {
displayName = CSTRING(MeasureDistanceFromCamera);
icon = QPATHTOF(ui\ruler.paa);
statement = QUOTE([ARR_2(_args,curatorCamera)] call FUNC(setActivePlot));
args = "LINE";
};
class MeasureRadius {
displayName = CSTRING(MeasureRadius);
icon = QPATHTOF(ui\radius.paa);
statement = QUOTE(call FUNC(selectPosition));
args = "RADIUS";
};
class MeasureOffset {
displayName = CSTRING(MeasureOffset);
icon = QPATHTOF(ui\cuboid.paa);
statement = QUOTE(call FUNC(selectPosition));
args = "RECTANGLE";
};
class ClearPlots {
displayName = CSTRING(ClearPlots);
icon = "A3\3den\Data\Displays\Display3DEN\PanelLeft\entityList_delete_ca.paa";
statement = QUOTE([QQGVAR(plotsCleared)] call CBA_fnc_localEvent);
};
};
};
17 changes: 17 additions & 0 deletions addons/zeus_plotting/CfgEventHandlers.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class Extended_PreStart_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_SCRIPT(XEH_preStart));
};
};

class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_SCRIPT(XEH_preInit));
};
};

class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_SCRIPT(XEH_postInit));
};
};
44 changes: 44 additions & 0 deletions addons/zeus_plotting/CfgFormatters.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
class GVAR(formatters) {
// Formats distance: _this is distance in meters
class Distance {
class Meter {
formatter = QUOTE(FORMAT_1('%1 m',[ARR_3(_this,1,parseNumber (abs _this < 100))] call CBA_fnc_formatNumber));
priority = 100;
};
class Feet {
formatter = QUOTE(FORMAT_1('%1 ft',[ARR_3(_this * 3.281,1,0)] call CBA_fnc_formatNumber));
priority = 90;
};
};

// Formats custom speeds: _this is [distance (m), speed (m/s)]
class Speed {
class kmh {
formatter = QUOTE(call FUNC(formatSpeedKmh));
priority = 100;

// Defines static speeds for this format to cycle through when plot is not attached to object
// Must have at least one entry
speeds[] = {
3.333, // Unit with weapon lowered running in fast combat pace: takes ~12 km/h -> 3.333 m/s. This is with ACE mod loaded. Without ACE, the unit is a bit faster.
8.333, // Vehicle at 30 km/h
13.889, // Vehicle at 50 km/h
27.778, // Vehicle at 100 km/h
69.444, // Helicopter at 250 km/h
166.667, // Jet at 600 km/h
};
};
};

// Formats direction: _this is direction in the range 0..360 degrees.
class Azimuth {
class Degree {
formatter = QUOTE(FORMAT_1('%1°',_this toFixed 0));
priority = 100;
};
class NATOMil {
formatter = QUOTE(FORMAT_1('%1 mil',(_this * 17.7778) toFixed 0));
priority = 90;
};
};
};
1 change: 1 addition & 0 deletions addons/zeus_plotting/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This addon is temporary and will be removed in the future until the equivalent in ZEN is merged.
19 changes: 19 additions & 0 deletions addons/zeus_plotting/XEH_PREP.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
PREP(addPlot);
PREP(clearPlots);
PREP(compileFormatters);
PREP(drawLine);
PREP(drawPlots);
PREP(drawRadius);
PREP(drawRectangle);
PREP(formatSpeedKmh);
PREP(formatTravelTime);
PREP(isPosInCylinder);
PREP(isValidPlot);
PREP(onDraw);
PREP(onDraw3D);
PREP(onKeyDown);
PREP(onLoad);
PREP(onMouseButtonDown);
PREP(onUnload);
PREP(selectPosition);
PREP(setActivePlot);
9 changes: 9 additions & 0 deletions addons/zeus_plotting/XEH_postInit.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "script_component.hpp"

if (hasInterface) then {
["zen_curatorDisplayLoaded", LINKFUNC(onLoad)] call CBA_fnc_addEventHandler;
["zen_curatorDisplayUnloaded", LINKFUNC(onUnload)] call CBA_fnc_addEventHandler;

[QGVAR(plotAdded), LINKFUNC(addPlot)] call CBA_fnc_addEventHandler;
[QGVAR(plotsCleared), LINKFUNC(clearPlots)] call CBA_fnc_addEventHandler;
};
38 changes: 38 additions & 0 deletions addons/zeus_plotting/XEH_preInit.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#include "script_component.hpp"

ADDON = false;

PREP_RECOMPILE_START;
#include "XEH_PREP.hpp"
PREP_RECOMPILE_END;

if (hasInterface) then {
GVAR(draw3DAdded) = false;

GVAR(plotTypes) = createHashMapFromArray [
["LINE", LINKFUNC(drawLine)],
["RADIUS", LINKFUNC(drawRadius)],
["RECTANGLE", LINKFUNC(drawRectangle)]
];

GVAR(currentDistanceFormatter) = 0;
GVAR(currentSpeedFormatter) = 0;
GVAR(currentSpeedIndex) = 0;
GVAR(currentAzimuthFormatter) = 0;

// Unique ID for creating plots
GVAR(nextID) = 0;
// Currently active plot shown at cursor in format [type, start]
GVAR(activePlot) = [];
// All plots, keys are IDs, values [type, start, end]
GVAR(plots) = createHashMap;
// All plot IDs ordered by creation time, last is newest
GVAR(history) = [];
};

call FUNC(compileFormatters);

#include "initSettings.inc.sqf"
#include "initKeybinds.inc.sqf"

ADDON = true;
3 changes: 3 additions & 0 deletions addons/zeus_plotting/XEH_preStart.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "script_component.hpp"

#include "XEH_PREP.hpp"
19 changes: 19 additions & 0 deletions addons/zeus_plotting/config.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include "script_component.hpp"

class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"mts_main", "zen_common", "zen_context_menu"};
author = ECSTRING(main,authors);
authors[] = {"Timi007"};
url = ECSTRING(main,URL);
VERSION_CONFIG;
};
};

#include "CfgEventHandlers.hpp"
#include "CfgContext.hpp"
#include "CfgFormatters.hpp"
Loading