From 7bdfe03c922fcd92a306871b5a7a59ec476af640 Mon Sep 17 00:00:00 2001
From: jokoho48
Date: Sun, 9 Aug 2015 02:19:34 +0200
Subject: [PATCH 01/54] Code cleanup of Concertina_wire module
---
addons/concertina_wire/XEH_init.sqf | 5 ++-
.../concertina_wire/functions/fnc_deploy.sqf | 35 ++++++++++---------
.../functions/fnc_dismount.sqf | 8 ++---
.../functions/fnc_dismountSuccess.sqf | 22 ++++++------
.../functions/fnc_handleDamage.sqf | 9 ++---
.../functions/fnc_handleKilled.sqf | 8 ++---
.../functions/fnc_vehicleDamage.sqf | 12 +++----
7 files changed, 45 insertions(+), 54 deletions(-)
diff --git a/addons/concertina_wire/XEH_init.sqf b/addons/concertina_wire/XEH_init.sqf
index dbce4a9b92..dc6424f172 100644
--- a/addons/concertina_wire/XEH_init.sqf
+++ b/addons/concertina_wire/XEH_init.sqf
@@ -1,4 +1,3 @@
#include "script_component.hpp"
-
-PARAMS_1(_wire);
-_wire addEventHandler ["HandleDamage", {_this call FUNC(handleDamage)}];
\ No newline at end of file
+params ["_wire"];
+_wire addEventHandler ["HandleDamage", FUNC(handleDamage)];
diff --git a/addons/concertina_wire/functions/fnc_deploy.sqf b/addons/concertina_wire/functions/fnc_deploy.sqf
index 5548cad649..aedc8b9608 100644
--- a/addons/concertina_wire/functions/fnc_deploy.sqf
+++ b/addons/concertina_wire/functions/fnc_deploy.sqf
@@ -8,10 +8,9 @@
* 1: unit
*
* Return Value:
- * Nothing
- *
- * Return value:
* None
+ *
+ * Public: No
*/
#include "script_component.hpp"
@@ -22,7 +21,7 @@ private ["_wireNoGeo", "_dir", "_pos", "_wireNoGeoPos"];
_wireNoGeo = "ACE_ConcertinaWireNoGeo" createVehicle [0,0,0];
{
_wireNoGeo animate [_x, 1];
-} foreach WIRE_FAST;
+} count WIRE_FAST;
GVAR(placer) = _unit;
_dir = getDir _unit;
@@ -37,8 +36,9 @@ deleteVehicle _wirecoil;
_unit setVariable [QGVAR(wireDeployed), false];
GVAR(deployPFH) = [{
- EXPLODE_3_PVT(_this select 0,_wireNoGeo,_wireNoGeoPos,_unit);
-
+ params ["_args", "_idPFH"];
+ _args params ["_wireNoGeo", "_wireNoGeoPos", "_unit"];
+
private ["_range", "_posStart", "_posEnd", "_dirVect", "_dir", "_anim", "_wire"];
_posStart = (_wireNoGeo modelToWorldVisual (_wireNoGeo selectionPosition "start")) call EFUNC(common,positionToASL);
_posEnd = (getPosASL _unit) vectorAdd (vectorDir _unit);
@@ -46,37 +46,38 @@ GVAR(deployPFH) = [{
_dir = _dirVect call CBA_fnc_vectDir;
_range = vectorMagnitude _dirVect;
_anim = 0 max (1 - (_range / 12));
-
+
if (!(alive _unit) || _range >= 12 || (_unit getVariable [QGVAR(wireDeployed), false])) exitWith {
_wire = "ACE_ConcertinaWire" createvehicle [0, 0, 0];
{
_wire animate [_x, _anim];
- } foreach WIRE_FAST;
-
+ } count WIRE_FAST;
+
[{
- EXPLODE_5_PVT(_this select 0,_wireNoGeo,_wire,_anim,_dir,_wireNoGeoPos);
+ params ["_args", "_idPFH"];
+ _args params ["_wireNoGeo", "_wire", "_anim", "_dir", "_wireNoGeoPos"];
if (_wire animationPhase "wire_2" == _anim) then {
deleteVehicle _wireNoGeo;
_wire setDir _dir;
_wire setPosASL _wireNoGeoPos;
- [_this select 1] call CBA_fnc_removePerFrameHandler;
+ [_idPFH] call CBA_fnc_removePerFrameHandler;
};
}, 0, [_wireNoGeo, _wire, _anim, _dir, _wireNoGeoPos]] call CBA_fnc_addPerFrameHandler;
-
+
[_unit, "DefaultAction", _unit getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler);
call EFUNC(interaction,hideMouseHint);
-
- [_this select 1] call CBA_fnc_removePerFrameHandler;
+
+ [_idPFH] call CBA_fnc_removePerFrameHandler;
};
-
+
_wireNoGeo setDir _dir;
{
_wireNoGeo animate [_x, _anim];
- } foreach WIRE_FAST;
+ } count WIRE_FAST;
}, 0, [_wireNoGeo, _wireNoGeoPos, _unit]] call CBA_fnc_addPerFrameHandler;
[localize "STR_ACE_ROLLWIRE", "", ""] call EFUNC(interaction,showMouseHint);
-
+
GVAR(placer) setVariable [QGVAR(Deploy),
[GVAR(placer), "DefaultAction",
{GVAR(deployPFH) != -1},
diff --git a/addons/concertina_wire/functions/fnc_dismount.sqf b/addons/concertina_wire/functions/fnc_dismount.sqf
index c9a5d1f9ff..c7ba3f50b1 100644
--- a/addons/concertina_wire/functions/fnc_dismount.sqf
+++ b/addons/concertina_wire/functions/fnc_dismount.sqf
@@ -8,10 +8,9 @@
* 1: unit
*
* Return Value:
- * Nothing
- *
- * Return value:
* None
+ *
+ * Public: No
*/
#include "script_component.hpp"
@@ -21,8 +20,7 @@ if (uiNamespace getVariable [QEGVAR(interact_menu,cursorMenuOpened),false]) exit
_this call FUNC(dismount);
}, _this] call EFUNC(common,execNextFrame);
};
-
-PARAMS_2(_wire,_unit);
+params ["_wire", "_unit"];
private ["_config", "_delay"];
_config = (configFile >> "CfgVehicles" >> typeOf _unit);
diff --git a/addons/concertina_wire/functions/fnc_dismountSuccess.sqf b/addons/concertina_wire/functions/fnc_dismountSuccess.sqf
index a6e34fe44f..a3f5081271 100644
--- a/addons/concertina_wire/functions/fnc_dismountSuccess.sqf
+++ b/addons/concertina_wire/functions/fnc_dismountSuccess.sqf
@@ -7,10 +7,9 @@
* 0: wire
*
* Return Value:
- * Nothing
- *
- * Return value:
* None
+ *
+ * Public: No
*/
#include "script_component.hpp"
@@ -18,25 +17,26 @@ PARAMS_1(_wire);
{
_wire animate [_x, 1];
-} foreach WIRE_FAST;
+} count WIRE_FAST;
[{
- EXPLODE_1_PVT(_this select 0,_wire);
-
+ params ["_args", "_idPFH"];
+ _args params ["_wire"];
+
if (_wire animationPhase "wire_2" == 1) then {
private ["_dir", "_pos", "_wirecoil"];
-
+
_dir = getDir _wire;
_pos = getPosASL _wire;
-
+
_wirecoil = "ACE_ConcertinaWireCoil" createvehicle [0, 0, 0];
deleteVehicle _wire;
-
+
_wirecoil setDir _dir;
_wirecoil setPosASL _pos;
_wirecoil setVelocity [0, 0, 0];
-
- [_this select 1] call CBA_fnc_removePerFrameHandler;
+
+ [_idPFH] call CBA_fnc_removePerFrameHandler;
};
}, 0, [_wire]] call CBA_fnc_addPerFrameHandler;
diff --git a/addons/concertina_wire/functions/fnc_handleDamage.sqf b/addons/concertina_wire/functions/fnc_handleDamage.sqf
index 61cd1c4e7c..43a04641dd 100644
--- a/addons/concertina_wire/functions/fnc_handleDamage.sqf
+++ b/addons/concertina_wire/functions/fnc_handleDamage.sqf
@@ -11,15 +11,12 @@
* 4: projectile
*
* Return Value:
- * Nothing
- *
- * Return value:
* None
+ *
+ * Public: No
*/
#include "script_component.hpp"
-
-PARAMS_5(_wire,_selectionName,_damage,_source,_projectile);
-
+params ["_wire", "", "_damage", "_source", ""];
if (_damage < 0.5) exitWith { 0 };
if (!(isNull _source)) then {
diff --git a/addons/concertina_wire/functions/fnc_handleKilled.sqf b/addons/concertina_wire/functions/fnc_handleKilled.sqf
index f5f84a6afa..ac59798d10 100644
--- a/addons/concertina_wire/functions/fnc_handleKilled.sqf
+++ b/addons/concertina_wire/functions/fnc_handleKilled.sqf
@@ -8,14 +8,12 @@
* 1: killer (vehicle)
*
* Return Value:
- * Nothing
- *
- * Return value:
* None
+ *
+ * Public: No
*/
#include "script_component.hpp"
-
-PARAMS_2(_wire,_killer);
+params ["_wire", "_killer"];
private ["_distance", "_vehicle"];
diff --git a/addons/concertina_wire/functions/fnc_vehicleDamage.sqf b/addons/concertina_wire/functions/fnc_vehicleDamage.sqf
index e7dff30000..41050eb9b9 100644
--- a/addons/concertina_wire/functions/fnc_vehicleDamage.sqf
+++ b/addons/concertina_wire/functions/fnc_vehicleDamage.sqf
@@ -7,14 +7,12 @@
* 1: vehicle
*
* Return Value:
- * Nothing
- *
- * Return value:
* None
+ *
+ * Public: No
*/
#include "script_component.hpp"
-
-PARAMS_2(_wire,_vehicle);
+params ["_wire", "_vehicle"];
private ["_type", "_mode", "_anim", "_parts", "_selectionPart", "_selection", "_pos_w", "_dir_w"];
@@ -43,8 +41,8 @@ _dir_w = getDir _wire;
if (_mode == 0) then {
private ["_x", "_y", "_found", "_wireCheckPosAr", "_no"];
- _x = _pos_w select 0;
- _y = _pos_w select 1;
+ _pos_w params ["_x","_y"];
+
// Check if two Single coils are placed next to each other (i.e playes have built a big wire obstacle)
_wireCheckPosAr = [
[_x + (sin (_dir_w+90) * 1.5),_y + (cos (_dir_w+90) * 1.5)],
From a38cdda8e36da5737946f11f4b474e74e2498d98 Mon Sep 17 00:00:00 2001
From: Michael Braun
Date: Sat, 8 Aug 2015 08:26:15 +0200
Subject: [PATCH 02/54] First iteration on implementing Dslyecxi's ST Map
Gestures
---
addons/map_gestures/$PBOPREFIX$ | 1 +
addons/map_gestures/ACE_Settings.hpp | 50 ++++++++++
addons/map_gestures/CfgEventHandlers.hpp | 11 +++
addons/map_gestures/CfgVehicles.hpp | 64 +++++++++++++
addons/map_gestures/XEH_postInit.sqf | 16 ++++
addons/map_gestures/XEH_preInit.sqf | 17 ++++
addons/map_gestures/config.cpp | 17 ++++
.../functions/fnc_assignClientIDOnServer.sqf | 24 +++++
.../functions/fnc_drawMapGestures.sqf | 48 ++++++++++
.../functions/fnc_endTransmit.sqf | 21 ++++
.../functions/fnc_getProximityPlayers.sqf | 23 +++++
.../functions/fnc_initTransmit.sqf | 21 ++++
.../functions/fnc_moduleGroupSettings.sqf | 53 +++++++++++
.../functions/fnc_moduleSettings.sqf | 35 +++++++
.../functions/fnc_receiverInit.sqf | 32 +++++++
.../functions/fnc_sanitizeName.sqf | 30 ++++++
.../map_gestures/functions/fnc_transmit.sqf | 42 ++++++++
.../functions/fnc_transmitterInit.sqf | 59 ++++++++++++
.../functions/script_component.hpp | 1 +
addons/map_gestures/script_component.hpp | 12 +++
addons/map_gestures/stringtable.xml | 95 +++++++++++++++++++
21 files changed, 672 insertions(+)
create mode 100644 addons/map_gestures/$PBOPREFIX$
create mode 100644 addons/map_gestures/ACE_Settings.hpp
create mode 100644 addons/map_gestures/CfgEventHandlers.hpp
create mode 100644 addons/map_gestures/CfgVehicles.hpp
create mode 100644 addons/map_gestures/XEH_postInit.sqf
create mode 100644 addons/map_gestures/XEH_preInit.sqf
create mode 100644 addons/map_gestures/config.cpp
create mode 100644 addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf
create mode 100644 addons/map_gestures/functions/fnc_drawMapGestures.sqf
create mode 100644 addons/map_gestures/functions/fnc_endTransmit.sqf
create mode 100644 addons/map_gestures/functions/fnc_getProximityPlayers.sqf
create mode 100644 addons/map_gestures/functions/fnc_initTransmit.sqf
create mode 100644 addons/map_gestures/functions/fnc_moduleGroupSettings.sqf
create mode 100644 addons/map_gestures/functions/fnc_moduleSettings.sqf
create mode 100644 addons/map_gestures/functions/fnc_receiverInit.sqf
create mode 100644 addons/map_gestures/functions/fnc_sanitizeName.sqf
create mode 100644 addons/map_gestures/functions/fnc_transmit.sqf
create mode 100644 addons/map_gestures/functions/fnc_transmitterInit.sqf
create mode 100644 addons/map_gestures/functions/script_component.hpp
create mode 100644 addons/map_gestures/script_component.hpp
create mode 100644 addons/map_gestures/stringtable.xml
diff --git a/addons/map_gestures/$PBOPREFIX$ b/addons/map_gestures/$PBOPREFIX$
new file mode 100644
index 0000000000..8672ea58f4
--- /dev/null
+++ b/addons/map_gestures/$PBOPREFIX$
@@ -0,0 +1 @@
+z\ace\addons\map_gestures
diff --git a/addons/map_gestures/ACE_Settings.hpp b/addons/map_gestures/ACE_Settings.hpp
new file mode 100644
index 0000000000..c7b9a8b2ed
--- /dev/null
+++ b/addons/map_gestures/ACE_Settings.hpp
@@ -0,0 +1,50 @@
+class ACE_Settings {
+ class GVAR(enabled) {
+ value = 1;
+ typeName = "BOOL";
+ displayName = CSTRING(enabled_displayName);
+ description = CSTRING(enabled_description);
+ };
+ class GVAR(maxRange) {
+ value = 7;
+ typeName = "SCALAR";
+ displayName = CSTRING(maxRange_displayName);
+ description = CSTRING(maxRange_description);
+ };
+ class GVAR(interval) {
+ value = 0.03;
+ typeName = "SCALAR";
+ displayName = CSTRING(interval_displayName);
+ description = CSTRING(interval_description);
+ };
+ class GVAR(defaultLeadColor) {
+ value[] = {1, 0.88, 0, 0.95};
+ typeName = "COLOR";
+ displayName = CSTRING(defaultLeadColor_displayName);
+ description = CSTRING(defaultLeadColor_description);
+ };
+ class GVAR(defaultColor) {
+ value[] = {1, 0.88, 0, 0.7};
+ typeName = "COLOR";
+ displayName = CSTRING(defaultColor_displayName);
+ description = CSTRING(defaultColor_description);
+ };
+ class GVAR(GroupColorConfigurations) {
+ value[] = {};
+ typeName = "ARRAY";
+ displayName = CSTRING(GroupColorConfigurations_displayName);
+ description = CSTRING(GroupColorConfigurations_description);
+ };
+ class GVAR(GroupColorConfigurationsGroups) {
+ value[] = {};
+ typeName = "ARRAY";
+ displayName = CSTRING(GroupColorConfigurationsGroups_displayName);
+ description = CSTRING(GroupColorConfigurationsGroups_description);
+ };
+ class GVAR(GroupColorConfigurationsGroupIndex) {
+ value[] = {};
+ typeName = "ARRAY";
+ displayName = CSTRING(GroupColorConfigurationsGroupIndex_displayName);
+ description = CSTRING(GroupColorConfigurationsGroupIndex_description);
+ };
+};
diff --git a/addons/map_gestures/CfgEventHandlers.hpp b/addons/map_gestures/CfgEventHandlers.hpp
new file mode 100644
index 0000000000..e75956f440
--- /dev/null
+++ b/addons/map_gestures/CfgEventHandlers.hpp
@@ -0,0 +1,11 @@
+class Extended_PreInit_EventHandlers {
+ class ADDON {
+ init = QUOTE(call COMPILE_FILE(XEH_preInit));
+ };
+};
+
+class Extended_PostInit_EventHandlers {
+ class ADDON {
+ init = QUOTE(call COMPILE_FILE(XEH_postInit));
+ };
+};
diff --git a/addons/map_gestures/CfgVehicles.hpp b/addons/map_gestures/CfgVehicles.hpp
new file mode 100644
index 0000000000..30204629a8
--- /dev/null
+++ b/addons/map_gestures/CfgVehicles.hpp
@@ -0,0 +1,64 @@
+class CfgVehicles {
+ class ACE_Module;
+ class GVAR(moduleSettings): ACE_Module {
+ scope = 2;
+ category = "ACE";
+ displayName = CSTRING(moduleSettings_displayName);
+ function = QFUNC(moduleSettings);
+ isGlobal = 0;
+ author = ECSTRING(common,ACETeam);
+ class Arguments {
+ class enabled {
+ displayName = CSTRING(enabled_DisplayName);
+ typeName = "BOOL";
+ defaultValue = 1;
+ };
+ class maxRange {
+ displayName = CSTRING(maxRange_displayName);
+ description = CSTRING(maxRange_description);
+ typeName = "NUMBER";
+ defaultValue = 4;
+ };
+ class interval {
+ displayName = CSTRING(interval_displayName);
+ description = CSTRING(interval_description);
+ typeName = "NUMBER";
+ defaultValue = 0.03;
+ };
+ class defaultLeadColor {
+ displayName = CSTRING(defaultLeadColor_displayName);
+ description = CSTRING(defaultLeadColor_description);
+ typeName = "STRING";
+ defaultValue = "0,0,0,0";
+ };
+ class defaultColor {
+ displayName = CSTRING(defaultColor_displayName);
+ description = CSTRING(defaultColor_description);
+ typeName = "STRING";
+ defaultValue = "0,0,0,0";
+ };
+ };
+ };
+ class GVAR(moduleGroupSettings): ACE_Module {
+ scope = 2;
+ category = "ACE";
+ displayName = CSTRING(moduleGroupSettings_displayName);
+ function = QFUNC(moduleGroupSettings);
+ isGlobal = 0;
+ author = ECSTRING(common,ACETeam);
+ class Arguments {
+ class leadColor {
+ displayName = CSTRING(leadColor_displayName);
+ description = CSTRING(leadColor_description);
+ typeName = "STRING";
+ defaultValue = "0,0,0,0";
+ };
+ class color {
+ displayName = CSTRING(color_displayName);
+ description = CSTRING(color_description);
+ typeName = "STRING";
+ defaultValue = "0,0,0,0";
+ };
+ };
+ };
+};
diff --git a/addons/map_gestures/XEH_postInit.sqf b/addons/map_gestures/XEH_postInit.sqf
new file mode 100644
index 0000000000..777463e86a
--- /dev/null
+++ b/addons/map_gestures/XEH_postInit.sqf
@@ -0,0 +1,16 @@
+#include "script_component.hpp"
+
+if (!hasInterface) exitWith {};
+
+["SettingsInitialized", {
+ [{
+ if (isNull (findDisplay 12)) exitWith {};
+
+ params ["", "_pfhId"];
+
+ call FUNC(receiverInit);
+ call FUNC(transmitterInit);
+
+ [_pfhId] call CBA_fnc_removePerFrameHandler;
+ }, 1, []] call CBA_fnc_addPerFrameHandler;
+}] call EFUNC(common,addEventHandler);
diff --git a/addons/map_gestures/XEH_preInit.sqf b/addons/map_gestures/XEH_preInit.sqf
new file mode 100644
index 0000000000..08159aa972
--- /dev/null
+++ b/addons/map_gestures/XEH_preInit.sqf
@@ -0,0 +1,17 @@
+#include "script_component.hpp"
+
+ADDON = false;
+
+PREP(assignClientIDOnServer);
+PREP(drawMapGestures);
+PREP(endTransmit);
+PREP(getProximityPlayers);
+PREP(initTransmit);
+PREP(moduleGroupSettings);
+PREP(moduleSettings);
+PREP(receiverInit);
+PREP(sanitizeName);
+PREP(transmit);
+PREP(transmitterInit);
+
+ADDON = true;
diff --git a/addons/map_gestures/config.cpp b/addons/map_gestures/config.cpp
new file mode 100644
index 0000000000..72e7f82078
--- /dev/null
+++ b/addons/map_gestures/config.cpp
@@ -0,0 +1,17 @@
+#include "script_component.hpp"
+
+class CfgPatches {
+ class ADDON {
+ units[] = {};
+ weapons[] = {};
+ requiredVersion = REQUIRED_VERSION;
+ requiredAddons[] = {"ace_common"};
+ author[] = {"Dslyecxi", "MikeMatrix"};
+ authorUrl = "https://github.com/MikeMatrix";
+ VERSION_CONFIG;
+ };
+};
+
+#include "ACE_Settings.hpp"
+#include "CfgEventHandlers.hpp"
+#include "CfgVehicles.hpp"
diff --git a/addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf b/addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf
new file mode 100644
index 0000000000..129c5066e1
--- /dev/null
+++ b/addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf
@@ -0,0 +1,24 @@
+/*
+ * Author: MikeMatrix
+ * Assign readable client ID to unit on the server.
+ *
+ * Arguments:
+ * 0: Unit name
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * ["MikeMatrix"] call ace_map_gestures_fnc_assignClientIDOnServer
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+params ["_unitName"];
+
+{
+ if (name _x == _unitName) then {
+ _x setVariable [QGVAR(owner_id), owner _x, true];
+ };
+} count playableUnits;
diff --git a/addons/map_gestures/functions/fnc_drawMapGestures.sqf b/addons/map_gestures/functions/fnc_drawMapGestures.sqf
new file mode 100644
index 0000000000..0b352418af
--- /dev/null
+++ b/addons/map_gestures/functions/fnc_drawMapGestures.sqf
@@ -0,0 +1,48 @@
+/*
+ * Author: MikeMatrix
+ * Receives and draws map gestures from nearby players.
+ *
+ * Arguments:
+ * 0: Map Handle
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * [findDisplay 12 displayCtrl 51] call ace_map_gesutres_fnc_drawMapGestures
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+if (!GVAR(enabled)) exitWith {};
+if (!visibleMap) exitWith {};
+
+params ["_mapHandle"];
+
+_nearDudes = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers);
+{
+ _nameSane = [name _x] call FUNC(sanitizeName);
+ _drawPosVariableName = format [QGVAR(%1_DrawPos), _nameSane];
+ if (!isNil _drawPosVariableName) then {
+ _pos = call compile _drawPosVariableName;
+ if (alive _x &&
+ (_pos distance [0, 0, 0]) > 50 &&
+ {_x getVariable QGVAR(Transmit)}) then {
+ _group = group _x;
+ _grpName = groupID _group;
+
+ _color = [1, 1, 1, 1];
+ if (_grpName in GVAR(GroupColorConfigurationsGroups)) then {
+ _grpNameIndex = GVAR(GroupColorConfigurationsGroups) find _grpName;
+ _color = (GVAR(GroupColorConfigurations) select (GVAR(GroupColorConfigurationsGroupIndex) select _grpNameIndex)) select (_x != leader _group);
+ } else {
+ _color = if (_x == leader _group) then {GVAR(defaultLeadColor)} else {GVAR(defaultColor)};
+ };
+
+ _mapHandle drawIcon ["\a3\ui_f\data\gui\cfg\Hints\icon_text\group_1_ca.paa", _color, _pos, 55, 55, 0, "", 1, 0.030, "PuristaBold", "left"];
+ _mapHandle drawIcon ["#(argb,8,8,3)color(0,0,0,0)", [.2,.2,.2,.3], _pos, 20, 20, 0, name _x, 0, 0.030, "PuristaBold", "left"];
+ };
+ };
+ nil
+} count _nearDudes;
diff --git a/addons/map_gestures/functions/fnc_endTransmit.sqf b/addons/map_gestures/functions/fnc_endTransmit.sqf
new file mode 100644
index 0000000000..0db082aa65
--- /dev/null
+++ b/addons/map_gestures/functions/fnc_endTransmit.sqf
@@ -0,0 +1,21 @@
+/*
+ * Author: MikeMatrix
+ * Ensure that all variables used to indicate transmission are disabled.
+ *
+ * Arguments:
+ * None
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * [] call ace_map_gestures_fnc_endTransmit
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+if (!GVAR(enabled)) exitWith {};
+
+ACE_player setVariable [QGVAR(Transmit), false, true];
+GVAR(EnableTransmit) = false;
diff --git a/addons/map_gestures/functions/fnc_getProximityPlayers.sqf b/addons/map_gestures/functions/fnc_getProximityPlayers.sqf
new file mode 100644
index 0000000000..eb1b609778
--- /dev/null
+++ b/addons/map_gestures/functions/fnc_getProximityPlayers.sqf
@@ -0,0 +1,23 @@
+/*
+ * Author: MikeMatrix
+ * Returns all players in a given range and in the units vehicle.
+ *
+ * Arguments:
+ * 0: Unit
+ * 1: Range
+ *
+ * Return Value:
+ * All units in proximity
+ *
+ * Example:
+ * ["example value"] call ace_module_fnc_functionName
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+params ["_unit", "_range"];
+
+_proximityPlayers = (getPos _unit) nearEntities [["CAMAnBase"], _range];
+_proximityPlayers = _proximityPlayers - [_unit];
+(_proximityPlayers + (crew vehicle _unit))
diff --git a/addons/map_gestures/functions/fnc_initTransmit.sqf b/addons/map_gestures/functions/fnc_initTransmit.sqf
new file mode 100644
index 0000000000..546e5d3c3b
--- /dev/null
+++ b/addons/map_gestures/functions/fnc_initTransmit.sqf
@@ -0,0 +1,21 @@
+/*
+ * Author: MikeMatrix
+ * Initializes transmitting map gestures.
+ *
+ * Arguments:
+ * None
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * [] call ace_map_gestures_fnc_initTransmit
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+if (!GVAR(enabled)) exitWith {};
+
+GVAR(EnableTransmit) = true;
+[FUNC(transmit), GVAR(interval), []] call CBA_fnc_addPerFrameHandler;
diff --git a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf
new file mode 100644
index 0000000000..b51f4b99b4
--- /dev/null
+++ b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf
@@ -0,0 +1,53 @@
+/*
+ * Author: MikeMatrix
+ * Initializes Settings for the groups modules and transcodes settings to a useable format.
+ *
+ * Arguments:
+ * 0: Logic
+ * 1: Units
+ * 2: Activated
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * [module, [player], true] call ace_map_gestures_fnc_moduleGroupSettings
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+params ["_logic", "_units", "_activated"];
+
+if (!_activated) exitWith {};
+if (!isServer) exitWith {};
+
+_leadColor = call compile ("[" + (_logic getVariable ["leadColor", ""]) + "]");
+if (isNil "_leadColor" || !((typeName _leadColor) isEqualTo "ARRAY") || {count _leadColor != 4}) exitWith {};
+_color = call compile ("[" + (_logic getVariable ["color", ""]) + "]");
+if (isNil "_color" || !((typeName _color) isEqualTo "ARRAY") || {count _color != 4}) exitWith {};
+
+_configurations = +GVAR(GroupColorConfigurations);
+if (isNil "_configurations") then {_configurations = []};
+_configurationIndex = _configurations pushBack [_leadColor, _color];
+
+_configurationGroups = +GVAR(GroupColorConfigurationsGroups);
+_configurationGroupsIndex = +GVAR(GroupColorConfigurationsGroupIndex);
+
+if (isNil "_configurationGroups") then {_configurationGroups = [];};
+if (isNil "_configurationGroupsIndex") then {_configurationGroupsIndex = [];};
+_completedGroups = [];
+{
+ private "_group";
+ _group = groupID (group _x);
+ if (!(_group in _completedGroups)) then {
+ _index = if (_group in _configurationGroups) then {_configurationGroups find _group} else {_configurationGroups pushBack _group};
+ _configurationGroupsIndex set [_index, _configurationIndex];
+ _completedGroups pushBack _group;
+ };
+ nil
+} count _units;
+
+[QGVAR(GroupColorConfigurations), _configurations, true, true] call EFUNC(common,setSetting);
+[QGVAR(GroupColorConfigurationsGroups), _configurationGroups, true, true] call EFUNC(common,setSetting);
+[QGVAR(GroupColorConfigurationsGroupIndex), _configurationGroupsIndex, true, true] call EFUNC(common,setSetting);
diff --git a/addons/map_gestures/functions/fnc_moduleSettings.sqf b/addons/map_gestures/functions/fnc_moduleSettings.sqf
new file mode 100644
index 0000000000..d53e118b46
--- /dev/null
+++ b/addons/map_gestures/functions/fnc_moduleSettings.sqf
@@ -0,0 +1,35 @@
+/*
+ * Author: MikeMatrix
+ * Initializes Settings for the module and transcodes settings to a useable format.
+ *
+ * Arguments:
+ * 0: Logic
+ * 1: Units
+ * 2: Activated
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * [module, [player], true] call ace_map_gestures_fnc_moduleGroupSettings
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+params ["_logic", "_units", "_activated"];
+
+if (!_activated) exitWith {};
+if (!isServer) exitWith {};
+
+[_logic, QGVAR(enabled), "enabled"] call EFUNC(common,readSettingFromModule);
+[_logic, QGVAR(maxRange), "maxRange"] call EFUNC(common,readSettingFromModule);
+[_logic, QGVAR(interval), "interval"] call EFUNC(common,readSettingFromModule);
+
+_defaultLeadColor = call compile ("[" + (_logic getVariable ["defaultLeadColor", ""]) + "]");
+if (isNil "_leadColor" || !((typeName _leadColor) isEqualTo "ARRAY") || {count _leadColor != 4}) exitWith {};
+[QGVAR(defaultLeadColor), _defaultLeadColor, true, true] call EFUNC(common,setSetting);
+
+_defaultColor = call compile ("[" + (_logic getVariable ["defaultColor", ""]) + "]");
+if (isNil "_color" || !((typeName _color) isEqualTo "ARRAY") || {count _color != 4}) exitWith {};
+[QGVAR(defaultColor), _defaultColor, true, true] call EFUNC(common,setSetting);
diff --git a/addons/map_gestures/functions/fnc_receiverInit.sqf b/addons/map_gestures/functions/fnc_receiverInit.sqf
new file mode 100644
index 0000000000..44b5bada47
--- /dev/null
+++ b/addons/map_gestures/functions/fnc_receiverInit.sqf
@@ -0,0 +1,32 @@
+/*
+ * Author: MikeMatrix
+ * Initializes the receiver and hooks it to the Draw event of the map.
+ *
+ * Arguments:
+ * None
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * [] call ace_map_gestures_fnc_receiverInit
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+{
+ if (isPlayer _x) then {
+ _nameSane = [name _x] call FUNC(sanitizeName);
+ call compile format [QUOTE(GVAR(%1_DrawPos) = [ARR_3(1,1,1)];), _nameSane];
+ };
+ nil
+} count allUnits;
+
+ACE_player setVariable [QGVAR(Transmit), false, true];
+GVAR(EnableTransmit) = false;
+
+if (!isNil QGVAR(DrawMapHandlerID)) then {
+ (findDisplay 12 displayCtrl 51) ctrlRemoveEventHandler ["Draw", GVAR(DrawMapHandlerID)]; GVAR(DrawMapHandlerID) = nil;
+};
+GVAR(DrawMapHandlerID) = findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", FUNC(drawMapGestures)];
diff --git a/addons/map_gestures/functions/fnc_sanitizeName.sqf b/addons/map_gestures/functions/fnc_sanitizeName.sqf
new file mode 100644
index 0000000000..bafe9d3052
--- /dev/null
+++ b/addons/map_gestures/functions/fnc_sanitizeName.sqf
@@ -0,0 +1,30 @@
+/*
+ * Author: MikeMatrix
+ * Cleans up unit names to be usable within variable names.
+ *
+ * Arguments:
+ * 0: Name
+ *
+ * Return Value:
+ * Sanitized name
+ *
+ * Example:
+ * ["I am a non valid variable name"] call ace_map_gestures_fnc_sanitizeName
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+private ["_alphabet", "_nameSanitized"];
+
+params ["_name"];
+
+_alphabet = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];
+
+_nameSanitized = [];
+{
+ if (toString [_x] in _alphabet) then {_nameSanitized pushBack _x};
+ nil
+} count (toArray _name);
+
+toString _nameSanitized
diff --git a/addons/map_gestures/functions/fnc_transmit.sqf b/addons/map_gestures/functions/fnc_transmit.sqf
new file mode 100644
index 0000000000..9defec2fd8
--- /dev/null
+++ b/addons/map_gestures/functions/fnc_transmit.sqf
@@ -0,0 +1,42 @@
+/*
+ * Author: MikeMatrix
+ * Transmit PFH
+ *
+ * Arguments:
+ * 0: Arguments
+ * 1: PFH ID
+ *
+ * Return Value:
+ * Return description
+ *
+ * Example:
+ * [[], 2] call ace_map_gestures_fnc_transmit
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+private ["_nearDudes", "_ownerID", "_nameSane"];
+
+params ["", "_pfhId"];
+
+if (!GVAR(EnableTransmit) || !visibleMap) exitWith {
+ call FUNC(endTransmit);
+ [_pfhId] call CBA_fnc_removePerFrameHandler;
+};
+
+_nearDudes = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers);
+TRACE_1("Near",_nearDudes)
+
+{
+ _ownerID = _x getVariable QGVAR(owner_id);
+ if (isNil _ownerID) exitWith {
+ [0, {[_this] call FUNC(assignClientIDOnServer)}, name _x] call cba_fnc_GlobalExecute;
+ };
+ _ownerID = _x getVariable QGVAR(owner_id);
+
+ if (_ownerID != ACE_player getVariable QGVAR(owner_id)) then {
+ _nameSane = [name ACE_player] call FUNC(sanitizeName);
+ _ownerID publicVariableClient format [QGVAR(%1_DrawPos), _nameSane];
+ };
+} count _nearDudes;
diff --git a/addons/map_gestures/functions/fnc_transmitterInit.sqf b/addons/map_gestures/functions/fnc_transmitterInit.sqf
new file mode 100644
index 0000000000..3c0cfa7c10
--- /dev/null
+++ b/addons/map_gestures/functions/fnc_transmitterInit.sqf
@@ -0,0 +1,59 @@
+/*
+ * Author: MikeMatrix
+ * Initializes the transmitting event handlers.
+ *
+ * Arguments:
+ * None
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * [] call ace_map_gestures_fnc_transmitterInit
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+private ["_mapCtrl", "_nameSane"];
+
+disableSerialization;
+
+_mapCtrl = findDisplay 12 displayCtrl 51;
+
+// MouseMoving EH.
+if (!isNil QGVAR(MouseMoveHandlerID)) then {_mapCtrl ctrlRemoveEventHandler ["MouseMoving", GVAR(MouseMoveHandlerID)]; GVAR(MouseMoveHandlerID) = nil;};
+GVAR(MouseMoveHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseMoving", {
+ if (EGVAR(maptools,drawing_isDrawing)) exitWith {};
+ if (EGVAR(maptools,mapTool_isDragging)) exitWith {};
+ if (EGVAR(maptools,mapTool_isRotating)) exitWith {};
+
+ params ["_control", "_posX", "_posY"];
+
+ if (GVAR(EnableTransmit)) then {
+ if (!(ACE_player getVariable QGVAR(Transmit))) then {
+ ACE_player setVariable [QGVAR(Transmit), true, true];
+ };
+
+ _nameSane = [name ACE_player] call FUNC(sanitizeName);
+ call compile format [QUOTE(GVAR(%1_DrawPos) = %2), _nameSane, _control ctrlMapScreenToWorld [_posX, _posY]];
+ };
+}];
+
+// MouseDown EH
+if (!isNil QGVAR(MouseDownHandlerID)) then {_mapCtrl ctrlRemoveEventHandler ["MouseButtonDown",GVAR(MouseDownHandlerID)]; GVAR(MouseDownHandlerID) = nil;};
+GVAR(MouseDownHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseButtonDown", {
+ if (!GVAR(enabled)) exitWith {};
+
+ params ["", "_button"];
+
+ if (_button == 0) then {call FUNC(initTransmit);};
+}];
+
+// MouseUp EH
+if (!isNil QGVAR(MouseUpHandlerID)) then {_mapCtrl ctrlRemoveEventHandler ["MouseButtonUp", GVAR(MouseUpHandlerID)]; GVAR(MouseUpHandlerID) = nil;};
+GVAR(MouseUpHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseButtonUp", {
+ params ["", "_button"];
+
+ if (_button == 0) then {call FUNC(endTransmit);};
+}];
diff --git a/addons/map_gestures/functions/script_component.hpp b/addons/map_gestures/functions/script_component.hpp
new file mode 100644
index 0000000000..65841c15f9
--- /dev/null
+++ b/addons/map_gestures/functions/script_component.hpp
@@ -0,0 +1 @@
+#include "\z\ace\addons\map_gestures\script_component.hpp"
diff --git a/addons/map_gestures/script_component.hpp b/addons/map_gestures/script_component.hpp
new file mode 100644
index 0000000000..7c6f3a5b2f
--- /dev/null
+++ b/addons/map_gestures/script_component.hpp
@@ -0,0 +1,12 @@
+#define COMPONENT map_gestures
+#include "\z\ace\addons\main\script_mod.hpp"
+
+#ifdef DEBUG_ENABLED_MAP_GESTURES
+ #define DEBUG_MODE_FULL
+#endif
+
+#ifdef DEBUG_SETTINGS_MAP_GESTURES
+ #define DEBUG_SETTINGS DEBUG_SETTINGS_MAP_GESTURES
+#endif
+
+#include "\z\ace\addons\main\script_macros.hpp"
diff --git a/addons/map_gestures/stringtable.xml b/addons/map_gestures/stringtable.xml
new file mode 100644
index 0000000000..324e9f92e7
--- /dev/null
+++ b/addons/map_gestures/stringtable.xml
@@ -0,0 +1,95 @@
+
+
+
+
+ Map Gestures
+
+
+ Enabled
+
+
+ Map Gesture Max Range
+
+
+ Max range between players to show the map gesture indicator [default: 7 meters]
+
+
+ Lead Default Alpha
+
+
+ Fallback Alpha value for group leaders.
+
+
+ Default Alpha
+
+
+ Fallback Alpha value.
+
+
+ Lead Default Color
+
+
+ Fallback Color value for group leaders.
+
+
+ Default Color
+
+
+ Fallback Color value.
+
+
+ Lead Alpha
+
+
+ Alpha value for group leaders of groups synced with this module.
+
+
+ Alpha
+
+
+ Alpha value for group members of groups synced with this module.
+
+
+ Lead Color
+
+
+ Color value for group leaders of groups synced with this module.
+
+
+ Color
+
+
+ Color value for group members of groups synced with this module.
+
+
+ Map Gestures - Group Settings
+
+
+ Update Interval
+
+
+ Time between data updates.
+
+
+ Group color configurations
+
+
+ Group color configuration containing arrays of color pairs ([leadColor, color]).
+
+
+ Group color group name index, containing names of groups with configurations attached to them.
+
+
+ Group color group name index
+
+
+ Group color group name mapping index
+
+
+ Group color group name mapping index, mapping the GroupColorConfigurationsGroups to the GroupColorConfigurations.
+
+
+ Enables the Map Gestures.
+
+
+
From 90e4d005ee663e8976a5ffed1b02c1c11934851c Mon Sep 17 00:00:00 2001
From: Michael Braun
Date: Mon, 10 Aug 2015 08:45:43 +0200
Subject: [PATCH 03/54] Give credit where credit is due
---
AUTHORS.txt | 5 +++--
addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf | 2 +-
addons/map_gestures/functions/fnc_drawMapGestures.sqf | 2 +-
addons/map_gestures/functions/fnc_endTransmit.sqf | 2 +-
addons/map_gestures/functions/fnc_getProximityPlayers.sqf | 2 +-
addons/map_gestures/functions/fnc_initTransmit.sqf | 2 +-
addons/map_gestures/functions/fnc_moduleGroupSettings.sqf | 2 +-
addons/map_gestures/functions/fnc_moduleSettings.sqf | 2 +-
addons/map_gestures/functions/fnc_receiverInit.sqf | 2 +-
addons/map_gestures/functions/fnc_sanitizeName.sqf | 2 +-
addons/map_gestures/functions/fnc_transmit.sqf | 2 +-
addons/map_gestures/functions/fnc_transmitterInit.sqf | 2 +-
12 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/AUTHORS.txt b/AUTHORS.txt
index 62329d7c1d..711ed6f687 100644
--- a/AUTHORS.txt
+++ b/AUTHORS.txt
@@ -50,6 +50,8 @@ Coren
Crusty
Dharma Bellamkonda
Dimaslg
+Drill
+Dslyecxi
eRazeri
evromalarkey
F3 Project
@@ -81,6 +83,7 @@ Macusercom
MarcBook
meat
Michail Nikolaev
+MikeMatrix
nic547
nikolauska
nomisum
@@ -106,5 +109,3 @@ Valentin Torikian
VyMajoris(W-Cephei)
Winter
zGuba
-Drill
-MikeMatrix
diff --git a/addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf b/addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf
index 129c5066e1..c686c17b79 100644
--- a/addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf
+++ b/addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf
@@ -1,5 +1,5 @@
/*
- * Author: MikeMatrix
+ * Author: Dslyecxi, MikeMatrix
* Assign readable client ID to unit on the server.
*
* Arguments:
diff --git a/addons/map_gestures/functions/fnc_drawMapGestures.sqf b/addons/map_gestures/functions/fnc_drawMapGestures.sqf
index 0b352418af..b270e3d073 100644
--- a/addons/map_gestures/functions/fnc_drawMapGestures.sqf
+++ b/addons/map_gestures/functions/fnc_drawMapGestures.sqf
@@ -1,5 +1,5 @@
/*
- * Author: MikeMatrix
+ * Author: Dslyecxi, MikeMatrix
* Receives and draws map gestures from nearby players.
*
* Arguments:
diff --git a/addons/map_gestures/functions/fnc_endTransmit.sqf b/addons/map_gestures/functions/fnc_endTransmit.sqf
index 0db082aa65..fc3e0e81e1 100644
--- a/addons/map_gestures/functions/fnc_endTransmit.sqf
+++ b/addons/map_gestures/functions/fnc_endTransmit.sqf
@@ -1,5 +1,5 @@
/*
- * Author: MikeMatrix
+ * Author: Dslyecxi, MikeMatrix
* Ensure that all variables used to indicate transmission are disabled.
*
* Arguments:
diff --git a/addons/map_gestures/functions/fnc_getProximityPlayers.sqf b/addons/map_gestures/functions/fnc_getProximityPlayers.sqf
index eb1b609778..3ac8803a70 100644
--- a/addons/map_gestures/functions/fnc_getProximityPlayers.sqf
+++ b/addons/map_gestures/functions/fnc_getProximityPlayers.sqf
@@ -1,5 +1,5 @@
/*
- * Author: MikeMatrix
+ * Author: Dslyecxi, MikeMatrix
* Returns all players in a given range and in the units vehicle.
*
* Arguments:
diff --git a/addons/map_gestures/functions/fnc_initTransmit.sqf b/addons/map_gestures/functions/fnc_initTransmit.sqf
index 546e5d3c3b..604bf9e233 100644
--- a/addons/map_gestures/functions/fnc_initTransmit.sqf
+++ b/addons/map_gestures/functions/fnc_initTransmit.sqf
@@ -1,5 +1,5 @@
/*
- * Author: MikeMatrix
+ * Author: Dslyecxi, MikeMatrix
* Initializes transmitting map gestures.
*
* Arguments:
diff --git a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf
index b51f4b99b4..569bdd687a 100644
--- a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf
+++ b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf
@@ -1,5 +1,5 @@
/*
- * Author: MikeMatrix
+ * Author: Dslyecxi, MikeMatrix
* Initializes Settings for the groups modules and transcodes settings to a useable format.
*
* Arguments:
diff --git a/addons/map_gestures/functions/fnc_moduleSettings.sqf b/addons/map_gestures/functions/fnc_moduleSettings.sqf
index d53e118b46..00cfc7288c 100644
--- a/addons/map_gestures/functions/fnc_moduleSettings.sqf
+++ b/addons/map_gestures/functions/fnc_moduleSettings.sqf
@@ -1,5 +1,5 @@
/*
- * Author: MikeMatrix
+ * Author: Dslyecxi, MikeMatrix
* Initializes Settings for the module and transcodes settings to a useable format.
*
* Arguments:
diff --git a/addons/map_gestures/functions/fnc_receiverInit.sqf b/addons/map_gestures/functions/fnc_receiverInit.sqf
index 44b5bada47..8dfc7de51c 100644
--- a/addons/map_gestures/functions/fnc_receiverInit.sqf
+++ b/addons/map_gestures/functions/fnc_receiverInit.sqf
@@ -1,5 +1,5 @@
/*
- * Author: MikeMatrix
+ * Author: Dslyecxi, MikeMatrix
* Initializes the receiver and hooks it to the Draw event of the map.
*
* Arguments:
diff --git a/addons/map_gestures/functions/fnc_sanitizeName.sqf b/addons/map_gestures/functions/fnc_sanitizeName.sqf
index bafe9d3052..f36e626102 100644
--- a/addons/map_gestures/functions/fnc_sanitizeName.sqf
+++ b/addons/map_gestures/functions/fnc_sanitizeName.sqf
@@ -1,5 +1,5 @@
/*
- * Author: MikeMatrix
+ * Author: Dslyecxi, MikeMatrix
* Cleans up unit names to be usable within variable names.
*
* Arguments:
diff --git a/addons/map_gestures/functions/fnc_transmit.sqf b/addons/map_gestures/functions/fnc_transmit.sqf
index 9defec2fd8..880b21f36e 100644
--- a/addons/map_gestures/functions/fnc_transmit.sqf
+++ b/addons/map_gestures/functions/fnc_transmit.sqf
@@ -1,5 +1,5 @@
/*
- * Author: MikeMatrix
+ * Author: Dslyecxi, MikeMatrix
* Transmit PFH
*
* Arguments:
diff --git a/addons/map_gestures/functions/fnc_transmitterInit.sqf b/addons/map_gestures/functions/fnc_transmitterInit.sqf
index 3c0cfa7c10..6ba6d0881e 100644
--- a/addons/map_gestures/functions/fnc_transmitterInit.sqf
+++ b/addons/map_gestures/functions/fnc_transmitterInit.sqf
@@ -1,5 +1,5 @@
/*
- * Author: MikeMatrix
+ * Author: Dslyecxi, MikeMatrix
* Initializes the transmitting event handlers.
*
* Arguments:
From b1d3654a97324644b6ac40b2c53a4359a7e1ad21 Mon Sep 17 00:00:00 2001
From: Michael Braun
Date: Mon, 10 Aug 2015 14:54:28 +0200
Subject: [PATCH 04/54] Fixed owner id not getting assigned in map gestures
---
addons/map_gestures/functions/fnc_transmit.sqf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/addons/map_gestures/functions/fnc_transmit.sqf b/addons/map_gestures/functions/fnc_transmit.sqf
index 880b21f36e..a87be445bf 100644
--- a/addons/map_gestures/functions/fnc_transmit.sqf
+++ b/addons/map_gestures/functions/fnc_transmit.sqf
@@ -30,7 +30,7 @@ TRACE_1("Near",_nearDudes)
{
_ownerID = _x getVariable QGVAR(owner_id);
- if (isNil _ownerID) exitWith {
+ if (isNil "_ownerID") exitWith {
[0, {[_this] call FUNC(assignClientIDOnServer)}, name _x] call cba_fnc_GlobalExecute;
};
_ownerID = _x getVariable QGVAR(owner_id);
From 5788705821442e4cee027664ddac05dad415647b Mon Sep 17 00:00:00 2001
From: Michael Braun
Date: Mon, 10 Aug 2015 15:24:57 +0200
Subject: [PATCH 05/54] Fixed code style issues and added missing variable
initialization in map_gestures
---
.../map_gestures/functions/fnc_drawMapGestures.sqf | 13 ++++++-------
.../functions/fnc_moduleGroupSettings.sqf | 7 +------
addons/map_gestures/functions/fnc_receiverInit.sqf | 4 ++--
addons/map_gestures/functions/fnc_transmit.sqf | 8 ++++----
4 files changed, 13 insertions(+), 19 deletions(-)
diff --git a/addons/map_gestures/functions/fnc_drawMapGestures.sqf b/addons/map_gestures/functions/fnc_drawMapGestures.sqf
index b270e3d073..05afa9bf0e 100644
--- a/addons/map_gestures/functions/fnc_drawMapGestures.sqf
+++ b/addons/map_gestures/functions/fnc_drawMapGestures.sqf
@@ -20,24 +20,23 @@ if (!visibleMap) exitWith {};
params ["_mapHandle"];
-_nearDudes = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers);
+_proximityPlayers = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers);
{
_nameSane = [name _x] call FUNC(sanitizeName);
_drawPosVariableName = format [QGVAR(%1_DrawPos), _nameSane];
if (!isNil _drawPosVariableName) then {
+ if (isNil {call compile _drawPosVariableName}) then {call compile format [QUOTE(GVAR(%1_DrawPos) = [ARR_3(1,1,1)];), _nameSane];}
_pos = call compile _drawPosVariableName;
if (alive _x &&
- (_pos distance [0, 0, 0]) > 50 &&
{_x getVariable QGVAR(Transmit)}) then {
_group = group _x;
_grpName = groupID _group;
- _color = [1, 1, 1, 1];
- if (_grpName in GVAR(GroupColorConfigurationsGroups)) then {
+ _color = if (_grpName in GVAR(GroupColorConfigurationsGroups)) then {
_grpNameIndex = GVAR(GroupColorConfigurationsGroups) find _grpName;
- _color = (GVAR(GroupColorConfigurations) select (GVAR(GroupColorConfigurationsGroupIndex) select _grpNameIndex)) select (_x != leader _group);
+ (GVAR(GroupColorConfigurations) select (GVAR(GroupColorConfigurationsGroupIndex) select _grpNameIndex)) select (_x != leader _group)
} else {
- _color = if (_x == leader _group) then {GVAR(defaultLeadColor)} else {GVAR(defaultColor)};
+ if (_x == leader _group) then {GVAR(defaultLeadColor)} else {GVAR(defaultColor)};
};
_mapHandle drawIcon ["\a3\ui_f\data\gui\cfg\Hints\icon_text\group_1_ca.paa", _color, _pos, 55, 55, 0, "", 1, 0.030, "PuristaBold", "left"];
@@ -45,4 +44,4 @@ _nearDudes = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers);
};
};
nil
-} count _nearDudes;
+} count _proximityPlayers;
diff --git a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf
index 569bdd687a..c0158d90c7 100644
--- a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf
+++ b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf
@@ -27,12 +27,7 @@ if (isNil "_leadColor" || !((typeName _leadColor) isEqualTo "ARRAY") || {count _
_color = call compile ("[" + (_logic getVariable ["color", ""]) + "]");
if (isNil "_color" || !((typeName _color) isEqualTo "ARRAY") || {count _color != 4}) exitWith {};
-_configurations = +GVAR(GroupColorConfigurations);
-if (isNil "_configurations") then {_configurations = []};
-_configurationIndex = _configurations pushBack [_leadColor, _color];
-
-_configurationGroups = +GVAR(GroupColorConfigurationsGroups);
-_configurationGroupsIndex = +GVAR(GroupColorConfigurationsGroupIndex);
+_configurationGroups = if (isNil QGVAR(GroupColorConfigurationsGroups) then { [] } else { +GVAR(GroupColorConfigurationsGroups) };
if (isNil "_configurationGroups") then {_configurationGroups = [];};
if (isNil "_configurationGroupsIndex") then {_configurationGroupsIndex = [];};
diff --git a/addons/map_gestures/functions/fnc_receiverInit.sqf b/addons/map_gestures/functions/fnc_receiverInit.sqf
index 8dfc7de51c..482572c19e 100644
--- a/addons/map_gestures/functions/fnc_receiverInit.sqf
+++ b/addons/map_gestures/functions/fnc_receiverInit.sqf
@@ -17,8 +17,8 @@
{
if (isPlayer _x) then {
- _nameSane = [name _x] call FUNC(sanitizeName);
- call compile format [QUOTE(GVAR(%1_DrawPos) = [ARR_3(1,1,1)];), _nameSane];
+ _nameSane = [name _x] call FUNC(sanitizeName);
+ call compile format [QUOTE(GVAR(%1_DrawPos) = [ARR_3(1,1,1)];), _nameSane];
};
nil
} count allUnits;
diff --git a/addons/map_gestures/functions/fnc_transmit.sqf b/addons/map_gestures/functions/fnc_transmit.sqf
index a87be445bf..a0ab7bf0bf 100644
--- a/addons/map_gestures/functions/fnc_transmit.sqf
+++ b/addons/map_gestures/functions/fnc_transmit.sqf
@@ -16,7 +16,7 @@
*/
#include "script_component.hpp"
-private ["_nearDudes", "_ownerID", "_nameSane"];
+private ["_proximityPlayers", "_ownerID", "_nameSane"];
params ["", "_pfhId"];
@@ -25,8 +25,8 @@ if (!GVAR(EnableTransmit) || !visibleMap) exitWith {
[_pfhId] call CBA_fnc_removePerFrameHandler;
};
-_nearDudes = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers);
-TRACE_1("Near",_nearDudes)
+_proximityPlayers = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers);
+TRACE_1("Near",_proximityPlayers)
{
_ownerID = _x getVariable QGVAR(owner_id);
@@ -39,4 +39,4 @@ TRACE_1("Near",_nearDudes)
_nameSane = [name ACE_player] call FUNC(sanitizeName);
_ownerID publicVariableClient format [QGVAR(%1_DrawPos), _nameSane];
};
-} count _nearDudes;
+} count _proximityPlayers;
From 5e4316d0e214150facde679f52c24149169bef4c Mon Sep 17 00:00:00 2001
From: Michael Braun
Date: Mon, 10 Aug 2015 16:43:33 +0200
Subject: [PATCH 06/54] Fixed missing semi-colon
---
addons/map_gestures/functions/fnc_drawMapGestures.sqf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/addons/map_gestures/functions/fnc_drawMapGestures.sqf b/addons/map_gestures/functions/fnc_drawMapGestures.sqf
index 05afa9bf0e..877b503b38 100644
--- a/addons/map_gestures/functions/fnc_drawMapGestures.sqf
+++ b/addons/map_gestures/functions/fnc_drawMapGestures.sqf
@@ -25,7 +25,7 @@ _proximityPlayers = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers);
_nameSane = [name _x] call FUNC(sanitizeName);
_drawPosVariableName = format [QGVAR(%1_DrawPos), _nameSane];
if (!isNil _drawPosVariableName) then {
- if (isNil {call compile _drawPosVariableName}) then {call compile format [QUOTE(GVAR(%1_DrawPos) = [ARR_3(1,1,1)];), _nameSane];}
+ if (isNil {call compile _drawPosVariableName}) then {call compile format [QUOTE(GVAR(%1_DrawPos) = [ARR_3(1,1,1)];), _nameSane];};
_pos = call compile _drawPosVariableName;
if (alive _x &&
{_x getVariable QGVAR(Transmit)}) then {
From 5287455c0b5860fa9bdb67502347326273510629 Mon Sep 17 00:00:00 2001
From: Michael Braun
Date: Mon, 10 Aug 2015 17:07:01 +0200
Subject: [PATCH 07/54] Fixed aborting data transmission on no owner id
encounter
---
addons/map_gestures/functions/fnc_transmit.sqf | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/addons/map_gestures/functions/fnc_transmit.sqf b/addons/map_gestures/functions/fnc_transmit.sqf
index a0ab7bf0bf..4d99caa160 100644
--- a/addons/map_gestures/functions/fnc_transmit.sqf
+++ b/addons/map_gestures/functions/fnc_transmit.sqf
@@ -30,13 +30,12 @@ TRACE_1("Near",_proximityPlayers)
{
_ownerID = _x getVariable QGVAR(owner_id);
- if (isNil "_ownerID") exitWith {
+ if (isNil "_ownerID") then {
[0, {[_this] call FUNC(assignClientIDOnServer)}, name _x] call cba_fnc_GlobalExecute;
- };
- _ownerID = _x getVariable QGVAR(owner_id);
-
- if (_ownerID != ACE_player getVariable QGVAR(owner_id)) then {
- _nameSane = [name ACE_player] call FUNC(sanitizeName);
- _ownerID publicVariableClient format [QGVAR(%1_DrawPos), _nameSane];
+ } else {
+ if (_ownerID != ACE_player getVariable QGVAR(owner_id)) then {
+ _nameSane = [name ACE_player] call FUNC(sanitizeName);
+ _ownerID publicVariableClient format [QGVAR(%1_DrawPos), _nameSane];
+ };
};
} count _proximityPlayers;
From 3e82391a369894f10e6cfa1dad24959ae6f7ae1b Mon Sep 17 00:00:00 2001
From: Michael Braun
Date: Mon, 10 Aug 2015 19:04:49 +0200
Subject: [PATCH 08/54] Added validation and various fixes
---
addons/map_gestures/XEH_preInit.sqf | 1 +
.../functions/fnc_isValidColorArray.sqf | 28 +++++++++++++++++++
.../functions/fnc_moduleGroupSettings.sqf | 13 +++++----
.../functions/fnc_moduleSettings.sqf | 7 +++--
4 files changed, 41 insertions(+), 8 deletions(-)
create mode 100644 addons/map_gestures/functions/fnc_isValidColorArray.sqf
diff --git a/addons/map_gestures/XEH_preInit.sqf b/addons/map_gestures/XEH_preInit.sqf
index 08159aa972..ad4da44998 100644
--- a/addons/map_gestures/XEH_preInit.sqf
+++ b/addons/map_gestures/XEH_preInit.sqf
@@ -7,6 +7,7 @@ PREP(drawMapGestures);
PREP(endTransmit);
PREP(getProximityPlayers);
PREP(initTransmit);
+PREP(isValidColorArray);
PREP(moduleGroupSettings);
PREP(moduleSettings);
PREP(receiverInit);
diff --git a/addons/map_gestures/functions/fnc_isValidColorArray.sqf b/addons/map_gestures/functions/fnc_isValidColorArray.sqf
new file mode 100644
index 0000000000..a64cf249eb
--- /dev/null
+++ b/addons/map_gestures/functions/fnc_isValidColorArray.sqf
@@ -0,0 +1,28 @@
+/*
+ * Author: MikeMatrix
+ * Validate if an array is in the propper color format.
+ *
+ * Arguments:
+ * 0: Color Array
+ *
+ * Return Value:
+ * Is valid Color Array
+ *
+ * Example:
+ * [[1, 0.2, 1, 0.5]] call ace_map_gestures_fnc_isValidColorArray
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+params ["_colorArray"];
+
+if (isNil "_colorArray") exitWith {false};
+if ((typeName _colorArray) != "ARRAY") exitWith {false};
+if (count _colorArray != 4) exitWith {false};
+
+{
+ if ((typeName _x) != "SCALAR" || _x < 0 || _x > 1) exitWith {false};
+} count _colorArray;
+
+true
diff --git a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf
index c0158d90c7..32f7e73143 100644
--- a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf
+++ b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf
@@ -19,19 +19,22 @@
params ["_logic", "_units", "_activated"];
+diag_log "Running";
+
if (!_activated) exitWith {};
if (!isServer) exitWith {};
_leadColor = call compile ("[" + (_logic getVariable ["leadColor", ""]) + "]");
-if (isNil "_leadColor" || !((typeName _leadColor) isEqualTo "ARRAY") || {count _leadColor != 4}) exitWith {};
+if (!([_leadColor] call FUNC(isValidColorArray))) exitWith {ERROR("leadColor is not a valid color array.")};
_color = call compile ("[" + (_logic getVariable ["color", ""]) + "]");
-if (isNil "_color" || !((typeName _color) isEqualTo "ARRAY") || {count _color != 4}) exitWith {};
+if (!([_color] call FUNC(isValidColorArray))) exitWith {ERROR("color is not a valid color array.")};
-_configurationGroups = if (isNil QGVAR(GroupColorConfigurationsGroups) then { [] } else { +GVAR(GroupColorConfigurationsGroups) };
+_configurations = if (isNil QGVAR(GroupColorConfigurations)) then { [] } else { +GVAR(GroupColorConfigurations) };
+_configurationGroups = if (isNil QGVAR(GroupColorConfigurationsGroups)) then { [] } else { +GVAR(GroupColorConfigurationsGroups) };
+_configurationGroupsIndex = if (isNil QGVAR(GroupColorConfigurationsGroupIndex)) then { [] } else { +GVAR(GroupColorConfigurationsGroupIndex) };
-if (isNil "_configurationGroups") then {_configurationGroups = [];};
-if (isNil "_configurationGroupsIndex") then {_configurationGroupsIndex = [];};
_completedGroups = [];
+_configurationIndex = _configurations pushBack [_leadColor, _color];
{
private "_group";
_group = groupID (group _x);
diff --git a/addons/map_gestures/functions/fnc_moduleSettings.sqf b/addons/map_gestures/functions/fnc_moduleSettings.sqf
index 00cfc7288c..6b21db8588 100644
--- a/addons/map_gestures/functions/fnc_moduleSettings.sqf
+++ b/addons/map_gestures/functions/fnc_moduleSettings.sqf
@@ -27,9 +27,10 @@ if (!isServer) exitWith {};
[_logic, QGVAR(interval), "interval"] call EFUNC(common,readSettingFromModule);
_defaultLeadColor = call compile ("[" + (_logic getVariable ["defaultLeadColor", ""]) + "]");
-if (isNil "_leadColor" || !((typeName _leadColor) isEqualTo "ARRAY") || {count _leadColor != 4}) exitWith {};
-[QGVAR(defaultLeadColor), _defaultLeadColor, true, true] call EFUNC(common,setSetting);
+if (!([_defaultLeadColor] call FUNC(isValidColorArray))) exitWith {ERROR("defaultLeadColor is not a valid color array.")};
_defaultColor = call compile ("[" + (_logic getVariable ["defaultColor", ""]) + "]");
-if (isNil "_color" || !((typeName _color) isEqualTo "ARRAY") || {count _color != 4}) exitWith {};
+if (!([_defaultColor] call FUNC(isValidColorArray))) exitWith {ERROR("defaultColor is not a valid color array.")};
+
+[QGVAR(defaultLeadColor), _defaultLeadColor, true, true] call EFUNC(common,setSetting);
[QGVAR(defaultColor), _defaultColor, true, true] call EFUNC(common,setSetting);
From a315596c5a83d461aa9da5bbd85876c72ea8fbf1 Mon Sep 17 00:00:00 2001
From: Michael Braun
Date: Mon, 10 Aug 2015 20:32:26 +0200
Subject: [PATCH 09/54] Fixed isValidColorArray returning true when array had
the right size, but wrong datatypes/value ranges
---
addons/map_gestures/functions/fnc_isValidColorArray.sqf | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/addons/map_gestures/functions/fnc_isValidColorArray.sqf b/addons/map_gestures/functions/fnc_isValidColorArray.sqf
index a64cf249eb..809bbaf117 100644
--- a/addons/map_gestures/functions/fnc_isValidColorArray.sqf
+++ b/addons/map_gestures/functions/fnc_isValidColorArray.sqf
@@ -15,6 +15,8 @@
*/
#include "script_component.hpp"
+scopeName "main";
+
params ["_colorArray"];
if (isNil "_colorArray") exitWith {false};
@@ -22,7 +24,7 @@ if ((typeName _colorArray) != "ARRAY") exitWith {false};
if (count _colorArray != 4) exitWith {false};
{
- if ((typeName _x) != "SCALAR" || _x < 0 || _x > 1) exitWith {false};
+ if ((typeName _x) != "SCALAR" || _x < 0 || _x > 1) exitWith {false breakOut "main"};
} count _colorArray;
true
From 183aac191117d762983d251346d7854693696ee7 Mon Sep 17 00:00:00 2001
From: jokoho48
Date: Fri, 14 Aug 2015 01:55:54 +0200
Subject: [PATCH 10/54] Code cleanup of Kestrel 4500 module.
---
addons/kestrel4500/XEH_preInit.sqf | 18 ++++
.../functions/fnc_buttonPressed.sqf | 4 +-
addons/kestrel4500/functions/fnc_canShow.sqf | 6 +-
.../kestrel4500/functions/fnc_collectData.sqf | 33 +++-----
.../functions/fnc_createKestrelDialog.sqf | 4 +-
.../functions/fnc_displayKestrel.sqf | 84 +++++++++++--------
.../functions/fnc_generateOutputData.sqf | 40 +++++----
.../functions/fnc_measureWindSpeed.sqf | 3 +-
.../functions/fnc_onCloseDialog.sqf | 15 ++++
.../functions/fnc_onCloseDisplay.sqf | 15 ++++
.../functions/fnc_restoreUserData.sqf | 2 +-
.../functions/fnc_storeUserData.sqf | 4 +-
.../functions/fnc_updateDisplay.sqf | 30 ++-----
.../functions/fnc_updateImpellerState.sqf | 4 +-
14 files changed, 150 insertions(+), 112 deletions(-)
diff --git a/addons/kestrel4500/XEH_preInit.sqf b/addons/kestrel4500/XEH_preInit.sqf
index 7b36167a16..b7d66cbb94 100644
--- a/addons/kestrel4500/XEH_preInit.sqf
+++ b/addons/kestrel4500/XEH_preInit.sqf
@@ -17,3 +17,21 @@ PREP(updateDisplay);
PREP(updateImpellerState);
ADDON = true;
+
+FUNC(updateMemory) = {
+ params ["_slot", "_value"];
+ GVAR(MIN) set [_slot, (GVAR(MIN) select _slot) min _value];
+ GVAR(MAX) set [_slot, _value max (GVAR(MAX) select _slot)];
+ GVAR(TOTAL) set [_slot, (GVAR(TOTAL) select _slot) + _value];
+};
+
+FUNC(dayOfWeek) = {
+ private "_table";
+ params ["_year", "_month", "_day"];
+
+ _table = [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4];
+ if (_month < 3) then {
+ _year = _year - 1;
+ };
+ (_year + floor(_year/4) - floor(_year/100) + floor(_year/400) + (_table select (_month - 1)) + _day) % 7
+};
diff --git a/addons/kestrel4500/functions/fnc_buttonPressed.sqf b/addons/kestrel4500/functions/fnc_buttonPressed.sqf
index 8f38568462..83c471092a 100644
--- a/addons/kestrel4500/functions/fnc_buttonPressed.sqf
+++ b/addons/kestrel4500/functions/fnc_buttonPressed.sqf
@@ -3,10 +3,10 @@
* Handles the Kestrel 4500 dialog button actions
*
* Arguments:
- * buttonID
+ * button ID
*
* Return Value:
- * Nothing
+ * None
*
* Example:
* 2 call ace_kestrel4500_fnc_buttonPressed
diff --git a/addons/kestrel4500/functions/fnc_canShow.sqf b/addons/kestrel4500/functions/fnc_canShow.sqf
index 0c9e29f9bc..f563138f5c 100644
--- a/addons/kestrel4500/functions/fnc_canShow.sqf
+++ b/addons/kestrel4500/functions/fnc_canShow.sqf
@@ -3,13 +3,13 @@
* Tests if the Kestrel 4500 can be shown
*
* Arguments:
- * Nothing
+ * None
*
* Return Value:
- * canShow (bool)
+ * canShow
*
* Example:
- * [mode] call ace_kestrel4500_fnc_canShow
+ * call ace_kestrel4500_fnc_canShow
*
* Public: No
*/
diff --git a/addons/kestrel4500/functions/fnc_collectData.sqf b/addons/kestrel4500/functions/fnc_collectData.sqf
index 244e719b37..2e25fbcf60 100644
--- a/addons/kestrel4500/functions/fnc_collectData.sqf
+++ b/addons/kestrel4500/functions/fnc_collectData.sqf
@@ -3,18 +3,19 @@
* Gathers the weather data for the Kestrel 4500
*
* Arguments:
- * Nothing
+ * None
*
* Return Value:
- * Nothing
+ * None
*
* Example:
+ * call ace_kestrel4500_fnc_collectData
*
* Public: No
*/
#include "script_component.hpp"
-private ["_playerDir", "_playerAltitude", "_temperature", "_humidity", "_barometricPressure", "_altitude", "_airDensity", "_densityAltitude", "_chill", "_heatIndex", "_dewPoint", "_wetBulb", "_fnc_updateMemory", "_windSpeed", "_crosswind", "_headwind"];
+private ["_playerDir", "_playerAltitude", "_temperature", "_humidity", "_barometricPressure", "_altitude", "_airDensity", "_densityAltitude", "_chill", "_heatIndex", "_dewPoint", "_wetBulb", "_windSpeed", "_crosswind", "_headwind"];
_playerDir = getDir ACE_player;
_playerAltitude = (getPosASL ACE_player) select 2;
_temperature = _playerAltitude call EFUNC(weather,calculateTemperatureAtHeight);
@@ -35,25 +36,19 @@ if (isNil QGVAR(MIN) || isNil QGVAR(MAX)) then {
{
GVAR(ENTRIES) set [_x, (GVAR(ENTRIES) select _x) + 1];
-} forEach [1, 5, 6, 7, 8, 9, 10, 11, 12, 13];
+} count [1, 5, 6, 7, 8, 9, 10, 11, 12, 13];
-_fnc_updateMemory = {
- PARAMS_2(_slot,_value);
- GVAR(MIN) set [_slot, (GVAR(MIN) select _slot) min _value];
- GVAR(MAX) set [_slot, _value max (GVAR(MAX) select _slot)];
- GVAR(TOTAL) set [_slot, (GVAR(TOTAL) select _slot) + _value];
-};
-[0, _playerDir] call _fnc_updateMemory;
+[0, _playerDir] call FUNC(updateMemory);
if (GVAR(MinAvgMaxMode) == 1) then {
{
GVAR(ENTRIES) set [_x, (GVAR(ENTRIES) select _x) + 1];
- } forEach [2, 3, 4];
+ } count [2, 3, 4];
// Wind SPD
_windSpeed = call FUNC(measureWindSpeed);
- [2, _windSpeed] call _fnc_updateMemory;
+ [2, _windSpeed] call FUNC(updateMemory);
// CROSSWIND
_crosswind = 0;
@@ -62,7 +57,7 @@ if (GVAR(MinAvgMaxMode) == 1) then {
} else {
_crosswind = abs(sin(GVAR(RefHeading)) * _windSpeed);
};
- [3, _crosswind] call _fnc_updateMemory;
+ [3, _crosswind] call FUNC(updateMemory);
// HEADWIND
_headwind = 0;
@@ -80,12 +75,4 @@ if (GVAR(MinAvgMaxMode) == 1) then {
GVAR(TOTAL) set [4, (GVAR(TOTAL) select 4) + _headwind];
};
-[5, _temperature] call _fnc_updateMemory;
-[6, _chill] call _fnc_updateMemory;
-[7, _humidity] call _fnc_updateMemory;
-[8, _heatIndex] call _fnc_updateMemory;
-[9, _dewPoint] call _fnc_updateMemory;
-[10, _wetBulb] call _fnc_updateMemory;
-[11, _barometricPressure] call _fnc_updateMemory;
-[12, _altitude] call _fnc_updateMemory;
-[13, _densityAltitude] call _fnc_updateMemory;
+{ _x call FUNC(updateMemory); true } count [[5, _temperature],[6, _chill],[7, _humidity],[8, _heatIndex],[9, _dewPoint],[10, _wetBulb],[11, _barometricPressure],[12, _altitude],[13, _densityAltitude]];
diff --git a/addons/kestrel4500/functions/fnc_createKestrelDialog.sqf b/addons/kestrel4500/functions/fnc_createKestrelDialog.sqf
index 289d0825fc..23ca70543b 100644
--- a/addons/kestrel4500/functions/fnc_createKestrelDialog.sqf
+++ b/addons/kestrel4500/functions/fnc_createKestrelDialog.sqf
@@ -3,7 +3,7 @@
* Opens the Kestrel 4500 dialog
*
* Arguments:
- * Nothing
+ * None
*
* Return Value:
* Nothing
@@ -29,7 +29,7 @@ createDialog 'Kestrel4500_Display';
GVAR(Kestrel4500) = false;
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
-
+
[] call FUNC(updateDisplay);
}, 1, _this select 0] call CBA_fnc_addPerFrameHandler;
diff --git a/addons/kestrel4500/functions/fnc_displayKestrel.sqf b/addons/kestrel4500/functions/fnc_displayKestrel.sqf
index 679ecce6af..63a162a7b0 100644
--- a/addons/kestrel4500/functions/fnc_displayKestrel.sqf
+++ b/addons/kestrel4500/functions/fnc_displayKestrel.sqf
@@ -3,12 +3,13 @@
* Shows the Kestrel 4500 as rsc title
*
* Arguments:
- * Nothing
+ * None
*
* Return Value:
* Nothing
*
* Example:
+ * call ace_kestrel4500_fnc_displayKestrell
*
* Public: No
*/
@@ -50,49 +51,66 @@ if (GVAR(Kestrel4500) && dialog) then {
GVAR(Overlay) = true;
-[{
+[{
// abort condition
if (!GVAR(Overlay) || {!(("ACE_Kestrel4500" in (uniformItems ACE_player)) || ("ACE_Kestrel4500" in (vestItems ACE_player)))}) exitWith {
GVAR(Overlay) = false;
3 cutText ["", "PLAIN"];
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
-
+
if (ACE_diagTime > GVAR(updateTimer)) then {
GVAR(updateTimer) = ACE_diagTime + 1;
-
+
private ["_outputData"];
_outputData = [] call FUNC(generateOutputData);
-
+
3 cutRsc ["RscKestrel4500", "PLAIN", 1, false];
-
- __ctrlTop ctrlSetText (_outputData select 0);
- __ctrlCenterBig ctrlSetText (_outputData select 1);
-
- __ctrlTop ctrlSetText (_outputData select 0);
- __ctrlCenterBig ctrlSetText (_outputData select 1);
- __ctrlCenter ctrlSetText (_outputData select 2);
-
- __ctrlCenterLine1Left ctrlSetText (_outputData select 3);
- __ctrlCenterLine2Left ctrlSetText (_outputData select 4);
- __ctrlCenterLine3Left ctrlSetText (_outputData select 5);
+ _outputData params [
+ "_ctrlTop",
+ "_ctrlCenterBig",
+ "_ctrlCenter",
+ "_ctrlCenterLine1Left",
+ "_ctrlCenterLine2Left",
+ "_ctrlCenterLine3Left",
+ "_ctrlCenterLine1Right",
+ "_ctrlCenterLine2Right",
+ "_ctrlCenterLine3Right",
+ "_ctrlInfoLine1",
+ "_ctrlInfoLine2",
+ "_ctrlBottomBig",
+ "_ctrlCenterLine1",
+ "_ctrlCenterLine2",
+ "_ctrlCenterLine3",
+ "_ctrlCenterLine4",
+ "_ctrlCenterLine5",
+ "_ctrlCenterLine6"
+ ];
- __ctrlCenterLine1Right ctrlSetText (_outputData select 6);
- __ctrlCenterLine2Right ctrlSetText (_outputData select 7);
- __ctrlCenterLine3Right ctrlSetText (_outputData select 8);
+ __ctrlTop ctrlSetText _ctrlTop;
+ __ctrlCenterBig ctrlSetText _ctrlCenterBig;
+ __ctrlCenter ctrlSetText _ctrlCenter;
+
+ __ctrlCenterLine1Left ctrlSetText _ctrlCenterLine1Left;
+ __ctrlCenterLine2Left ctrlSetText _ctrlCenterLine2Left;
+ __ctrlCenterLine3Left ctrlSetText _ctrlCenterLine3Left;
+
+ __ctrlCenterLine1Right ctrlSetText _ctrlCenterLine1Right;
+ __ctrlCenterLine2Right ctrlSetText _ctrlCenterLine2Right;
+ __ctrlCenterLine3Right ctrlSetText _ctrlCenterLine3Right;
+
+ __ctrlInfoLine1 ctrlSetText _ctrlInfoLine1;
+ __ctrlInfoLine2 ctrlSetText _ctrlInfoLine2;
+
+ __ctrlBottomBig ctrlSetText _ctrlBottomBig ;
+
+ __ctrlCenterLine1 ctrlSetText _ctrlCenterLine1;
+ __ctrlCenterLine2 ctrlSetText _ctrlCenterLine2;
+ __ctrlCenterLine3 ctrlSetText _ctrlCenterLine3;
+ __ctrlCenterLine4 ctrlSetText _ctrlCenterLine4;
+ __ctrlCenterLine5 ctrlSetText _ctrlCenterLine5;
+ __ctrlCenterLine6 ctrlSetText _ctrlCenterLine6;
- __ctrlInfoLine1 ctrlSetText (_outputData select 9);
- __ctrlInfoLine2 ctrlSetText (_outputData select 10);
-
- __ctrlBottomBig ctrlSetText (_outputData select 11);
-
- __ctrlCenterLine1 ctrlSetText (_outputData select 12);
- __ctrlCenterLine2 ctrlSetText (_outputData select 13);
- __ctrlCenterLine3 ctrlSetText (_outputData select 14);
- __ctrlCenterLine4 ctrlSetText (_outputData select 15);
- __ctrlCenterLine5 ctrlSetText (_outputData select 16);
- __ctrlCenterLine6 ctrlSetText (_outputData select 17);
-
if (GVAR(referenceHeadingMenu) == 1) then {
if (GVAR(referenceHeadingAutoSet)) then {
__ctrlCenterLine3 ctrlSetTextColor [0, 0, 0, 0.6];
@@ -106,10 +124,10 @@ GVAR(Overlay) = true;
__ctrlCenterLine4 ctrlSetTextColor [0, 0, 0, 1.0];
};
};
-
+
call FUNC(updateImpellerState);
__ctrlKestrel4500 ctrlSetText format [QUOTE(PATHTOF(UI\Kestrel4500_%1.paa)), floor(GVAR(ImpellerState) % 7)];
-
+
}, 0.01, []] call CBA_fnc_addPerFrameHandler;
true
diff --git a/addons/kestrel4500/functions/fnc_generateOutputData.sqf b/addons/kestrel4500/functions/fnc_generateOutputData.sqf
index d61a1f48e4..de62da31ff 100644
--- a/addons/kestrel4500/functions/fnc_generateOutputData.sqf
+++ b/addons/kestrel4500/functions/fnc_generateOutputData.sqf
@@ -3,12 +3,29 @@
* Generates the Kestrel 4500 output text.
*
* Arguments:
- * Nothing
+ * None
*
* Return Value:
- * [top , centerBig , CenterLine1Left , CenterLine2Left , CenterLine3Left , CenterLine1Right , CenterLine2Right , CenterLine3Right , InfoLine1 , InfoLine2 ]
+ * 0: top
+ * 1: centerBig
+ * 2: CenterLine1Left
+ * 3: CenterLine2Left
+ * 4: CenterLine3Left
+ * 5: CenterLine1Right
+ * 6: CenterLine2Right
+ * 7: CenterLine3Right
+ * 8: InfoLine1
+ * 9: InfoLine2
+ * 10: Bottom Big
+ * 11: Center Line 1
+ * 11: Center Line 2
+ * 12: Center Line 3
+ * 13: Center Line 4
+ * 14: Center Line 5
+ * 15: Center Line 6
*
* Example:
+ * _var = call ace_kestrell4500_fnc_generateOutputData
*
* Public: No
*/
@@ -16,7 +33,7 @@
if (ACE_diagTime - GVAR(headingSetDisplayTimer) < 0.8) exitWith {["", "", " Heading Set", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""]};
-private ["_playerDir", "_playerAltitude", "_temperature", "_humidity", "_barometricPressure", "_airDensity", "_densityAltitude", "_chill", "_heatIndex", "_dewPoint", "_wetBulb", "_fnc_dayOfWeek", "_dayString", "_monthString", "_windSpeed", "_windDir", "_textTop", "_textCenterBig", "_textCenter", "_textCenterLine1Left", "_textCenterLine2Left", "_textCenterLine3Left", "_textCenterLine1Right", "_textCenterLine2Right", "_textCenterLine3Right", "_textInfoLine1", "_textInfoLine2", "_textBottomBig", "_textCenterLine1", "_textCenterLine2", "_textCenterLine3", "_textCenterLine4", "_textCenterLine5", "_textCenterLine6"];
+private ["_playerDir", "_playerAltitude", "_temperature", "_humidity", "_barometricPressure", "_airDensity", "_densityAltitude", "_chill", "_heatIndex", "_dewPoint", "_wetBulb", "_dayString", "_monthString", "_windSpeed", "_windDir", "_textTop", "_textCenterBig", "_textCenter", "_textCenterLine1Left", "_textCenterLine2Left", "_textCenterLine3Left", "_textCenterLine1Right", "_textCenterLine2Right", "_textCenterLine3Right", "_textInfoLine1", "_textInfoLine2", "_textBottomBig", "_textCenterLine1", "_textCenterLine2", "_textCenterLine3", "_textCenterLine4", "_textCenterLine5", "_textCenterLine6"];
[] call FUNC(collectData);
@@ -59,19 +76,6 @@ _heatIndex = [_temperature, _humidity] call EFUNC(weather,calculateHeatIndex);
_dewPoint = [_temperature, _humidity] call EFUNC(weather,calculateDewPoint);
_wetBulb = [_temperature, _barometricPressure, _humidity] call EFUNC(weather,calculateWetBulb);
-_fnc_dayOfWeek = {
- private ["_year", "_month", "_day", "_table"];
- _year = _this select 0;
- _month = _this select 1;
- _day = _this select 2;
-
- _table = [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4];
- if (_month < 3) then {
- _year = _year - 1;
- };
- (_year + floor(_year/4) - floor(_year/100) + floor(_year/400) + (_table select (_month - 1)) + _day) % 7
-};
-
GVAR(Direction) = 4 * floor(_playerDir / 90);
if (_playerDir % 90 > 10) then { GVAR(Direction) = GVAR(Direction) + 1};
if (_playerDir % 90 > 35) then { GVAR(Direction) = GVAR(Direction) + 1};
@@ -82,8 +86,8 @@ GVAR(Direction) = GVAR(Direction) % 16;
if (GVAR(referenceHeadingMenu) == 0) then {
switch (GVAR(Menu)) do {
case 0: { // Date
- EXPLODE_3_PVT(date,_year,_month,_day);
- _dayString = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] select (date call _fnc_dayOfWeek);
+ date params ["_year", "_month", "_day"];
+ _dayString = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] select (date call FUNC(dayOfWeek));
_monthString = localize (["str_january","str_february","str_march","str_april","str_may","str_june","str_july","str_august","str_september","str_october","str_november","str_december"] select (_month - 1));
_textTop = _dayString;
_textCenter = format["%1 %2 %3", _day, _monthString, _year];
diff --git a/addons/kestrel4500/functions/fnc_measureWindSpeed.sqf b/addons/kestrel4500/functions/fnc_measureWindSpeed.sqf
index 73b4e228d6..2a8a4bbbb3 100644
--- a/addons/kestrel4500/functions/fnc_measureWindSpeed.sqf
+++ b/addons/kestrel4500/functions/fnc_measureWindSpeed.sqf
@@ -3,12 +3,13 @@
* Measures the wind speed, stores the information in GVAR(MeasuredWindSpeed) and updates GVAR(ImpellerState)
*
* Arguments:
- * Nothing
+ * None
*
* Return Value:
* wind speed
*
* Example:
+ * call ace_kestrel4500_fnc_canShow
*
* Public: No
*/
diff --git a/addons/kestrel4500/functions/fnc_onCloseDialog.sqf b/addons/kestrel4500/functions/fnc_onCloseDialog.sqf
index a45a9decc3..11fa76ff18 100644
--- a/addons/kestrel4500/functions/fnc_onCloseDialog.sqf
+++ b/addons/kestrel4500/functions/fnc_onCloseDialog.sqf
@@ -1,3 +1,18 @@
+/*
+ * Author: Ruthberg
+ * Called if Kestrell Dialog is closed
+ *
+ * Arguments:
+ * None
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * call ace_kestrel4500_fnc_onCloseDialog
+ *
+ * Public: No
+ */
#include "script_component.hpp"
uiNamespace setVariable ['Kestrel4500_Display', nil];
diff --git a/addons/kestrel4500/functions/fnc_onCloseDisplay.sqf b/addons/kestrel4500/functions/fnc_onCloseDisplay.sqf
index efb60b322a..9228aedcef 100644
--- a/addons/kestrel4500/functions/fnc_onCloseDisplay.sqf
+++ b/addons/kestrel4500/functions/fnc_onCloseDisplay.sqf
@@ -1,3 +1,18 @@
+/*
+ * Author: Ruthberg
+ * Called if Kestrell Display is closed
+ *
+ * Arguments:
+ * None
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * call ace_kestrel4500_fnc_onCloseDisplay
+ *
+ * Public: No
+ */
#include "script_component.hpp"
uiNamespace setVariable ['RscKestrel4500', nil];
diff --git a/addons/kestrel4500/functions/fnc_restoreUserData.sqf b/addons/kestrel4500/functions/fnc_restoreUserData.sqf
index 0ce463ad67..c1d9c0ebb3 100644
--- a/addons/kestrel4500/functions/fnc_restoreUserData.sqf
+++ b/addons/kestrel4500/functions/fnc_restoreUserData.sqf
@@ -6,7 +6,7 @@
* Nothing
*
* Return Value:
- * Nothing
+ * None
*
* Example:
* call ace_kestrel4500_fnc_restore_user_data
diff --git a/addons/kestrel4500/functions/fnc_storeUserData.sqf b/addons/kestrel4500/functions/fnc_storeUserData.sqf
index a5d069b31d..80fa219a3c 100644
--- a/addons/kestrel4500/functions/fnc_storeUserData.sqf
+++ b/addons/kestrel4500/functions/fnc_storeUserData.sqf
@@ -3,10 +3,10 @@
* Saves user data into profileNamespace
*
* Arguments:
- * Nothing
+ * None
*
* Return Value:
- * Nothing
+ * None
*
* Example:
* call ace_kestrel4500_fnc_store_user_data
diff --git a/addons/kestrel4500/functions/fnc_updateDisplay.sqf b/addons/kestrel4500/functions/fnc_updateDisplay.sqf
index 90f77f5f6a..e63b18bcfc 100644
--- a/addons/kestrel4500/functions/fnc_updateDisplay.sqf
+++ b/addons/kestrel4500/functions/fnc_updateDisplay.sqf
@@ -3,10 +3,10 @@
* Updates the Kestrel 4500 dialog text boxes.
*
* Arguments:
- * Nothing
+ * None
*
* Return Value:
- * Nothing
+ * None
*
* Example:
*
@@ -22,29 +22,9 @@ private ["_outputData"];
_outputData = [] call FUNC(generateOutputData);
-ctrlSetText [74100, _outputData select 0];
-ctrlSetText [74200, _outputData select 1];
-ctrlSetText [74201, _outputData select 2];
-
-ctrlSetText [74300, _outputData select 3];
-ctrlSetText [74301, _outputData select 4];
-ctrlSetText [74302, _outputData select 5];
-
-ctrlSetText [74303, _outputData select 6];
-ctrlSetText [74304, _outputData select 7];
-ctrlSetText [74305, _outputData select 8];
-
-ctrlSetText [74400, _outputData select 9];
-ctrlSetText [74401, _outputData select 10];
-
-ctrlSetText [74500, _outputData select 11];
-
-ctrlSetText [74600, _outputData select 12];
-ctrlSetText [74601, _outputData select 13];
-ctrlSetText [74602, _outputData select 14];
-ctrlSetText [74603, _outputData select 15];
-ctrlSetText [74604, _outputData select 16];
-ctrlSetText [74605, _outputData select 17];
+{
+ ctrlSetText [_x , _outputData select _foreachindex];
+} forEach [74100, 74200, 74201, 74300, 74301, 74302, 74303, 74304, 74305, 74400, 74401, 74500, 74600, 74601, 74602, 74603, 74604, 74605];
if (GVAR(referenceHeadingMenu) == 1) then {
if (GVAR(referenceHeadingAutoSet)) then {
diff --git a/addons/kestrel4500/functions/fnc_updateImpellerState.sqf b/addons/kestrel4500/functions/fnc_updateImpellerState.sqf
index 075ed80080..75a0d10f4c 100644
--- a/addons/kestrel4500/functions/fnc_updateImpellerState.sqf
+++ b/addons/kestrel4500/functions/fnc_updateImpellerState.sqf
@@ -3,10 +3,10 @@
* Updates the Kestrel 4500 Impeller state
*
* Arguments:
- * Nothing
+ * None
*
* Return Value:
- * Nothing
+ * None
*
* Example:
*
From 84685f4a84d22a130f5d583ef24eabe7a36f5055 Mon Sep 17 00:00:00 2001
From: jokoho48
Date: Fri, 14 Aug 2015 02:22:15 +0200
Subject: [PATCH 11/54] add dayOfWeek and updateMemory to Own File Update some
Comments Fixing Spelling Issue
---
addons/kestrel4500/XEH_preInit.sqf | 21 ++--------------
.../functions/fnc_createKestrelDialog.sqf | 3 ++-
.../kestrel4500/functions/fnc_dayOfWeek.sqf | 25 +++++++++++++++++++
.../functions/fnc_displayKestrel.sqf | 4 +--
.../functions/fnc_generateOutputData.sqf | 2 +-
.../functions/fnc_onCloseDialog.sqf | 2 +-
.../functions/fnc_onCloseDisplay.sqf | 2 +-
.../functions/fnc_updateMemory.sqf | 20 +++++++++++++++
.../functions/script_component.hpp | 2 +-
9 files changed, 55 insertions(+), 26 deletions(-)
create mode 100644 addons/kestrel4500/functions/fnc_dayOfWeek.sqf
create mode 100644 addons/kestrel4500/functions/fnc_updateMemory.sqf
diff --git a/addons/kestrel4500/XEH_preInit.sqf b/addons/kestrel4500/XEH_preInit.sqf
index b7d66cbb94..b89f07173f 100644
--- a/addons/kestrel4500/XEH_preInit.sqf
+++ b/addons/kestrel4500/XEH_preInit.sqf
@@ -15,23 +15,6 @@ PREP(restoreUserData);
PREP(storeUserData);
PREP(updateDisplay);
PREP(updateImpellerState);
-
+PREP(updateMemory);
+PREP(dayOfWeek)
ADDON = true;
-
-FUNC(updateMemory) = {
- params ["_slot", "_value"];
- GVAR(MIN) set [_slot, (GVAR(MIN) select _slot) min _value];
- GVAR(MAX) set [_slot, _value max (GVAR(MAX) select _slot)];
- GVAR(TOTAL) set [_slot, (GVAR(TOTAL) select _slot) + _value];
-};
-
-FUNC(dayOfWeek) = {
- private "_table";
- params ["_year", "_month", "_day"];
-
- _table = [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4];
- if (_month < 3) then {
- _year = _year - 1;
- };
- (_year + floor(_year/4) - floor(_year/100) + floor(_year/400) + (_table select (_month - 1)) + _day) % 7
-};
diff --git a/addons/kestrel4500/functions/fnc_createKestrelDialog.sqf b/addons/kestrel4500/functions/fnc_createKestrelDialog.sqf
index 23ca70543b..a11982968c 100644
--- a/addons/kestrel4500/functions/fnc_createKestrelDialog.sqf
+++ b/addons/kestrel4500/functions/fnc_createKestrelDialog.sqf
@@ -6,9 +6,10 @@
* None
*
* Return Value:
- * Nothing
+ * None
*
* Example:
+ * call ace_kestrel4500_fnc_createKestrelDialog
*
* Public: No
*/
diff --git a/addons/kestrel4500/functions/fnc_dayOfWeek.sqf b/addons/kestrel4500/functions/fnc_dayOfWeek.sqf
new file mode 100644
index 0000000000..9e142f661c
--- /dev/null
+++ b/addons/kestrel4500/functions/fnc_dayOfWeek.sqf
@@ -0,0 +1,25 @@
+/*
+ * Author: Ruthberg
+ * Calculate Current Day in the Week
+ *
+ * Arguments:
+ * 0: Year
+ * 1: Month
+ * 2: Day
+ *
+ * Return Value:
+ * Day of The Week
+ *
+ * Example:
+ * [1995, 10, 21] call ace_kestrel4500_fnc_buttonPressed
+ *
+ * Public: No
+ */
+private "_table";
+params ["_year", "_month", "_day"];
+
+_table = [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4];
+if (_month < 3) then {
+ _year = _year - 1;
+};
+(_year + floor(_year/4) - floor(_year/100) + floor(_year/400) + (_table select (_month - 1)) + _day) % 7
diff --git a/addons/kestrel4500/functions/fnc_displayKestrel.sqf b/addons/kestrel4500/functions/fnc_displayKestrel.sqf
index 63a162a7b0..770347ec71 100644
--- a/addons/kestrel4500/functions/fnc_displayKestrel.sqf
+++ b/addons/kestrel4500/functions/fnc_displayKestrel.sqf
@@ -6,10 +6,10 @@
* None
*
* Return Value:
- * Nothing
+ * None
*
* Example:
- * call ace_kestrel4500_fnc_displayKestrell
+ * call ace_kestrel4500_fnc_displayKestrel
*
* Public: No
*/
diff --git a/addons/kestrel4500/functions/fnc_generateOutputData.sqf b/addons/kestrel4500/functions/fnc_generateOutputData.sqf
index de62da31ff..016baebef7 100644
--- a/addons/kestrel4500/functions/fnc_generateOutputData.sqf
+++ b/addons/kestrel4500/functions/fnc_generateOutputData.sqf
@@ -25,7 +25,7 @@
* 15: Center Line 6
*
* Example:
- * _var = call ace_kestrell4500_fnc_generateOutputData
+ * _var = call ace_kestrel4500_fnc_generateOutputData
*
* Public: No
*/
diff --git a/addons/kestrel4500/functions/fnc_onCloseDialog.sqf b/addons/kestrel4500/functions/fnc_onCloseDialog.sqf
index 11fa76ff18..2474f30d94 100644
--- a/addons/kestrel4500/functions/fnc_onCloseDialog.sqf
+++ b/addons/kestrel4500/functions/fnc_onCloseDialog.sqf
@@ -1,6 +1,6 @@
/*
* Author: Ruthberg
- * Called if Kestrell Dialog is closed
+ * Called if Kestrel Dialog is closed
*
* Arguments:
* None
diff --git a/addons/kestrel4500/functions/fnc_onCloseDisplay.sqf b/addons/kestrel4500/functions/fnc_onCloseDisplay.sqf
index 9228aedcef..bdc701ddb1 100644
--- a/addons/kestrel4500/functions/fnc_onCloseDisplay.sqf
+++ b/addons/kestrel4500/functions/fnc_onCloseDisplay.sqf
@@ -1,6 +1,6 @@
/*
* Author: Ruthberg
- * Called if Kestrell Display is closed
+ * Called if Kestrel Display is closed
*
* Arguments:
* None
diff --git a/addons/kestrel4500/functions/fnc_updateMemory.sqf b/addons/kestrel4500/functions/fnc_updateMemory.sqf
new file mode 100644
index 0000000000..f38e9ee6df
--- /dev/null
+++ b/addons/kestrel4500/functions/fnc_updateMemory.sqf
@@ -0,0 +1,20 @@
+/*
+ * Author: Ruthberg
+ * Update Memory of Kestrel
+ *
+ * Arguments:
+ * 0: Slot
+ * 1: Value
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * [1, "test"] call ace_kestrel4500_fnc_updateMemory
+ *
+ * Public: No
+ */
+params ["_slot", "_value"];
+GVAR(MIN) set [_slot, (GVAR(MIN) select _slot) min _value];
+GVAR(MAX) set [_slot, _value max (GVAR(MAX) select _slot)];
+GVAR(TOTAL) set [_slot, (GVAR(TOTAL) select _slot) + _value];
diff --git a/addons/kestrel4500/functions/script_component.hpp b/addons/kestrel4500/functions/script_component.hpp
index 32c774cd89..bc42218de7 100644
--- a/addons/kestrel4500/functions/script_component.hpp
+++ b/addons/kestrel4500/functions/script_component.hpp
@@ -1 +1 @@
-#include "\z\ace\addons\kestrel4500\script_component.hpp"
\ No newline at end of file
+#include "\z\ace\addons\kestrel4500\script_component.hpp"
From c3c39150a303299f4f6cfdbccbb1130d2ce4f6f2 Mon Sep 17 00:00:00 2001
From: Michael Braun
Date: Sat, 15 Aug 2015 12:12:41 +0200
Subject: [PATCH 12/54] Improved handling of accessing dynamic variable names
---
addons/map_gestures/functions/fnc_drawMapGestures.sqf | 4 ++--
addons/map_gestures/functions/fnc_receiverInit.sqf | 2 +-
addons/map_gestures/functions/fnc_transmitterInit.sqf | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/addons/map_gestures/functions/fnc_drawMapGestures.sqf b/addons/map_gestures/functions/fnc_drawMapGestures.sqf
index 877b503b38..54efd878ce 100644
--- a/addons/map_gestures/functions/fnc_drawMapGestures.sqf
+++ b/addons/map_gestures/functions/fnc_drawMapGestures.sqf
@@ -25,8 +25,8 @@ _proximityPlayers = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers);
_nameSane = [name _x] call FUNC(sanitizeName);
_drawPosVariableName = format [QGVAR(%1_DrawPos), _nameSane];
if (!isNil _drawPosVariableName) then {
- if (isNil {call compile _drawPosVariableName}) then {call compile format [QUOTE(GVAR(%1_DrawPos) = [ARR_3(1,1,1)];), _nameSane];};
- _pos = call compile _drawPosVariableName;
+ if (isNil {missionNamespace getVariable _drawPosVariableName}) then {missionNamespace setVariable [_drawPosVariableName, [1, 1, 1]];};
+ _pos = missionNamespace getVariable _drawPosVariableName;
if (alive _x &&
{_x getVariable QGVAR(Transmit)}) then {
_group = group _x;
diff --git a/addons/map_gestures/functions/fnc_receiverInit.sqf b/addons/map_gestures/functions/fnc_receiverInit.sqf
index 482572c19e..719e5a727b 100644
--- a/addons/map_gestures/functions/fnc_receiverInit.sqf
+++ b/addons/map_gestures/functions/fnc_receiverInit.sqf
@@ -18,7 +18,7 @@
{
if (isPlayer _x) then {
_nameSane = [name _x] call FUNC(sanitizeName);
- call compile format [QUOTE(GVAR(%1_DrawPos) = [ARR_3(1,1,1)];), _nameSane];
+ missionNamespace setVariable [format [QGVAR(%1_DrawPos), _nameSane], [1, 1, 1]];
};
nil
} count allUnits;
diff --git a/addons/map_gestures/functions/fnc_transmitterInit.sqf b/addons/map_gestures/functions/fnc_transmitterInit.sqf
index 6ba6d0881e..828261e017 100644
--- a/addons/map_gestures/functions/fnc_transmitterInit.sqf
+++ b/addons/map_gestures/functions/fnc_transmitterInit.sqf
@@ -36,7 +36,7 @@ GVAR(MouseMoveHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseMoving", {
};
_nameSane = [name ACE_player] call FUNC(sanitizeName);
- call compile format [QUOTE(GVAR(%1_DrawPos) = %2), _nameSane, _control ctrlMapScreenToWorld [_posX, _posY]];
+ missionNamespace setVariable [format [QGVAR(%1_DrawPos), _nameSane], _control ctrlMapScreenToWorld [_posX, _posY]];
};
}];
From 3646654ff3b4bac29d137cb7fd733e9370ddb2ea Mon Sep 17 00:00:00 2001
From: Michael Braun
Date: Sat, 15 Aug 2015 12:21:40 +0200
Subject: [PATCH 13/54] Added module icons
---
addons/map_gestures/CfgVehicles.hpp | 2 ++
.../ui/icon_module_map_gestures_ca.paa | Bin 0 -> 5625 bytes
2 files changed, 2 insertions(+)
create mode 100644 addons/map_gestures/ui/icon_module_map_gestures_ca.paa
diff --git a/addons/map_gestures/CfgVehicles.hpp b/addons/map_gestures/CfgVehicles.hpp
index 30204629a8..f5c2ae8f38 100644
--- a/addons/map_gestures/CfgVehicles.hpp
+++ b/addons/map_gestures/CfgVehicles.hpp
@@ -7,6 +7,7 @@ class CfgVehicles {
function = QFUNC(moduleSettings);
isGlobal = 0;
author = ECSTRING(common,ACETeam);
+ icon = PATHTOF(ui\icon_module_map_gestures_ca.paa);
class Arguments {
class enabled {
displayName = CSTRING(enabled_DisplayName);
@@ -46,6 +47,7 @@ class CfgVehicles {
function = QFUNC(moduleGroupSettings);
isGlobal = 0;
author = ECSTRING(common,ACETeam);
+ icon = PATHTOF(ui\icon_module_map_gestures_ca.paa);
class Arguments {
class leadColor {
displayName = CSTRING(leadColor_displayName);
diff --git a/addons/map_gestures/ui/icon_module_map_gestures_ca.paa b/addons/map_gestures/ui/icon_module_map_gestures_ca.paa
new file mode 100644
index 0000000000000000000000000000000000000000..2d2bcbdf07e0bd88e5158a22bdccdbca6a570df1
GIT binary patch
literal 5625
zcmd^@eN0nV6u=Lq4jD?Ba~emTb=0^;jL9&?=^PJdpcRnm3^Un?QekWwL6?QNIoHQD
zVU9%@NN@(k!5<`=$Vax9Y|gc^{jsP+Bz~ZE>gJ3(tW;n{S?k-qub%r}AEAW|{+Tar
z(qHen=j)z(-+6C>n3|fr=C#zUWGw&;4i3IA@!I4J$|AWarzWSTP!1zs%5S8kWOC#;
zPrfBF0DGnaR6PT5nS4igaliq@5JUcH)FA!!U)itCAHZ1X6M@qh$%pv|k>&Kmc#Qog
z>Ug91Q-wV!H(DwJSZgWQ4rf1P{6ruyo}u~!?Qs=>tco8%V;~>&M{Pe84_R+8Yv>%*
zCxS)Il1etN%D>v)Q2l}Hsg@7LqI&)P6IlFycgmIPMI?f-%K!0Se-c0Oh~*DRafRYw
z_3vN*Kz(G%0`v!Enm}cKNb#HHdZ(lGQs^ru^*?NW{nAQ#`p@w4q1TJni|o&%^&i%L
zXnksbNdAN7=l?#g&d1}$G+KILefw$ToZvQXoaeFj;e3}T%uRpOOVaC7ou4Z1b~`g^e6pB(!G;OUI(&yh1u#9Han4BAk^-9
zu;pvyxXU$rV{)yf$n!fZa-F+sW004gfx>Q+H4a&S$L5=E>(56X>v%@1ub`U*f2Hst
z`m?k{=WT2BT||y*5c1+u3SUKDb$8OoU9ECH)b?JuZrw=YU4Zh2mV_xszkPW-a_OMW
zohlC0A?xVIp){O>3AB&JPQxGZcyUB5
zDP|#O3F_bd;Fl(^_bNqczt_XI`nhRs?EVyaHp|*$dM6gg|A1=EWydP!uMaGzmPc)E
zz;Q!<voi_8*XoA>&7*xs&NzR{G$o_)i%fmh5#yTD@_bW-ju0ulGv_gq*j8_gMU5
zL%5OG#2e85axk|V(`A33mezM4Ti-eTS4z%DIS!+IZ0AbH$;O$iUS_;)&Q+cl8X(OG
zDRGq7b)IN?cuU9j+seDeGcPv!F5&oi#~MEnC#_c$bu2ztk0p@Zx%Y#PtL4=!zFw*9*Q#7e}Giy8b#~^oJ7Vkj)bB;fCaGGE}ioEFht^5NWQLi9t
zrDJU5ZAzphFSiAY?kxHB^syRNpWnfuxc-v;;i&(4yRczN$02s?8a`8KD{H+jtx@EYLz3y*pXqJYYZo@=CD<$4f3w0?qem2!Ob-z77po)q<|?8T5*
zf#fA4M;0_Evo{Cb=IsNvx`C}p$OhilI$NlWM<(*KoS9Qt8aPLB7+9=Md3-Br@aic_
zVQ`M!q!N1VGLt>4kXLtucZ_+b9xmQlgYtjD2UXABK9h~Sn1+#|Sk_$7^5o>eaos@i
zo19{sL=WtY;uXC9aC3&U#mD3)!bJL7^k)3p*;(zIbg1Sxu77{ijwnfvBps%GRg_nq
la*pjrV`b^Fwte14l-H6ImE<%1$nMXJu6(fu|E5y`{sk(+gCGC^
literal 0
HcmV?d00001
From 7217d5ec10ffdf14fb08d1b305b86793ca98477e Mon Sep 17 00:00:00 2001
From: Michael Braun
Date: Mon, 24 Aug 2015 17:03:47 +0200
Subject: [PATCH 14/54] Various code cleanups and switch to player UIDs instead
of sanitized names
---
addons/map_gestures/CfgEventHandlers.hpp | 1 +
addons/map_gestures/XEH_preInit.sqf | 1 -
addons/map_gestures/XEH_serverPostInit.sqf | 3 ++
.../functions/fnc_assignClientIDOnServer.sqf | 2 +-
.../functions/fnc_drawMapGestures.sqf | 35 +++++++++++++------
.../functions/fnc_getProximityPlayers.sqf | 5 +--
.../functions/fnc_moduleGroupSettings.sqf | 12 ++++---
.../functions/fnc_receiverInit.sqf | 8 -----
.../functions/fnc_sanitizeName.sqf | 30 ----------------
.../map_gestures/functions/fnc_transmit.sqf | 24 +++++++------
.../functions/fnc_transmitterInit.sqf | 22 ++++++------
addons/map_gestures/script_component.hpp | 2 ++
12 files changed, 67 insertions(+), 78 deletions(-)
create mode 100644 addons/map_gestures/XEH_serverPostInit.sqf
delete mode 100644 addons/map_gestures/functions/fnc_sanitizeName.sqf
diff --git a/addons/map_gestures/CfgEventHandlers.hpp b/addons/map_gestures/CfgEventHandlers.hpp
index e75956f440..7e0c8d2ce3 100644
--- a/addons/map_gestures/CfgEventHandlers.hpp
+++ b/addons/map_gestures/CfgEventHandlers.hpp
@@ -7,5 +7,6 @@ class Extended_PreInit_EventHandlers {
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_postInit));
+ serverInit = QUOTE(call COMPILE_FILE(XEH_serverPostInit));
};
};
diff --git a/addons/map_gestures/XEH_preInit.sqf b/addons/map_gestures/XEH_preInit.sqf
index ad4da44998..8154106fd6 100644
--- a/addons/map_gestures/XEH_preInit.sqf
+++ b/addons/map_gestures/XEH_preInit.sqf
@@ -11,7 +11,6 @@ PREP(isValidColorArray);
PREP(moduleGroupSettings);
PREP(moduleSettings);
PREP(receiverInit);
-PREP(sanitizeName);
PREP(transmit);
PREP(transmitterInit);
diff --git a/addons/map_gestures/XEH_serverPostInit.sqf b/addons/map_gestures/XEH_serverPostInit.sqf
new file mode 100644
index 0000000000..9bbf84911e
--- /dev/null
+++ b/addons/map_gestures/XEH_serverPostInit.sqf
@@ -0,0 +1,3 @@
+#include "script_component.hpp"
+
+[MAP_GESTURES_NO_OWNER_ID_EVENT, FUNC(assignClientIDOnServer)] call EFUNC(common,addEventHandler)
diff --git a/addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf b/addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf
index c686c17b79..92b1e95ab5 100644
--- a/addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf
+++ b/addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf
@@ -18,7 +18,7 @@
params ["_unitName"];
{
- if (name _x == _unitName) then {
+ if (name _x == _unitName) exitWith {
_x setVariable [QGVAR(owner_id), owner _x, true];
};
} count playableUnits;
diff --git a/addons/map_gestures/functions/fnc_drawMapGestures.sqf b/addons/map_gestures/functions/fnc_drawMapGestures.sqf
index 54efd878ce..31c41ca995 100644
--- a/addons/map_gestures/functions/fnc_drawMapGestures.sqf
+++ b/addons/map_gestures/functions/fnc_drawMapGestures.sqf
@@ -15,23 +15,35 @@
*/
#include "script_component.hpp"
-if (!GVAR(enabled)) exitWith {};
-if (!visibleMap) exitWith {};
+#define ICON_RENDER_SIZE 55
+#define ICON_TEXT_ALIGN "left"
+#define ICON_ANGLE 0
+#define ICON_SHADOW 1
+#define TEXT_FONT "PuristaBold"
+#define TEXT_ICON_RENDER_SIZE 20
+#define TEXT_SIZE 0.030
+#define TEXT_SHADOW 0
+
+if (!GVAR(enabled) || !visibleMap) exitWith {};
params ["_mapHandle"];
-_proximityPlayers = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers);
+// Iterate over all nearby players and render their pointer if player is transmitting.
{
- _nameSane = [name _x] call FUNC(sanitizeName);
- _drawPosVariableName = format [QGVAR(%1_DrawPos), _nameSane];
- if (!isNil _drawPosVariableName) then {
+ // Data variable name for unit
+ _unitUID = getPlayerUID _x;
+ _drawPosVariableName = if (!isNil "_unitUID" && _unitUID != "") then {format [QGVAR(%1_DrawPos), _unitUID]} else {nil};
+
+ if (!isNil "_drawPosVariableName") then {
if (isNil {missionNamespace getVariable _drawPosVariableName}) then {missionNamespace setVariable [_drawPosVariableName, [1, 1, 1]];};
_pos = missionNamespace getVariable _drawPosVariableName;
- if (alive _x &&
- {_x getVariable QGVAR(Transmit)}) then {
+
+ // Only render if the unit is alive and transmitting
+ if (alive _x && {_x getVariable QGVAR(Transmit)}) then {
_group = group _x;
_grpName = groupID _group;
+ // If color settings for the group exist, then use those, otherwise fall back to the default colors
_color = if (_grpName in GVAR(GroupColorConfigurationsGroups)) then {
_grpNameIndex = GVAR(GroupColorConfigurationsGroups) find _grpName;
(GVAR(GroupColorConfigurations) select (GVAR(GroupColorConfigurationsGroupIndex) select _grpNameIndex)) select (_x != leader _group)
@@ -39,9 +51,10 @@ _proximityPlayers = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers);
if (_x == leader _group) then {GVAR(defaultLeadColor)} else {GVAR(defaultColor)};
};
- _mapHandle drawIcon ["\a3\ui_f\data\gui\cfg\Hints\icon_text\group_1_ca.paa", _color, _pos, 55, 55, 0, "", 1, 0.030, "PuristaBold", "left"];
- _mapHandle drawIcon ["#(argb,8,8,3)color(0,0,0,0)", [.2,.2,.2,.3], _pos, 20, 20, 0, name _x, 0, 0.030, "PuristaBold", "left"];
+ // Render icon and player name
+ _mapHandle drawIcon ["\a3\ui_f\data\gui\cfg\Hints\icon_text\group_1_ca.paa", _color, _pos, ICON_RENDER_SIZE, ICON_RENDER_SIZE, ICON_ANGLE, "", ICON_SHADOW, TEXT_SIZE, TEXT_FONT, ICON_TEXT_ALIGN];
+ _mapHandle drawIcon ["#(argb,8,8,3)color(0,0,0,0)", [.2,.2,.2,.3], _pos, TEXT_ICON_RENDER_SIZE, TEXT_ICON_RENDER_SIZE, ICON_ANGLE, name _x, TEXT_SHADOW, TEXT_SIZE, TEXT_FONT, ICON_TEXT_ALIGN];
};
};
nil
-} count _proximityPlayers;
+} count ([ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers));
diff --git a/addons/map_gestures/functions/fnc_getProximityPlayers.sqf b/addons/map_gestures/functions/fnc_getProximityPlayers.sqf
index 3ac8803a70..43d78f3506 100644
--- a/addons/map_gestures/functions/fnc_getProximityPlayers.sqf
+++ b/addons/map_gestures/functions/fnc_getProximityPlayers.sqf
@@ -19,5 +19,6 @@
params ["_unit", "_range"];
_proximityPlayers = (getPos _unit) nearEntities [["CAMAnBase"], _range];
-_proximityPlayers = _proximityPlayers - [_unit];
-(_proximityPlayers + (crew vehicle _unit))
+_proximityPlayers deleteAt (_proximityPlayers find _unit);
+_proximityPlayers append (crew vehicle _unit)
+_proximityPlayers
diff --git a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf
index 32f7e73143..013f076347 100644
--- a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf
+++ b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf
@@ -19,22 +19,24 @@
params ["_logic", "_units", "_activated"];
-diag_log "Running";
-
-if (!_activated) exitWith {};
-if (!isServer) exitWith {};
+if (!_activated || !isServer) exitWith {};
+// Transcode string setting into usable array. Example: "1,1,1,1" -> [1, 1, 1, 1]
_leadColor = call compile ("[" + (_logic getVariable ["leadColor", ""]) + "]");
if (!([_leadColor] call FUNC(isValidColorArray))) exitWith {ERROR("leadColor is not a valid color array.")};
_color = call compile ("[" + (_logic getVariable ["color", ""]) + "]");
if (!([_color] call FUNC(isValidColorArray))) exitWith {ERROR("color is not a valid color array.")};
+// If we already have color configurations from another source, use those, otherwise use default.
_configurations = if (isNil QGVAR(GroupColorConfigurations)) then { [] } else { +GVAR(GroupColorConfigurations) };
_configurationGroups = if (isNil QGVAR(GroupColorConfigurationsGroups)) then { [] } else { +GVAR(GroupColorConfigurationsGroups) };
_configurationGroupsIndex = if (isNil QGVAR(GroupColorConfigurationsGroupIndex)) then { [] } else { +GVAR(GroupColorConfigurationsGroupIndex) };
-_completedGroups = [];
+// Save custom color configuration and keep the index of the entry.
_configurationIndex = _configurations pushBack [_leadColor, _color];
+
+// Add all synchronized groups and reference custom configuration for them
+_completedGroups = [];
{
private "_group";
_group = groupID (group _x);
diff --git a/addons/map_gestures/functions/fnc_receiverInit.sqf b/addons/map_gestures/functions/fnc_receiverInit.sqf
index 719e5a727b..a14efbffc1 100644
--- a/addons/map_gestures/functions/fnc_receiverInit.sqf
+++ b/addons/map_gestures/functions/fnc_receiverInit.sqf
@@ -15,14 +15,6 @@
*/
#include "script_component.hpp"
-{
- if (isPlayer _x) then {
- _nameSane = [name _x] call FUNC(sanitizeName);
- missionNamespace setVariable [format [QGVAR(%1_DrawPos), _nameSane], [1, 1, 1]];
- };
- nil
-} count allUnits;
-
ACE_player setVariable [QGVAR(Transmit), false, true];
GVAR(EnableTransmit) = false;
diff --git a/addons/map_gestures/functions/fnc_sanitizeName.sqf b/addons/map_gestures/functions/fnc_sanitizeName.sqf
deleted file mode 100644
index f36e626102..0000000000
--- a/addons/map_gestures/functions/fnc_sanitizeName.sqf
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Author: Dslyecxi, MikeMatrix
- * Cleans up unit names to be usable within variable names.
- *
- * Arguments:
- * 0: Name
- *
- * Return Value:
- * Sanitized name
- *
- * Example:
- * ["I am a non valid variable name"] call ace_map_gestures_fnc_sanitizeName
- *
- * Public: No
- */
-#include "script_component.hpp"
-
-private ["_alphabet", "_nameSanitized"];
-
-params ["_name"];
-
-_alphabet = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];
-
-_nameSanitized = [];
-{
- if (toString [_x] in _alphabet) then {_nameSanitized pushBack _x};
- nil
-} count (toArray _name);
-
-toString _nameSanitized
diff --git a/addons/map_gestures/functions/fnc_transmit.sqf b/addons/map_gestures/functions/fnc_transmit.sqf
index 4d99caa160..56adbe4266 100644
--- a/addons/map_gestures/functions/fnc_transmit.sqf
+++ b/addons/map_gestures/functions/fnc_transmit.sqf
@@ -16,26 +16,30 @@
*/
#include "script_component.hpp"
-private ["_proximityPlayers", "_ownerID", "_nameSane"];
+private ["_proximityPlayers", "_ownerID", "_unitUID", "_drawPosVariableName"];
params ["", "_pfhId"];
-if (!GVAR(EnableTransmit) || !visibleMap) exitWith {
+if (!visibleMap) then {
call FUNC(endTransmit);
+}
+
+if (!GVAR(EnableTransmit) || !visibleMap) exitWith {
[_pfhId] call CBA_fnc_removePerFrameHandler;
};
-_proximityPlayers = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers);
-TRACE_1("Near",_proximityPlayers)
-
{
_ownerID = _x getVariable QGVAR(owner_id);
if (isNil "_ownerID") then {
- [0, {[_this] call FUNC(assignClientIDOnServer)}, name _x] call cba_fnc_GlobalExecute;
+ [MAP_GESTURES_NO_OWNER_ID_EVENT, [name _x]] call EFUNC(common,serverEvent);
} else {
- if (_ownerID != ACE_player getVariable QGVAR(owner_id)) then {
- _nameSane = [name ACE_player] call FUNC(sanitizeName);
- _ownerID publicVariableClient format [QGVAR(%1_DrawPos), _nameSane];
+ _playerOwnerID = ACE_player getVariable QGVAR(owner_id);
+ if (!isNil "_playerOwnerID" && _ownerID != _playerOwnerID) then {
+ _unitUID = getPlayerUID ACE_Player;
+ _drawPosVariableName = if (!isNil "_unitUID" && _unitUID != "") then {format [QGVAR(%1_DrawPos), _unitUID]} else {nil};
+ if (!isNil "_drawPosVariableName") then {
+ _ownerID publicVariableClient _drawPosVariableName;
+ };
};
};
-} count _proximityPlayers;
+} count ([ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers));
diff --git a/addons/map_gestures/functions/fnc_transmitterInit.sqf b/addons/map_gestures/functions/fnc_transmitterInit.sqf
index 828261e017..251e6d2619 100644
--- a/addons/map_gestures/functions/fnc_transmitterInit.sqf
+++ b/addons/map_gestures/functions/fnc_transmitterInit.sqf
@@ -15,7 +15,7 @@
*/
#include "script_component.hpp"
-private ["_mapCtrl", "_nameSane"];
+private ["_mapCtrl", "_unitUID", "_drawPosVariableName"];
disableSerialization;
@@ -24,19 +24,19 @@ _mapCtrl = findDisplay 12 displayCtrl 51;
// MouseMoving EH.
if (!isNil QGVAR(MouseMoveHandlerID)) then {_mapCtrl ctrlRemoveEventHandler ["MouseMoving", GVAR(MouseMoveHandlerID)]; GVAR(MouseMoveHandlerID) = nil;};
GVAR(MouseMoveHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseMoving", {
- if (EGVAR(maptools,drawing_isDrawing)) exitWith {};
- if (EGVAR(maptools,mapTool_isDragging)) exitWith {};
- if (EGVAR(maptools,mapTool_isRotating)) exitWith {};
+ // Don't transmit any data if we're using the map tools
+ if (!GVAR(EnableTransmit) || EGVAR(maptools,drawing_isDrawing) || EGVAR(maptools,mapTool_isDragging) || EGVAR(maptools,mapTool_isRotating)) exitWith {};
params ["_control", "_posX", "_posY"];
- if (GVAR(EnableTransmit)) then {
- if (!(ACE_player getVariable QGVAR(Transmit))) then {
- ACE_player setVariable [QGVAR(Transmit), true, true];
- };
+ if (!(ACE_player getVariable QGVAR(Transmit))) then {
+ ACE_player setVariable [QGVAR(Transmit), true, true];
+ };
- _nameSane = [name ACE_player] call FUNC(sanitizeName);
- missionNamespace setVariable [format [QGVAR(%1_DrawPos), _nameSane], _control ctrlMapScreenToWorld [_posX, _posY]];
+ _unitUID = getPlayerUID ACE_player;
+ _drawPosVariableName = if (!isNil "_unitUID" && _unitUID != "") then {format [QGVAR(%1_DrawPos), _unitUID]} else {nil};
+ if (!isNil "_drawPosVariableName") then {
+ missionNamespace setVariable [_drawPosVariableName, _control ctrlMapScreenToWorld [_posX, _posY]];
};
}];
@@ -53,6 +53,8 @@ GVAR(MouseDownHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseButtonDown", {
// MouseUp EH
if (!isNil QGVAR(MouseUpHandlerID)) then {_mapCtrl ctrlRemoveEventHandler ["MouseButtonUp", GVAR(MouseUpHandlerID)]; GVAR(MouseUpHandlerID) = nil;};
GVAR(MouseUpHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseButtonUp", {
+ if (!GVAR(enabled)) exitWith {};
+
params ["", "_button"];
if (_button == 0) then {call FUNC(endTransmit);};
diff --git a/addons/map_gestures/script_component.hpp b/addons/map_gestures/script_component.hpp
index 7c6f3a5b2f..50f155ccc1 100644
--- a/addons/map_gestures/script_component.hpp
+++ b/addons/map_gestures/script_component.hpp
@@ -10,3 +10,5 @@
#endif
#include "\z\ace\addons\main\script_macros.hpp"
+
+#define MAP_GESTURES_NO_OWNER_ID_EVENT "PlayerNameHasNoOwnerID"
From ee2cc22801ae83b698a403cb43610fa23031dbae Mon Sep 17 00:00:00 2001
From: Michael Braun
Date: Mon, 24 Aug 2015 17:28:08 +0200
Subject: [PATCH 15/54] Added missing semicolon
---
addons/map_gestures/functions/fnc_transmit.sqf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/addons/map_gestures/functions/fnc_transmit.sqf b/addons/map_gestures/functions/fnc_transmit.sqf
index 56adbe4266..ccd702fd55 100644
--- a/addons/map_gestures/functions/fnc_transmit.sqf
+++ b/addons/map_gestures/functions/fnc_transmit.sqf
@@ -22,7 +22,7 @@ params ["", "_pfhId"];
if (!visibleMap) then {
call FUNC(endTransmit);
-}
+};
if (!GVAR(EnableTransmit) || !visibleMap) exitWith {
[_pfhId] call CBA_fnc_removePerFrameHandler;
From 0ff5e86b5271ee4035927caa7df724700fd92d5e Mon Sep 17 00:00:00 2001
From: Michael Braun
Date: Mon, 24 Aug 2015 21:00:24 +0200
Subject: [PATCH 16/54] Another missing semi-colon
---
addons/map_gestures/functions/fnc_getProximityPlayers.sqf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/addons/map_gestures/functions/fnc_getProximityPlayers.sqf b/addons/map_gestures/functions/fnc_getProximityPlayers.sqf
index 43d78f3506..7a72c00520 100644
--- a/addons/map_gestures/functions/fnc_getProximityPlayers.sqf
+++ b/addons/map_gestures/functions/fnc_getProximityPlayers.sqf
@@ -20,5 +20,5 @@ params ["_unit", "_range"];
_proximityPlayers = (getPos _unit) nearEntities [["CAMAnBase"], _range];
_proximityPlayers deleteAt (_proximityPlayers find _unit);
-_proximityPlayers append (crew vehicle _unit)
+_proximityPlayers append (crew vehicle _unit);
_proximityPlayers
From ef2924623f05142ea960e857ed230aec02ba9547 Mon Sep 17 00:00:00 2001
From: jonpas
Date: Mon, 24 Aug 2015 21:45:02 +0200
Subject: [PATCH 17/54] Added common parseList function for module list parsing
---
addons/common/XEH_preInit.sqf | 1 +
.../functions/fnc_assignObjectsInList.sqf | 39 +++++-------
addons/common/functions/fnc_parseList.sqf | 61 +++++++++++++++++++
addons/slideshow/XEH_preInit.sqf | 1 -
addons/slideshow/functions/fnc_makeList.sqf | 57 -----------------
addons/slideshow/functions/fnc_moduleInit.sqf | 8 +--
6 files changed, 80 insertions(+), 87 deletions(-)
create mode 100644 addons/common/functions/fnc_parseList.sqf
delete mode 100644 addons/slideshow/functions/fnc_makeList.sqf
diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf
index 6fdf99113c..705e8e8b4b 100644
--- a/addons/common/XEH_preInit.sqf
+++ b/addons/common/XEH_preInit.sqf
@@ -144,6 +144,7 @@ PREP(numberToDigitsString);
PREP(numberToString);
PREP(onAnswerRequest);
PREP(owned);
+PREP(parseList);
PREP(player);
PREP(playerSide);
PREP(positionToASL);
diff --git a/addons/common/functions/fnc_assignObjectsInList.sqf b/addons/common/functions/fnc_assignObjectsInList.sqf
index 0d10066d01..89c8a3352d 100644
--- a/addons/common/functions/fnc_assignObjectsInList.sqf
+++ b/addons/common/functions/fnc_assignObjectsInList.sqf
@@ -4,47 +4,36 @@
* Used by moduleAssign* within various parts of the ACE3 project.
*
* Arguments:
- * 0: list
- * 1: variableName
- * 2: value
+ * 0: List
+ * 1: Variable Name
+ * 2: Value
* 3: Global
*
* Return Value:
- * None
+ * None
+ *
+ * Example:
+ * ["text", "variable", value, true] call ace_common_fnc_assignObjectsInList
*
* Public: No
*/
-
+#define DEBUG_MODE_FULL
#include "script_component.hpp"
-private ["_splittedList", "_nilCheckPassedList"];
params ["_list", "_variable", "_setting", "_global"];
if (typeName _list == "STRING") then {
- _splittedList = [_list, ","] call BIS_fnc_splitString;
- _nilCheckPassedList = "";
- {
- _x = [_x] call FUNC(stringRemoveWhiteSpace);
- if !(isnil _x) then {
- if (_nilCheckPassedList == "") then {
- _nilCheckPassedList = _x;
- } else {
- _nilCheckPassedList = _nilCheckPassedList + ","+ _x;
- };
- };
- }foreach _splittedList;
-
- _list = [] call compile format["[%1]",_nilCheckPassedList];
+ _list = [_list, true, true] call FUNC(parseList);
+ TRACE_1("Parsed",_list)
};
{
- if (!isnil "_x") then {
+ if (!isNil "_x") then {
if (typeName _x == typeName objNull) then {
if (local _x) then {
- _x setvariable [_variable, _setting, _global];
+ _x setVariable [_variable, _setting, _global];
+ TRACE_4("Set variable",_x,_variable,_setting,_global);
};
};
};
-}foreach _list;
-
-true
+} count _list;
diff --git a/addons/common/functions/fnc_parseList.sqf b/addons/common/functions/fnc_parseList.sqf
new file mode 100644
index 0000000000..20630e1109
--- /dev/null
+++ b/addons/common/functions/fnc_parseList.sqf
@@ -0,0 +1,61 @@
+/*
+ * Author: Jonpas
+ * Makes a list from a string using comma as a delimiter, optionally trim or remove whitespace and check each for object existence.
+ *
+ * Arguments:
+ * 0: List
+ * 1: Remove or Trim Whitespace (default: false (trim))
+ * 2: Check Nil (default: false)
+ *
+ * Return Value:
+ * Parsed List
+ *
+ * Example:
+ * ["text", true, false] call ace_common_fnc_parseList
+ *
+ * Public: No
+ */
+#define DEBUG_MODE_FULL
+#include "script_component.hpp"
+
+private ["_splittedList", "_whitespaceList", "_nilCheckedList"];
+params ["_list", ["_removeWhitespace", false], ["_checkNil", false]];
+
+
+// Split using comma delimiter
+_splittedList = [_list, ","] call BIS_fnc_splitString;
+
+
+// Remove or Trim Whitespace
+_whitespaceList = [];
+{
+ if (_removeWhitespace) then {
+ _whitespaceList pushBack ([_x] call FUNC(stringRemoveWhiteSpace));
+ } else {
+ _whitespaceList pushBack ([_x] call CBA_fnc_trim);
+ };
+ nil
+} count _splittedList;
+_list = _whitespaceList;
+
+
+// Check for object existence
+_nilCheckedList = "";
+if (_checkNil) then {
+ {
+ if !(isNil _x) then {
+ if (_nilCheckedList == "") then {
+ _nilCheckedList = _x;
+ } else {
+ _nilCheckedList = _nilCheckedList + "," + _x;
+ };
+ };
+ } count _list;
+
+ // Add Array characters and parse into array
+ _list = [] call compile format ["[%1]", _nilCheckedList];
+};
+
+TRACE_4("Lists",_splittedList,_whitespaceList,_nilCheckedList,_list);
+
+_list
diff --git a/addons/slideshow/XEH_preInit.sqf b/addons/slideshow/XEH_preInit.sqf
index 0f9e270896..152c02ec77 100644
--- a/addons/slideshow/XEH_preInit.sqf
+++ b/addons/slideshow/XEH_preInit.sqf
@@ -5,7 +5,6 @@ ADDON = false;
PREP(addSlideActions);
PREP(autoTransition);
PREP(createSlideshow);
-PREP(makeList);
PREP(moduleInit);
GVAR(slideshows) = 0;
diff --git a/addons/slideshow/functions/fnc_makeList.sqf b/addons/slideshow/functions/fnc_makeList.sqf
deleted file mode 100644
index 6736fabbdb..0000000000
--- a/addons/slideshow/functions/fnc_makeList.sqf
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Author: Jonpas
- * Makes a list from a string using comma as a delimiter, optionally remove whitespace and check each for object existence.
- *
- * Arguments:
- * 0: Text
- * 1: Trim Whitespace
- * 2: Check Nil
- *
- * Return Value:
- * Parsed List
- *
- * Example:
- * ["text", true, false] call ace_slideshow_fnc_makeList
- *
- * Public: No
- */
-#include "script_component.hpp"
-
-params ["_list", "_trimWhitespace", "_checkNil"];
-
-private ["_splittedList", "_listTrimmedWhitespace", "_nilCheckPassedList"];
-
-// Split using comma delimiter
-_splittedList = [_list, ","] call BIS_fnc_splitString;
-
-// Remove whitespace
-_listTrimmedWhitespace = [];
-if (_trimWhitespace) then {
- {
- _listTrimmedWhitespace pushBack ([_x] call CBA_fnc_trim);
- nil
- } count _splittedList;
- _list = _listTrimmedWhitespace;
-};
-
-// Check for object existence
-_nilCheckPassedList = "";
-if (_checkNil) then {
- {
- if !(isNil _x) then {
- if (_nilCheckPassedList == "") then {
- _nilCheckPassedList = _x;
- } else {
- _nilCheckPassedList = _nilCheckPassedList + "," + _x;
- };
- };
- } count _list;
-
- // Add Array characters and parse into array
- _list = "[" + _nilCheckPassedList + "]";
- _list = [] call compile _list;
-};
-
-TRACE_4("Lists",_splittedList,_listTrimmedWhitespace,_nilCheckPassedList,_list);
-
-_list // return
diff --git a/addons/slideshow/functions/fnc_moduleInit.sqf b/addons/slideshow/functions/fnc_moduleInit.sqf
index da1724dfcc..e4f7fbb56c 100644
--- a/addons/slideshow/functions/fnc_moduleInit.sqf
+++ b/addons/slideshow/functions/fnc_moduleInit.sqf
@@ -25,10 +25,10 @@ if !(_activated) exitWith {};
if (isNull _logic) exitWith {};
// Extract variables from logic
-_objects = [_logic getVariable ["Objects", ""], true, true] call FUNC(makeList);
-_controllers = [_logic getVariable ["Controllers", ""], true, true] call FUNC(makeList);
-_images = [_logic getVariable ["Images", ""], true, false] call FUNC(makeList);
-_names = [_logic getVariable ["Names", ""], true, false] call FUNC(makeList);
+_objects = [_logic getVariable ["Objects", ""], true, true] call EFUNC(common,parseList);
+_controllers = [_logic getVariable ["Controllers", ""], true, true] call EFUNC(common,parseList);
+_images = [_logic getVariable ["Images", ""], false, false] call EFUNC(common,parseList);
+_names = [_logic getVariable ["Names", ""], false, false] call EFUNC(common,parseList);
_duration = _logic getVariable ["Duration", 0];
// Prepare with actions
From 5b6429f23e84bd3af7439d88cd5aa9860f72006a Mon Sep 17 00:00:00 2001
From: jonpas
Date: Mon, 24 Aug 2015 21:55:48 +0200
Subject: [PATCH 18/54] Made more modules use assignObjectsInList common
function
---
.../functions/fnc_moduleAssignMedicRoles.sqf | 59 ++++--------------
.../fnc_moduleAssignMedicalVehicle.sqf | 60 ++++---------------
.../functions/fnc_moduleAssignEngineer.sqf | 8 +--
.../fnc_moduleAssignRepairFacility.sqf | 6 +-
.../fnc_moduleAssignRepairVehicle.sqf | 8 +--
5 files changed, 30 insertions(+), 111 deletions(-)
diff --git a/addons/medical/functions/fnc_moduleAssignMedicRoles.sqf b/addons/medical/functions/fnc_moduleAssignMedicRoles.sqf
index 1c26eb53d4..a884bfe300 100644
--- a/addons/medical/functions/fnc_moduleAssignMedicRoles.sqf
+++ b/addons/medical/functions/fnc_moduleAssignMedicRoles.sqf
@@ -1,63 +1,26 @@
/*
* Author: Glowbal
- * Assign a medical role to a unit
+ * Assign a medical role to a unit.
*
* Arguments:
- * 0: The module logic
- * 1: units
- * 2: activated
+ * 0: The module logic
+ * 1: Synchronized units
+ * 2: Activated
*
* Return Value:
* None
*
* Public: No
*/
-
#include "script_component.hpp"
-private ["_logic","_setting","_objects", "_list", "_splittedList", "_nilCheckPassedList", "_parsedList"];
-_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param;
+params ["_logic"];
if (!isNull _logic) then {
- _list = _logic getvariable ["EnableList",""];
+ private ["_list", "_setting"];
+ _list = _logic getVariable ["EnableList", ""];
+ _setting = _logic getVariable ["role", 0];
- _splittedList = [_list, ","] call BIS_fnc_splitString;
- _nilCheckPassedList = "";
- {
- _x = [_x] call EFUNC(common,stringRemoveWhiteSpace);
- if !(isnil _x) then {
- if (_nilCheckPassedList == "") then {
- _nilCheckPassedList = _x;
- } else {
- _nilCheckPassedList = _nilCheckPassedList + ","+ _x;
- };
- };
- }foreach _splittedList;
-
- _list = "[" + _nilCheckPassedList + "]";
- _parsedList = [] call compile _list;
- _setting = _logic getvariable ["role",0];
- _objects = synchronizedObjects _logic;
- if (!(_objects isEqualTo []) && _parsedList isEqualTo []) then {
- {
- if (!isnil "_x") then {
- if (typeName _x == typeName objNull) then {
- if (local _x) then {
- _x setvariable [QGVAR(medicClass), _setting, true];
- };
- };
- };
- }foreach _objects;
- };
- {
- if (!isnil "_x") then {
- if (typeName _x == typeName objNull) then {
- if (local _x) then {
- _x setvariable [QGVAR(medicClass), _setting, true];
- };
- };
- };
- }foreach _parsedList;
- };
-
-true
\ No newline at end of file
+ [_list, QGVAR(medicClass), _setting, true] call EFUNC(common,assignObjectsInList);
+ [synchronizedObjects _logic, QGVAR(medicClass), _setting, true] call EFUNC(common,assignObjectsInList);
+};
diff --git a/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf b/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf
index af6de73ce1..d073ffaecb 100644
--- a/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf
+++ b/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf
@@ -1,64 +1,26 @@
/*
* Author: Glowbal
- * Assign vehicle as a medical vehicle
+ * Assign vehicle as a medical vehicle.
*
* Arguments:
- * 0: The module logic
- * 1: units
- * 2: activated
+ * 0: The module logic
+ * 1: Synchronized units
+ * 2: Activated
*
* Return Value:
* None
*
* Public: No
*/
-
-
#include "script_component.hpp"
-private ["_logic","_setting","_objects", "_list", "_splittedList", "_nilCheckPassedList", "_parsedList"];
-_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param;
+params ["_logic"];
if (!isNull _logic) then {
- _list = _logic getvariable ["EnableList",""];
+ private ["_list", "_setting"];
+ _list = _logic getVariable ["EnableList", ""];
+ _setting = _logic getVariable ["enabled", 0];
- _splittedList = [_list, ","] call BIS_fnc_splitString;
- _nilCheckPassedList = "";
- {
- _x = [_x] call EFUNC(common,stringRemoveWhiteSpace);
- if !(isnil _x) then {
- if (_nilCheckPassedList == "") then {
- _nilCheckPassedList = _x;
- } else {
- _nilCheckPassedList = _nilCheckPassedList + ","+ _x;
- };
- };
- }foreach _splittedList;
-
- _list = "[" + _nilCheckPassedList + "]";
- _parsedList = [] call compile _list;
- _setting = _logic getvariable ["enabled", 0];
- _objects = synchronizedObjects _logic;
- if (!(_objects isEqualTo []) && _parsedList isEqualTo []) then {
- {
- if (!isnil "_x") then {
- if (typeName _x == typeName objNull) then {
- if (local _x) then {
- _x setvariable [QGVAR(medicClass), _setting, true];
- };
- };
- };
- }foreach _objects;
- };
- {
- if (!isnil "_x") then {
- if (typeName _x == typeName objNull) then {
- if (local _x) then {
- _x setvariable [QGVAR(medicClass), _setting, true];
- };
- };
- };
- }foreach _parsedList;
- };
-
-true;
+ [_list, QGVAR(medicClass), _setting, true] call EFUNC(common,assignObjectsInList);
+ [synchronizedObjects _logic, QGVAR(medicClass), _setting, true] call EFUNC(common,assignObjectsInList);
+};
diff --git a/addons/repair/functions/fnc_moduleAssignEngineer.sqf b/addons/repair/functions/fnc_moduleAssignEngineer.sqf
index 9fb9ed8431..240a8c3b62 100644
--- a/addons/repair/functions/fnc_moduleAssignEngineer.sqf
+++ b/addons/repair/functions/fnc_moduleAssignEngineer.sqf
@@ -21,11 +21,9 @@ params ["_logic"];
if (!isNull _logic) then {
private ["_list", "_setting"];
- _list = _logic getVariable ["EnableList",""];
- _setting = _logic getVariable ["role",0];
+ _list = _logic getVariable ["EnableList", ""];
+ _setting = _logic getVariable ["role", 0];
[_list, "ACE_IsEngineer", _setting, true] call EFUNC(common,assignObjectsInList);
[synchronizedObjects _logic, "ACE_IsEngineer", _setting, true] call EFUNC(common,assignObjectsInList);
- };
-
-true
+};
diff --git a/addons/repair/functions/fnc_moduleAssignRepairFacility.sqf b/addons/repair/functions/fnc_moduleAssignRepairFacility.sqf
index 00cb847866..7150d0226b 100644
--- a/addons/repair/functions/fnc_moduleAssignRepairFacility.sqf
+++ b/addons/repair/functions/fnc_moduleAssignRepairFacility.sqf
@@ -21,11 +21,9 @@ params ["_logic"];
if (!isNull _logic) then {
private ["_list", "_setting"];
- _list = _logic getVariable ["EnableList",""];
- _setting = _logic getVariable ["role",0];
+ _list = _logic getVariable ["EnableList", ""];
+ _setting = _logic getVariable ["role", 0];
[_list, "ACE_isRepairFacility", _setting, true] call EFUNC(common,assignObjectsInList);
[synchronizedObjects _logic, "ACE_isRepairFacility", _setting, true] call EFUNC(common,assignObjectsInList);
};
-
-true
diff --git a/addons/repair/functions/fnc_moduleAssignRepairVehicle.sqf b/addons/repair/functions/fnc_moduleAssignRepairVehicle.sqf
index 69d2a2c52f..647b5fe52c 100644
--- a/addons/repair/functions/fnc_moduleAssignRepairVehicle.sqf
+++ b/addons/repair/functions/fnc_moduleAssignRepairVehicle.sqf
@@ -21,11 +21,9 @@ params ["_logic"];
if (!isNull _logic) then {
private ["_list", "_setting"];
- _list = _logic getVariable ["EnableList",""];
- _setting = _logic getVariable ["role",0];
+ _list = _logic getVariable ["EnableList", ""];
+ _setting = _logic getVariable ["role", 0];
[_list, "ACE_isRepairVehicle", _setting, true] call EFUNC(common,assignObjectsInList);
[synchronizedObjects _logic, "ACE_isRepairVehicle", _setting, true] call EFUNC(common,assignObjectsInList);
- };
-
-true
+};
From 3f41882a0673b2bdf8cbf1a42319b431c140fb9f Mon Sep 17 00:00:00 2001
From: jonpas
Date: Mon, 24 Aug 2015 21:56:21 +0200
Subject: [PATCH 19/54] Removed debug
---
addons/common/functions/fnc_assignObjectsInList.sqf | 1 -
addons/common/functions/fnc_parseList.sqf | 1 -
2 files changed, 2 deletions(-)
diff --git a/addons/common/functions/fnc_assignObjectsInList.sqf b/addons/common/functions/fnc_assignObjectsInList.sqf
index 89c8a3352d..eddd792500 100644
--- a/addons/common/functions/fnc_assignObjectsInList.sqf
+++ b/addons/common/functions/fnc_assignObjectsInList.sqf
@@ -17,7 +17,6 @@
*
* Public: No
*/
-#define DEBUG_MODE_FULL
#include "script_component.hpp"
params ["_list", "_variable", "_setting", "_global"];
diff --git a/addons/common/functions/fnc_parseList.sqf b/addons/common/functions/fnc_parseList.sqf
index 20630e1109..8cce3c1837 100644
--- a/addons/common/functions/fnc_parseList.sqf
+++ b/addons/common/functions/fnc_parseList.sqf
@@ -15,7 +15,6 @@
*
* Public: No
*/
-#define DEBUG_MODE_FULL
#include "script_component.hpp"
private ["_splittedList", "_whitespaceList", "_nilCheckedList"];
From 3cbe6a3ebcc7792aac5cee970451fd32df22f679 Mon Sep 17 00:00:00 2001
From: Michael Braun
Date: Mon, 24 Aug 2015 22:03:47 +0200
Subject: [PATCH 20/54] Fixed multiple group settings not applying properly.
Added client configuration options for default colors.
---
addons/map_gestures/ACE_Settings.hpp | 56 +++++++++++++------
addons/map_gestures/XEH_serverPostInit.sqf | 2 +-
.../functions/fnc_drawMapGestures.sqf | 2 +-
.../functions/fnc_moduleGroupSettings.sqf | 6 +-
.../functions/fnc_moduleSettings.sqf | 4 +-
.../functions/fnc_receiverInit.sqf | 3 +-
.../map_gestures/functions/fnc_transmit.sqf | 2 +-
.../functions/fnc_transmitterInit.sqf | 15 ++++-
addons/map_gestures/script_component.hpp | 2 +-
addons/map_gestures/stringtable.xml | 9 +++
10 files changed, 72 insertions(+), 29 deletions(-)
diff --git a/addons/map_gestures/ACE_Settings.hpp b/addons/map_gestures/ACE_Settings.hpp
index c7b9a8b2ed..67f258c4cc 100644
--- a/addons/map_gestures/ACE_Settings.hpp
+++ b/addons/map_gestures/ACE_Settings.hpp
@@ -1,50 +1,74 @@
class ACE_Settings {
class GVAR(enabled) {
- value = 1;
- typeName = "BOOL";
displayName = CSTRING(enabled_displayName);
description = CSTRING(enabled_description);
+ category = CSTRING(mapGestures_category);
+ isClientSettable = 0;
+ typeName = "BOOL";
+ value = 1;
};
class GVAR(maxRange) {
- value = 7;
- typeName = "SCALAR";
displayName = CSTRING(maxRange_displayName);
description = CSTRING(maxRange_description);
+ category = CSTRING(mapGestures_category);
+ isClientSettable = 0;
+ typeName = "SCALAR";
+ value = 7;
};
class GVAR(interval) {
- value = 0.03;
- typeName = "SCALAR";
displayName = CSTRING(interval_displayName);
description = CSTRING(interval_description);
+ category = CSTRING(mapGestures_category);
+ isClientSettable = 0;
+ typeName = "SCALAR";
+ value = 0.03;
+ };
+ class GVAR(nameTextColor) {
+ displayName = CSTRING(nameTextColor_displayName);
+ description = CSTRING(nameTextColor_description);
+ category = CSTRING(mapGestures_category);
+ isClientSettable = 1;
+ typeName = "COLOR";
+ value[] = {0.2, 0.2, 0.2, 0.3};
};
class GVAR(defaultLeadColor) {
- value[] = {1, 0.88, 0, 0.95};
- typeName = "COLOR";
displayName = CSTRING(defaultLeadColor_displayName);
description = CSTRING(defaultLeadColor_description);
+ category = CSTRING(mapGestures_category);
+ isClientSettable = 1;
+ typeName = "COLOR";
+ value[] = {1, 0.88, 0, 0.95};
};
class GVAR(defaultColor) {
- value[] = {1, 0.88, 0, 0.7};
- typeName = "COLOR";
displayName = CSTRING(defaultColor_displayName);
description = CSTRING(defaultColor_description);
+ category = CSTRING(mapGestures_category);
+ isClientSettable = 1;
+ typeName = "COLOR";
+ value[] = {1, 0.88, 0, 0.7};
};
class GVAR(GroupColorConfigurations) {
- value[] = {};
- typeName = "ARRAY";
displayName = CSTRING(GroupColorConfigurations_displayName);
description = CSTRING(GroupColorConfigurations_description);
+ category = CSTRING(mapGestures_category);
+ isClientSettable = 0;
+ typeName = "ARRAY";
+ value[] = {};
};
class GVAR(GroupColorConfigurationsGroups) {
- value[] = {};
- typeName = "ARRAY";
displayName = CSTRING(GroupColorConfigurationsGroups_displayName);
description = CSTRING(GroupColorConfigurationsGroups_description);
+ category = CSTRING(mapGestures_category);
+ isClientSettable = 0;
+ typeName = "ARRAY";
+ value[] = {};
};
class GVAR(GroupColorConfigurationsGroupIndex) {
- value[] = {};
- typeName = "ARRAY";
displayName = CSTRING(GroupColorConfigurationsGroupIndex_displayName);
description = CSTRING(GroupColorConfigurationsGroupIndex_description);
+ category = CSTRING(mapGestures_category);
+ isClientSettable = 0;
+ typeName = "ARRAY";
+ value[] = {};
};
};
diff --git a/addons/map_gestures/XEH_serverPostInit.sqf b/addons/map_gestures/XEH_serverPostInit.sqf
index 9bbf84911e..bde1cdc55b 100644
--- a/addons/map_gestures/XEH_serverPostInit.sqf
+++ b/addons/map_gestures/XEH_serverPostInit.sqf
@@ -1,3 +1,3 @@
#include "script_component.hpp"
-[MAP_GESTURES_NO_OWNER_ID_EVENT, FUNC(assignClientIDOnServer)] call EFUNC(common,addEventHandler)
+[EVENT_PLAYER_HAS_NO_OWNER_ID, FUNC(assignClientIDOnServer)] call EFUNC(common,addEventHandler);
diff --git a/addons/map_gestures/functions/fnc_drawMapGestures.sqf b/addons/map_gestures/functions/fnc_drawMapGestures.sqf
index 31c41ca995..2dcf425faf 100644
--- a/addons/map_gestures/functions/fnc_drawMapGestures.sqf
+++ b/addons/map_gestures/functions/fnc_drawMapGestures.sqf
@@ -53,7 +53,7 @@ params ["_mapHandle"];
// Render icon and player name
_mapHandle drawIcon ["\a3\ui_f\data\gui\cfg\Hints\icon_text\group_1_ca.paa", _color, _pos, ICON_RENDER_SIZE, ICON_RENDER_SIZE, ICON_ANGLE, "", ICON_SHADOW, TEXT_SIZE, TEXT_FONT, ICON_TEXT_ALIGN];
- _mapHandle drawIcon ["#(argb,8,8,3)color(0,0,0,0)", [.2,.2,.2,.3], _pos, TEXT_ICON_RENDER_SIZE, TEXT_ICON_RENDER_SIZE, ICON_ANGLE, name _x, TEXT_SHADOW, TEXT_SIZE, TEXT_FONT, ICON_TEXT_ALIGN];
+ _mapHandle drawIcon ["#(argb,8,8,3)color(0,0,0,0)", GVAR(nameTextColor), _pos, TEXT_ICON_RENDER_SIZE, TEXT_ICON_RENDER_SIZE, ICON_ANGLE, name _x, TEXT_SHADOW, TEXT_SIZE, TEXT_FONT, ICON_TEXT_ALIGN];
};
};
nil
diff --git a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf
index 013f076347..8c819bb4d3 100644
--- a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf
+++ b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf
@@ -48,6 +48,6 @@ _completedGroups = [];
nil
} count _units;
-[QGVAR(GroupColorConfigurations), _configurations, true, true] call EFUNC(common,setSetting);
-[QGVAR(GroupColorConfigurationsGroups), _configurationGroups, true, true] call EFUNC(common,setSetting);
-[QGVAR(GroupColorConfigurationsGroupIndex), _configurationGroupsIndex, true, true] call EFUNC(common,setSetting);
+[QGVAR(GroupColorConfigurations), _configurations, false, true] call EFUNC(common,setSetting);
+[QGVAR(GroupColorConfigurationsGroups), _configurationGroups, false, true] call EFUNC(common,setSetting);
+[QGVAR(GroupColorConfigurationsGroupIndex), _configurationGroupsIndex, false, true] call EFUNC(common,setSetting);
diff --git a/addons/map_gestures/functions/fnc_moduleSettings.sqf b/addons/map_gestures/functions/fnc_moduleSettings.sqf
index 6b21db8588..e3e0bf714b 100644
--- a/addons/map_gestures/functions/fnc_moduleSettings.sqf
+++ b/addons/map_gestures/functions/fnc_moduleSettings.sqf
@@ -32,5 +32,5 @@ if (!([_defaultLeadColor] call FUNC(isValidColorArray))) exitWith {ERROR("defaul
_defaultColor = call compile ("[" + (_logic getVariable ["defaultColor", ""]) + "]");
if (!([_defaultColor] call FUNC(isValidColorArray))) exitWith {ERROR("defaultColor is not a valid color array.")};
-[QGVAR(defaultLeadColor), _defaultLeadColor, true, true] call EFUNC(common,setSetting);
-[QGVAR(defaultColor), _defaultColor, true, true] call EFUNC(common,setSetting);
+[QGVAR(defaultLeadColor), _defaultLeadColor, false, true] call EFUNC(common,setSetting);
+[QGVAR(defaultColor), _defaultColor, false, true] call EFUNC(common,setSetting);
diff --git a/addons/map_gestures/functions/fnc_receiverInit.sqf b/addons/map_gestures/functions/fnc_receiverInit.sqf
index a14efbffc1..b132dad1d7 100644
--- a/addons/map_gestures/functions/fnc_receiverInit.sqf
+++ b/addons/map_gestures/functions/fnc_receiverInit.sqf
@@ -19,6 +19,7 @@ ACE_player setVariable [QGVAR(Transmit), false, true];
GVAR(EnableTransmit) = false;
if (!isNil QGVAR(DrawMapHandlerID)) then {
- (findDisplay 12 displayCtrl 51) ctrlRemoveEventHandler ["Draw", GVAR(DrawMapHandlerID)]; GVAR(DrawMapHandlerID) = nil;
+ (findDisplay 12 displayCtrl 51) ctrlRemoveEventHandler ["Draw", GVAR(DrawMapHandlerID)];
+ GVAR(DrawMapHandlerID) = nil;
};
GVAR(DrawMapHandlerID) = findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", FUNC(drawMapGestures)];
diff --git a/addons/map_gestures/functions/fnc_transmit.sqf b/addons/map_gestures/functions/fnc_transmit.sqf
index ccd702fd55..444ebbc604 100644
--- a/addons/map_gestures/functions/fnc_transmit.sqf
+++ b/addons/map_gestures/functions/fnc_transmit.sqf
@@ -31,7 +31,7 @@ if (!GVAR(EnableTransmit) || !visibleMap) exitWith {
{
_ownerID = _x getVariable QGVAR(owner_id);
if (isNil "_ownerID") then {
- [MAP_GESTURES_NO_OWNER_ID_EVENT, [name _x]] call EFUNC(common,serverEvent);
+ [EVENT_PLAYER_HAS_NO_OWNER_ID, [name _x]] call EFUNC(common,serverEvent);
} else {
_playerOwnerID = ACE_player getVariable QGVAR(owner_id);
if (!isNil "_playerOwnerID" && _ownerID != _playerOwnerID) then {
diff --git a/addons/map_gestures/functions/fnc_transmitterInit.sqf b/addons/map_gestures/functions/fnc_transmitterInit.sqf
index 251e6d2619..897855dc00 100644
--- a/addons/map_gestures/functions/fnc_transmitterInit.sqf
+++ b/addons/map_gestures/functions/fnc_transmitterInit.sqf
@@ -22,7 +22,10 @@ disableSerialization;
_mapCtrl = findDisplay 12 displayCtrl 51;
// MouseMoving EH.
-if (!isNil QGVAR(MouseMoveHandlerID)) then {_mapCtrl ctrlRemoveEventHandler ["MouseMoving", GVAR(MouseMoveHandlerID)]; GVAR(MouseMoveHandlerID) = nil;};
+if (!isNil QGVAR(MouseMoveHandlerID)) then {
+ _mapCtrl ctrlRemoveEventHandler ["MouseMoving", GVAR(MouseMoveHandlerID)];
+ GVAR(MouseMoveHandlerID) = nil;
+};
GVAR(MouseMoveHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseMoving", {
// Don't transmit any data if we're using the map tools
if (!GVAR(EnableTransmit) || EGVAR(maptools,drawing_isDrawing) || EGVAR(maptools,mapTool_isDragging) || EGVAR(maptools,mapTool_isRotating)) exitWith {};
@@ -41,7 +44,10 @@ GVAR(MouseMoveHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseMoving", {
}];
// MouseDown EH
-if (!isNil QGVAR(MouseDownHandlerID)) then {_mapCtrl ctrlRemoveEventHandler ["MouseButtonDown",GVAR(MouseDownHandlerID)]; GVAR(MouseDownHandlerID) = nil;};
+if (!isNil QGVAR(MouseDownHandlerID)) then {
+ _mapCtrl ctrlRemoveEventHandler ["MouseButtonDown",GVAR(MouseDownHandlerID)];
+ GVAR(MouseDownHandlerID) = nil;
+};
GVAR(MouseDownHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseButtonDown", {
if (!GVAR(enabled)) exitWith {};
@@ -51,7 +57,10 @@ GVAR(MouseDownHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseButtonDown", {
}];
// MouseUp EH
-if (!isNil QGVAR(MouseUpHandlerID)) then {_mapCtrl ctrlRemoveEventHandler ["MouseButtonUp", GVAR(MouseUpHandlerID)]; GVAR(MouseUpHandlerID) = nil;};
+if (!isNil QGVAR(MouseUpHandlerID)) then {
+ _mapCtrl ctrlRemoveEventHandler ["MouseButtonUp", GVAR(MouseUpHandlerID)];
+ GVAR(MouseUpHandlerID) = nil;
+};
GVAR(MouseUpHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseButtonUp", {
if (!GVAR(enabled)) exitWith {};
diff --git a/addons/map_gestures/script_component.hpp b/addons/map_gestures/script_component.hpp
index 50f155ccc1..1a5ecada12 100644
--- a/addons/map_gestures/script_component.hpp
+++ b/addons/map_gestures/script_component.hpp
@@ -11,4 +11,4 @@
#include "\z\ace\addons\main\script_macros.hpp"
-#define MAP_GESTURES_NO_OWNER_ID_EVENT "PlayerNameHasNoOwnerID"
+#define EVENT_PLAYER_HAS_NO_OWNER_ID "PlayerNameHasNoOwnerID"
diff --git a/addons/map_gestures/stringtable.xml b/addons/map_gestures/stringtable.xml
index 324e9f92e7..78e4378b73 100644
--- a/addons/map_gestures/stringtable.xml
+++ b/addons/map_gestures/stringtable.xml
@@ -91,5 +91,14 @@
Enables the Map Gestures.
+
+ Name Text Color
+
+
+ Color of the name tag text besides the map gestures mark.
+
+
+ Map Gestures
+
From 2b0ef7bc6d9831d3dbe626658ad39a9f5e72abda Mon Sep 17 00:00:00 2001
From: Michael Braun
Date: Mon, 24 Aug 2015 22:10:02 +0200
Subject: [PATCH 21/54] Removed explicitly stated `isClientSettable` in Map
Gestures ace settings
---
addons/map_gestures/ACE_Settings.hpp | 6 ------
1 file changed, 6 deletions(-)
diff --git a/addons/map_gestures/ACE_Settings.hpp b/addons/map_gestures/ACE_Settings.hpp
index 67f258c4cc..1b223d0d67 100644
--- a/addons/map_gestures/ACE_Settings.hpp
+++ b/addons/map_gestures/ACE_Settings.hpp
@@ -3,7 +3,6 @@ class ACE_Settings {
displayName = CSTRING(enabled_displayName);
description = CSTRING(enabled_description);
category = CSTRING(mapGestures_category);
- isClientSettable = 0;
typeName = "BOOL";
value = 1;
};
@@ -11,7 +10,6 @@ class ACE_Settings {
displayName = CSTRING(maxRange_displayName);
description = CSTRING(maxRange_description);
category = CSTRING(mapGestures_category);
- isClientSettable = 0;
typeName = "SCALAR";
value = 7;
};
@@ -19,7 +17,6 @@ class ACE_Settings {
displayName = CSTRING(interval_displayName);
description = CSTRING(interval_description);
category = CSTRING(mapGestures_category);
- isClientSettable = 0;
typeName = "SCALAR";
value = 0.03;
};
@@ -51,7 +48,6 @@ class ACE_Settings {
displayName = CSTRING(GroupColorConfigurations_displayName);
description = CSTRING(GroupColorConfigurations_description);
category = CSTRING(mapGestures_category);
- isClientSettable = 0;
typeName = "ARRAY";
value[] = {};
};
@@ -59,7 +55,6 @@ class ACE_Settings {
displayName = CSTRING(GroupColorConfigurationsGroups_displayName);
description = CSTRING(GroupColorConfigurationsGroups_description);
category = CSTRING(mapGestures_category);
- isClientSettable = 0;
typeName = "ARRAY";
value[] = {};
};
@@ -67,7 +62,6 @@ class ACE_Settings {
displayName = CSTRING(GroupColorConfigurationsGroupIndex_displayName);
description = CSTRING(GroupColorConfigurationsGroupIndex_description);
category = CSTRING(mapGestures_category);
- isClientSettable = 0;
typeName = "ARRAY";
value[] = {};
};
From 93acdbcb4d8802d52730bb43b7f149d88443d100 Mon Sep 17 00:00:00 2001
From: Michael Braun
Date: Mon, 24 Aug 2015 22:45:59 +0200
Subject: [PATCH 22/54] Replaced custom mapping implementation with ACE Hash
---
addons/map_gestures/ACE_Settings.hpp | 15 ++++-----------
.../functions/fnc_drawMapGestures.sqf | 5 ++---
.../functions/fnc_moduleGroupSettings.sqf | 16 +++-------------
addons/map_gestures/stringtable.xml | 14 ++++----------
4 files changed, 13 insertions(+), 37 deletions(-)
diff --git a/addons/map_gestures/ACE_Settings.hpp b/addons/map_gestures/ACE_Settings.hpp
index 1b223d0d67..0038027e3b 100644
--- a/addons/map_gestures/ACE_Settings.hpp
+++ b/addons/map_gestures/ACE_Settings.hpp
@@ -51,18 +51,11 @@ class ACE_Settings {
typeName = "ARRAY";
value[] = {};
};
- class GVAR(GroupColorConfigurationsGroups) {
- displayName = CSTRING(GroupColorConfigurationsGroups_displayName);
- description = CSTRING(GroupColorConfigurationsGroups_description);
+ class GVAR(GroupColorConfigurationMapping) {
+ displayName = CSTRING(GroupColorConfigurationMapping_displayName);
+ description = CSTRING(GroupColorConfigurationMapping_description);
category = CSTRING(mapGestures_category);
typeName = "ARRAY";
- value[] = {};
- };
- class GVAR(GroupColorConfigurationsGroupIndex) {
- displayName = CSTRING(GroupColorConfigurationsGroupIndex_displayName);
- description = CSTRING(GroupColorConfigurationsGroupIndex_description);
- category = CSTRING(mapGestures_category);
- typeName = "ARRAY";
- value[] = {};
+ value[] = {{}, {}};
};
};
diff --git a/addons/map_gestures/functions/fnc_drawMapGestures.sqf b/addons/map_gestures/functions/fnc_drawMapGestures.sqf
index 2dcf425faf..4ba70f1b30 100644
--- a/addons/map_gestures/functions/fnc_drawMapGestures.sqf
+++ b/addons/map_gestures/functions/fnc_drawMapGestures.sqf
@@ -44,9 +44,8 @@ params ["_mapHandle"];
_grpName = groupID _group;
// If color settings for the group exist, then use those, otherwise fall back to the default colors
- _color = if (_grpName in GVAR(GroupColorConfigurationsGroups)) then {
- _grpNameIndex = GVAR(GroupColorConfigurationsGroups) find _grpName;
- (GVAR(GroupColorConfigurations) select (GVAR(GroupColorConfigurationsGroupIndex) select _grpNameIndex)) select (_x != leader _group)
+ _color = if (HASH_HASKEY(GVAR(GroupColorConfigurationMapping),_grpName)) then {
+ (GVAR(GroupColorConfigurations) select (HASH_GET(GVAR(GroupColorConfigurationMapping),_grpName))) select (_x != leader _group)
} else {
if (_x == leader _group) then {GVAR(defaultLeadColor)} else {GVAR(defaultColor)};
};
diff --git a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf
index 8c819bb4d3..ac01516618 100644
--- a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf
+++ b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf
@@ -29,25 +29,15 @@ if (!([_color] call FUNC(isValidColorArray))) exitWith {ERROR("color is not a va
// If we already have color configurations from another source, use those, otherwise use default.
_configurations = if (isNil QGVAR(GroupColorConfigurations)) then { [] } else { +GVAR(GroupColorConfigurations) };
-_configurationGroups = if (isNil QGVAR(GroupColorConfigurationsGroups)) then { [] } else { +GVAR(GroupColorConfigurationsGroups) };
-_configurationGroupsIndex = if (isNil QGVAR(GroupColorConfigurationsGroupIndex)) then { [] } else { +GVAR(GroupColorConfigurationsGroupIndex) };
+_configurationGroupMappings = if(isNil QGVAR(GroupColorConfigurationMapping)) then { HASH_CREATE } else { +GVAR(GroupColorConfigurationMapping) };
// Save custom color configuration and keep the index of the entry.
_configurationIndex = _configurations pushBack [_leadColor, _color];
// Add all synchronized groups and reference custom configuration for them
-_completedGroups = [];
{
- private "_group";
- _group = groupID (group _x);
- if (!(_group in _completedGroups)) then {
- _index = if (_group in _configurationGroups) then {_configurationGroups find _group} else {_configurationGroups pushBack _group};
- _configurationGroupsIndex set [_index, _configurationIndex];
- _completedGroups pushBack _group;
- };
- nil
+ HASH_SET(_configurationGroupMappings,groupID (group _x),_configurationIndex);
} count _units;
[QGVAR(GroupColorConfigurations), _configurations, false, true] call EFUNC(common,setSetting);
-[QGVAR(GroupColorConfigurationsGroups), _configurationGroups, false, true] call EFUNC(common,setSetting);
-[QGVAR(GroupColorConfigurationsGroupIndex), _configurationGroupsIndex, false, true] call EFUNC(common,setSetting);
+[QGVAR(GroupColorConfigurationMapping), _configurationGroupMappings, false, true] call EFUNC(common,setSetting);
diff --git a/addons/map_gestures/stringtable.xml b/addons/map_gestures/stringtable.xml
index 78e4378b73..e5eab426a3 100644
--- a/addons/map_gestures/stringtable.xml
+++ b/addons/map_gestures/stringtable.xml
@@ -76,17 +76,11 @@
Group color configuration containing arrays of color pairs ([leadColor, color]).
-
- Group color group name index, containing names of groups with configurations attached to them.
+
+ Hash of Group ID mapped to the Group color configuration index.
-
- Group color group name index
-
-
- Group color group name mapping index
-
-
- Group color group name mapping index, mapping the GroupColorConfigurationsGroups to the GroupColorConfigurations.
+
+ GroupID Color configuration mapping
Enables the Map Gestures.
From 431bd309a85c0d0c837d797ee9eb9211ed8e3295 Mon Sep 17 00:00:00 2001
From: Michael Braun
Date: Mon, 24 Aug 2015 23:26:03 +0200
Subject: [PATCH 23/54] Fixed variable privatization
---
addons/map_gestures/functions/fnc_drawMapGestures.sqf | 2 ++
addons/map_gestures/functions/fnc_getProximityPlayers.sqf | 2 ++
addons/map_gestures/functions/fnc_moduleGroupSettings.sqf | 2 ++
addons/map_gestures/functions/fnc_moduleSettings.sqf | 7 ++++---
addons/map_gestures/functions/fnc_transmit.sqf | 2 +-
5 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/addons/map_gestures/functions/fnc_drawMapGestures.sqf b/addons/map_gestures/functions/fnc_drawMapGestures.sqf
index 4ba70f1b30..b369686501 100644
--- a/addons/map_gestures/functions/fnc_drawMapGestures.sqf
+++ b/addons/map_gestures/functions/fnc_drawMapGestures.sqf
@@ -26,6 +26,8 @@
if (!GVAR(enabled) || !visibleMap) exitWith {};
+private["_color", "_drawPosVariableName", "_group", "_grpName", "_pos", "_unitUID"];
+
params ["_mapHandle"];
// Iterate over all nearby players and render their pointer if player is transmitting.
diff --git a/addons/map_gestures/functions/fnc_getProximityPlayers.sqf b/addons/map_gestures/functions/fnc_getProximityPlayers.sqf
index 7a72c00520..dded0b1273 100644
--- a/addons/map_gestures/functions/fnc_getProximityPlayers.sqf
+++ b/addons/map_gestures/functions/fnc_getProximityPlayers.sqf
@@ -16,6 +16,8 @@
*/
#include "script_component.hpp"
+private "_proximityPlayers";
+
params ["_unit", "_range"];
_proximityPlayers = (getPos _unit) nearEntities [["CAMAnBase"], _range];
diff --git a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf
index ac01516618..9c21bf867d 100644
--- a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf
+++ b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf
@@ -17,6 +17,8 @@
*/
#include "script_component.hpp"
+private ["_color", "_configurationGroupMappings", "_configurationIndex", "_configurations", "_leadColor"];
+
params ["_logic", "_units", "_activated"];
if (!_activated || !isServer) exitWith {};
diff --git a/addons/map_gestures/functions/fnc_moduleSettings.sqf b/addons/map_gestures/functions/fnc_moduleSettings.sqf
index e3e0bf714b..99583074fc 100644
--- a/addons/map_gestures/functions/fnc_moduleSettings.sqf
+++ b/addons/map_gestures/functions/fnc_moduleSettings.sqf
@@ -17,10 +17,11 @@
*/
#include "script_component.hpp"
-params ["_logic", "_units", "_activated"];
+private ["_defaultColor", "_defaultLeadColor"];
-if (!_activated) exitWith {};
-if (!isServer) exitWith {};
+params ["_logic", "", "_activated"];
+
+if (!_activated || !isServer) exitWith {};
[_logic, QGVAR(enabled), "enabled"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(maxRange), "maxRange"] call EFUNC(common,readSettingFromModule);
diff --git a/addons/map_gestures/functions/fnc_transmit.sqf b/addons/map_gestures/functions/fnc_transmit.sqf
index 444ebbc604..c9dc487db2 100644
--- a/addons/map_gestures/functions/fnc_transmit.sqf
+++ b/addons/map_gestures/functions/fnc_transmit.sqf
@@ -16,7 +16,7 @@
*/
#include "script_component.hpp"
-private ["_proximityPlayers", "_ownerID", "_unitUID", "_drawPosVariableName"];
+private ["_ownerID", "_unitUID", "_drawPosVariableName", "_playerOwnerID"];
params ["", "_pfhId"];
From a83a5a17a3862f65966ef7dc633fb01d070cd799 Mon Sep 17 00:00:00 2001
From: jokoho48
Date: Fri, 28 Aug 2015 13:15:21 +0200
Subject: [PATCH 24/54] Fix Issues
---
addons/kestrel4500/XEH_preInit.sqf | 2 +-
addons/kestrel4500/functions/fnc_dayOfWeek.sqf | 1 +
addons/kestrel4500/functions/fnc_displayKestrel.sqf | 2 +-
addons/kestrel4500/functions/fnc_updateMemory.sqf | 1 +
addons/kestrel4500/script_component.hpp | 2 ++
5 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/addons/kestrel4500/XEH_preInit.sqf b/addons/kestrel4500/XEH_preInit.sqf
index b89f07173f..b3f8ba755f 100644
--- a/addons/kestrel4500/XEH_preInit.sqf
+++ b/addons/kestrel4500/XEH_preInit.sqf
@@ -16,5 +16,5 @@ PREP(storeUserData);
PREP(updateDisplay);
PREP(updateImpellerState);
PREP(updateMemory);
-PREP(dayOfWeek)
+PREP(dayOfWeek);
ADDON = true;
diff --git a/addons/kestrel4500/functions/fnc_dayOfWeek.sqf b/addons/kestrel4500/functions/fnc_dayOfWeek.sqf
index 9e142f661c..f63a3969b0 100644
--- a/addons/kestrel4500/functions/fnc_dayOfWeek.sqf
+++ b/addons/kestrel4500/functions/fnc_dayOfWeek.sqf
@@ -15,6 +15,7 @@
*
* Public: No
*/
+#include "script_component.hpp"
private "_table";
params ["_year", "_month", "_day"];
diff --git a/addons/kestrel4500/functions/fnc_displayKestrel.sqf b/addons/kestrel4500/functions/fnc_displayKestrel.sqf
index 770347ec71..64d06fea1c 100644
--- a/addons/kestrel4500/functions/fnc_displayKestrel.sqf
+++ b/addons/kestrel4500/functions/fnc_displayKestrel.sqf
@@ -102,7 +102,7 @@ GVAR(Overlay) = true;
__ctrlInfoLine1 ctrlSetText _ctrlInfoLine1;
__ctrlInfoLine2 ctrlSetText _ctrlInfoLine2;
- __ctrlBottomBig ctrlSetText _ctrlBottomBig ;
+ __ctrlBottomBig ctrlSetText _ctrlBottomBig;
__ctrlCenterLine1 ctrlSetText _ctrlCenterLine1;
__ctrlCenterLine2 ctrlSetText _ctrlCenterLine2;
diff --git a/addons/kestrel4500/functions/fnc_updateMemory.sqf b/addons/kestrel4500/functions/fnc_updateMemory.sqf
index f38e9ee6df..c393aee14f 100644
--- a/addons/kestrel4500/functions/fnc_updateMemory.sqf
+++ b/addons/kestrel4500/functions/fnc_updateMemory.sqf
@@ -14,6 +14,7 @@
*
* Public: No
*/
+#include "script_component.hpp"
params ["_slot", "_value"];
GVAR(MIN) set [_slot, (GVAR(MIN) select _slot) min _value];
GVAR(MAX) set [_slot, _value max (GVAR(MAX) select _slot)];
diff --git a/addons/kestrel4500/script_component.hpp b/addons/kestrel4500/script_component.hpp
index 90c338ebeb..e1a58dc1df 100644
--- a/addons/kestrel4500/script_component.hpp
+++ b/addons/kestrel4500/script_component.hpp
@@ -1,6 +1,8 @@
#define COMPONENT kestrel4500
#include "\z\ace\addons\main\script_mod.hpp"
+#define DEBUG_ENABLED_KESTREL4500
+
#ifdef DEBUG_ENABLED_KESTREL4500
#define DEBUG_MODE_FULL
#endif
From 1f602ea9a3c8a0e664b6cd4a56111d145c0a1b51 Mon Sep 17 00:00:00 2001
From: jokoho48
Date: Fri, 28 Aug 2015 13:17:29 +0200
Subject: [PATCH 25/54] disable Debug
---
addons/kestrel4500/script_component.hpp | 2 --
1 file changed, 2 deletions(-)
diff --git a/addons/kestrel4500/script_component.hpp b/addons/kestrel4500/script_component.hpp
index e1a58dc1df..90c338ebeb 100644
--- a/addons/kestrel4500/script_component.hpp
+++ b/addons/kestrel4500/script_component.hpp
@@ -1,8 +1,6 @@
#define COMPONENT kestrel4500
#include "\z\ace\addons\main\script_mod.hpp"
-#define DEBUG_ENABLED_KESTREL4500
-
#ifdef DEBUG_ENABLED_KESTREL4500
#define DEBUG_MODE_FULL
#endif
From f22072a94da4270519be4bff55c13a655cd29f4f Mon Sep 17 00:00:00 2001
From: jonpas
Date: Sat, 5 Sep 2015 19:57:35 +0200
Subject: [PATCH 26/54] Use pushBack instead of array compiling
---
addons/common/functions/fnc_parseList.sqf | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/addons/common/functions/fnc_parseList.sqf b/addons/common/functions/fnc_parseList.sqf
index 8cce3c1837..22595201fc 100644
--- a/addons/common/functions/fnc_parseList.sqf
+++ b/addons/common/functions/fnc_parseList.sqf
@@ -39,20 +39,15 @@ _list = _whitespaceList;
// Check for object existence
-_nilCheckedList = "";
+_nilCheckedList = [];
if (_checkNil) then {
{
if !(isNil _x) then {
- if (_nilCheckedList == "") then {
- _nilCheckedList = _x;
- } else {
- _nilCheckedList = _nilCheckedList + "," + _x;
- };
+ _nilCheckedList pushBack _x;
};
} count _list;
- // Add Array characters and parse into array
- _list = [] call compile format ["[%1]", _nilCheckedList];
+ _list = _nilCheckedList;
};
TRACE_4("Lists",_splittedList,_whitespaceList,_nilCheckedList,_list);
From a2dd77ca702bce3542ffd2985b3e2d4defeb48c6 Mon Sep 17 00:00:00 2001
From: jonpas
Date: Sat, 5 Sep 2015 20:15:31 +0200
Subject: [PATCH 27/54] Use splitString instead of BIS_fnc_splitString
---
addons/common/functions/fnc_parseList.sqf | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/addons/common/functions/fnc_parseList.sqf b/addons/common/functions/fnc_parseList.sqf
index 22595201fc..dcdf255081 100644
--- a/addons/common/functions/fnc_parseList.sqf
+++ b/addons/common/functions/fnc_parseList.sqf
@@ -1,5 +1,5 @@
/*
- * Author: Jonpas
+ * Author: Glowbal, Jonpas
* Makes a list from a string using comma as a delimiter, optionally trim or remove whitespace and check each for object existence.
*
* Arguments:
@@ -17,12 +17,13 @@
*/
#include "script_component.hpp"
-private ["_splittedList", "_whitespaceList", "_nilCheckedList"];
params ["_list", ["_removeWhitespace", false], ["_checkNil", false]];
+private ["_whitespaceList", "_nilCheckedList"];
// Split using comma delimiter
-_splittedList = [_list, ","] call BIS_fnc_splitString;
+_list = _list splitString ",";
+TRACE_1("Splitted List",_list);
// Remove or Trim Whitespace
@@ -34,22 +35,25 @@ _whitespaceList = [];
_whitespaceList pushBack ([_x] call CBA_fnc_trim);
};
nil
-} count _splittedList;
+} count _list;
+
_list = _whitespaceList;
+TRACE_1("Whitespace List",_list);
// Check for object existence
-_nilCheckedList = [];
if (_checkNil) then {
+ _nilCheckedList = [];
{
if !(isNil _x) then {
_nilCheckedList pushBack _x;
};
+ nil
} count _list;
_list = _nilCheckedList;
};
-TRACE_4("Lists",_splittedList,_whitespaceList,_nilCheckedList,_list);
+TRACE_1("Final List",_list);
_list
From 06baa5e4d362dc223cc18f30816b620ec7031a60 Mon Sep 17 00:00:00 2001
From: jonpas
Date: Sat, 5 Sep 2015 20:51:48 +0200
Subject: [PATCH 28/54] Fixed nilCheck, changed moduleAddSpareParts to use new
parseList
---
addons/common/functions/fnc_parseList.sqf | 2 +-
.../functions/fnc_moduleAddSpareParts.sqf | 34 +++++--------------
2 files changed, 10 insertions(+), 26 deletions(-)
diff --git a/addons/common/functions/fnc_parseList.sqf b/addons/common/functions/fnc_parseList.sqf
index dcdf255081..ef7eaae92a 100644
--- a/addons/common/functions/fnc_parseList.sqf
+++ b/addons/common/functions/fnc_parseList.sqf
@@ -46,7 +46,7 @@ if (_checkNil) then {
_nilCheckedList = [];
{
if !(isNil _x) then {
- _nilCheckedList pushBack _x;
+ _nilCheckedList pushBack (missionNamespace getVariable _x);
};
nil
} count _list;
diff --git a/addons/repair/functions/fnc_moduleAddSpareParts.sqf b/addons/repair/functions/fnc_moduleAddSpareParts.sqf
index 46689951a7..cceb62e10c 100644
--- a/addons/repair/functions/fnc_moduleAddSpareParts.sqf
+++ b/addons/repair/functions/fnc_moduleAddSpareParts.sqf
@@ -11,51 +11,35 @@
* None
*
* Example:
- * function = "ace_repair_fnc_moduleAssignRepairVehicle"
+ * function = "ace_repair_fnc_moduleAddSpareParts"
*
* Public: No
*/
-#define DEBUG_MODE_FULL
#include "script_component.hpp"
params ["_logic"];
if (!isNull _logic) then {
- private ["_list", "_part", "_amount", "_nilCheckPassedList"];
- // Module settings
+ private ["_list", "_part", "_amount"];
_list = _logic getVariable ["List", ""];
_part = _logic getVariable ["Part", 0];
_amount = _logic getVariable ["Amount", 1];
// Parse list
- _nilCheckPassedList = "";
- {
- _x = [_x] call EFUNC(common,stringRemoveWhiteSpace);
- if !(isnil _x) then {
- if (_nilCheckPassedList == "") then {
- _nilCheckPassedList = _x;
- } else {
- _nilCheckPassedList = _nilCheckPassedList + "," + _x;
- };
- };
- } forEach ([_list, ","] call BIS_fnc_splitString);
- _list = "[" + _nilCheckPassedList + "]";
- _list = [] call compile _list;
+ _list = [_list, true, true] call EFUNC(common,parseList);
// Add synchronized objects to list
{
_list pushBack _x;
- } forEach (synchronizedObjects _logic);
+ nil
+ } count (synchronizedObjects _logic);
if (_list isEqualTo []) exitWith {};
- TRACE_3("module info parsed",_list,_part,_amount);
+ TRACE_3("Module info parsed",_list,_part,_amount);
+
// Add spare parts
{
- if (!isNil "_x" && {typeName _x == typeName objNull}) then {
- [_x, _amount, _part, true] call FUNC(addSpareParts);
- };
- } forEach _list;
+ [_x, _amount, _part, true] call FUNC(addSpareParts);
+ } count _list;
};
-
-true
From 22ac16ead51c390d064ce4f7310e96a024c0247a Mon Sep 17 00:00:00 2001
From: Alessandro Foresi
Date: Sat, 19 Sep 2015 16:22:36 +0200
Subject: [PATCH 29/54] Changed: Seeker to aimPoint instead of ASL position
---
addons/missileguidance/functions/fnc_seekerType_Optic.sqf | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/addons/missileguidance/functions/fnc_seekerType_Optic.sqf b/addons/missileguidance/functions/fnc_seekerType_Optic.sqf
index 872f33a917..1cc71c1d94 100644
--- a/addons/missileguidance/functions/fnc_seekerType_Optic.sqf
+++ b/addons/missileguidance/functions/fnc_seekerType_Optic.sqf
@@ -17,7 +17,7 @@ TRACE_1("", _launchParams);
// TODO:: Make sure the missile maintains LOS
_foundTargetPos = [0,0,0];
if(!isNil "_target") then {
- _foundTargetPos = getPosASL _target;
+ _foundTargetPos = aimPos _target ;
//_foundTargetPos = (_target modelToWorldVisual (getCenterOfMass _target));
};
@@ -48,4 +48,4 @@ if(!_angleOkay || !_losOkay) then {
};
-_foundTargetPos;
\ No newline at end of file
+_foundTargetPos;
From e3985dce3eb95ea7674b9a5e1fe18d2b939cae94 Mon Sep 17 00:00:00 2001
From: jonpas
Date: Sun, 27 Sep 2015 00:40:59 +0200
Subject: [PATCH 30/54] Cleanup sitRotation as it's no longer needed
---
addons/sitting/CfgVehicles.hpp | 6 ------
addons/sitting/functions/fnc_sit.sqf | 3 +--
2 files changed, 1 insertion(+), 8 deletions(-)
diff --git a/addons/sitting/CfgVehicles.hpp b/addons/sitting/CfgVehicles.hpp
index a156d5e87e..7b0237d172 100644
--- a/addons/sitting/CfgVehicles.hpp
+++ b/addons/sitting/CfgVehicles.hpp
@@ -60,7 +60,6 @@ class CfgVehicles {
GVAR(canSit) = 1;
GVAR(sitDirection) = 180;
GVAR(sitPosition[]) = {0, -0.1, -0.45};
- GVAR(sitRotation) = 10;
};
// Camping Chair
class Land_CampingChair_V2_F: ThingX {
@@ -69,7 +68,6 @@ class CfgVehicles {
GVAR(canSit) = 1;
GVAR(sitDirection) = 180;
GVAR(sitPosition[]) = {0, -0.1, -0.45};
- GVAR(sitRotation) = 45;
};
class Furniture_base_F;
@@ -80,7 +78,6 @@ class CfgVehicles {
GVAR(canSit) = 1;
GVAR(sitDirection) = 90;
GVAR(sitPosition[]) = {0, 0, -0.5};
- GVAR(sitRotation) = 5;
};
// Chair (Wooden)
class Land_ChairWood_F: Furniture_base_F {
@@ -89,7 +86,6 @@ class CfgVehicles {
GVAR(canSit) = 1;
GVAR(sitDirection) = 180;
GVAR(sitPosition[]) = {0, -0.05, 0};
- GVAR(sitRotation) = 75;
};
// Office Chair
class Land_OfficeChair_01_F: Furniture_base_F {
@@ -98,7 +94,6 @@ class CfgVehicles {
GVAR(canSit) = 1;
GVAR(sitDirection) = 180;
GVAR(sitPosition[]) = {0, 0, -0.6};
- GVAR(sitRotation) = 15;
};
// Rattan Chair
class Land_RattanChair_01_F: Furniture_base_F {
@@ -107,6 +102,5 @@ class CfgVehicles {
GVAR(canSit) = 1;
GVAR(sitDirection) = 180;
GVAR(sitPosition[]) = {0, -0.1, -1}; // Z must be -1 due to chair's geometry (magic floating seat point)
- GVAR(sitRotation) = 2;
};
};
diff --git a/addons/sitting/functions/fnc_sit.sqf b/addons/sitting/functions/fnc_sit.sqf
index 5e9c36947e..e77e2d2b13 100644
--- a/addons/sitting/functions/fnc_sit.sqf
+++ b/addons/sitting/functions/fnc_sit.sqf
@@ -16,7 +16,7 @@
*/
#include "script_component.hpp"
-private ["_actionID", "_configFile", "_sitDirection", "_sitPosition", "_sitRotation", "_seatPosOrig"];
+private ["_actionID", "_configFile", "_sitDirection", "_sitPosition", "_seatPosOrig"];
params ["_seat", "_player"];
@@ -50,7 +50,6 @@ _player setVariable [QGVAR(StandUpActionID), _actionID];
_configFile = configFile >> "CfgVehicles" >> typeOf _seat;
_sitDirection = (getDir _seat) + getNumber (_configFile >> QGVAR(sitDirection));
_sitPosition = getArray (_configFile >> QGVAR(sitPosition));
-_sitRotation = if (isNumber (_configFile >> QGVAR(sitRotation))) then {getNumber (_configFile >> QGVAR(sitRotation))} else {45}; // Apply default if config entry not present
// Get random animation and perform it (before moving player to ensure correct placement)
[_player, call FUNC(getRandomAnimation), 2] call EFUNC(common,doAnimation); // Correctly places when using non-transitional animations
From a7a716ca8d730ad407625c3447b15a7d255c9766 Mon Sep 17 00:00:00 2001
From: jonpas
Date: Sun, 27 Sep 2015 01:20:40 +0200
Subject: [PATCH 31/54] Better sitting framework in terms of interactions
---
addons/sitting/CfgEventHandlers.hpp | 8 ++++
addons/sitting/CfgVehicles.hpp | 24 -----------
addons/sitting/XEH_preInit.sqf | 3 ++
.../sitting/functions/fnc_addSitActions.sqf | 42 +++++++++++++++++++
addons/sitting/functions/fnc_canSit.sqf | 6 +--
addons/sitting/functions/fnc_sit.sqf | 2 +-
6 files changed, 56 insertions(+), 29 deletions(-)
create mode 100644 addons/sitting/functions/fnc_addSitActions.sqf
diff --git a/addons/sitting/CfgEventHandlers.hpp b/addons/sitting/CfgEventHandlers.hpp
index 1e804e8cc9..bd13e623f0 100644
--- a/addons/sitting/CfgEventHandlers.hpp
+++ b/addons/sitting/CfgEventHandlers.hpp
@@ -17,3 +17,11 @@ class Extended_Killed_EventHandlers {
};
};
};
+
+class Extended_InitPost_EventHandlers {
+ class All {
+ class ADDON {
+ init = QUOTE(_this call DFUNC(addSitActions))
+ };
+ };
+};
diff --git a/addons/sitting/CfgVehicles.hpp b/addons/sitting/CfgVehicles.hpp
index 7b0237d172..0d41ba1ed6 100644
--- a/addons/sitting/CfgVehicles.hpp
+++ b/addons/sitting/CfgVehicles.hpp
@@ -34,29 +34,10 @@ class CfgVehicles {
};
};
- #define MACRO_SEAT_ACTION \
- class ACE_Actions { \
- class ACE_MainActions { \
- displayName = ECSTRING(interaction,MainAction); \
- selection = ""; \
- distance = 1.5; \
- condition = "true"; \
- class GVAR(Sit) { \
- displayName = CSTRING(Sit); \
- condition = QUOTE(_this call FUNC(canSit)); \
- statement = QUOTE(_this call FUNC(sit)); \
- showDisabled = 0; \
- priority = 0; \
- icon = PATHTOF(UI\sit_ca.paa); \
- }; \
- }; \
- };
-
class ThingX;
// Folding Chair
class Land_CampingChair_V1_F: ThingX {
XEH_ENABLED;
- MACRO_SEAT_ACTION
GVAR(canSit) = 1;
GVAR(sitDirection) = 180;
GVAR(sitPosition[]) = {0, -0.1, -0.45};
@@ -64,7 +45,6 @@ class CfgVehicles {
// Camping Chair
class Land_CampingChair_V2_F: ThingX {
XEH_ENABLED;
- MACRO_SEAT_ACTION
GVAR(canSit) = 1;
GVAR(sitDirection) = 180;
GVAR(sitPosition[]) = {0, -0.1, -0.45};
@@ -74,7 +54,6 @@ class CfgVehicles {
// Chair (Plastic)
class Land_ChairPlastic_F: Furniture_base_F {
XEH_ENABLED;
- MACRO_SEAT_ACTION
GVAR(canSit) = 1;
GVAR(sitDirection) = 90;
GVAR(sitPosition[]) = {0, 0, -0.5};
@@ -82,7 +61,6 @@ class CfgVehicles {
// Chair (Wooden)
class Land_ChairWood_F: Furniture_base_F {
XEH_ENABLED;
- MACRO_SEAT_ACTION
GVAR(canSit) = 1;
GVAR(sitDirection) = 180;
GVAR(sitPosition[]) = {0, -0.05, 0};
@@ -90,7 +68,6 @@ class CfgVehicles {
// Office Chair
class Land_OfficeChair_01_F: Furniture_base_F {
XEH_ENABLED;
- MACRO_SEAT_ACTION
GVAR(canSit) = 1;
GVAR(sitDirection) = 180;
GVAR(sitPosition[]) = {0, 0, -0.6};
@@ -98,7 +75,6 @@ class CfgVehicles {
// Rattan Chair
class Land_RattanChair_01_F: Furniture_base_F {
XEH_ENABLED;
- MACRO_SEAT_ACTION
GVAR(canSit) = 1;
GVAR(sitDirection) = 180;
GVAR(sitPosition[]) = {0, -0.1, -1}; // Z must be -1 due to chair's geometry (magic floating seat point)
diff --git a/addons/sitting/XEH_preInit.sqf b/addons/sitting/XEH_preInit.sqf
index 86912ada6b..15ffe281c8 100644
--- a/addons/sitting/XEH_preInit.sqf
+++ b/addons/sitting/XEH_preInit.sqf
@@ -2,6 +2,7 @@
ADDON = false;
+PREP(addSitActions);
PREP(canSit);
PREP(canStand);
PREP(getRandomAnimation);
@@ -10,4 +11,6 @@ PREP(moduleInit);
PREP(sit);
PREP(stand);
+GVAR(initializedClasses) = [];
+
ADDON = true;
diff --git a/addons/sitting/functions/fnc_addSitActions.sqf b/addons/sitting/functions/fnc_addSitActions.sqf
new file mode 100644
index 0000000000..18779d9229
--- /dev/null
+++ b/addons/sitting/functions/fnc_addSitActions.sqf
@@ -0,0 +1,42 @@
+/*
+ * Author: Jonpas
+ * Adds sit actions.
+ *
+ * Arguments:
+ * 0: Seat
+ *
+ * Return Value:
+ * None
+ *
+ * Example:
+ * [seat] call ace_sitting_fnc_addSitActions
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+params ["_seat"];
+private ["_type", "_sitAction"];
+
+_type = typeOf _seat;
+
+// Exit if the object is not specified as a seat
+if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(canSit)) != 1) exitWith {};
+
+// Exit if class already initialized
+if (_type in GVAR(initializedClasses)) exitWith {};
+
+GVAR(initializedClasses) pushBack _type;
+
+_sitAction = [
+ QGVAR(Sit),
+ localize LSTRING(Sit),
+ QUOTE(PATHTOF(UI\sit_ca.paa)),
+ {_this call FUNC(sit)},
+ {_this call FUNC(canSit)},
+ {},
+ [],
+ [0, 0, 0],
+ 1.5
+] call EFUNC(interact_menu,createAction);
+[_type, 0, ["ACE_MainActions"], _sitAction] call EFUNC(interact_menu,addActionToClass);
diff --git a/addons/sitting/functions/fnc_canSit.sqf b/addons/sitting/functions/fnc_canSit.sqf
index fef36b4bbd..1dd0c9676f 100644
--- a/addons/sitting/functions/fnc_canSit.sqf
+++ b/addons/sitting/functions/fnc_canSit.sqf
@@ -4,22 +4,20 @@
*
* Arguments:
* 0: Seat
- * 1: Player
*
* Return Value:
* Can Sit Down
*
* Example:
- * [seat, player] call ace_sitting_fnc_canSit
+ * [seat] call ace_sitting_fnc_canSit
*
* Public: No
*/
#include "script_component.hpp"
-params ["_seat", "_player"];
+params ["_seat"];
// Sitting enabled, is seat object, not occupied and standing up (or not on a big slope)
GVAR(enable) &&
-{getNumber (configFile >> "CfgVehicles" >> typeOf _seat >> QGVAR(canSit)) == 1} &&
{isNil {_seat getVariable QGVAR(seatOccupied)}} &&
{round (vectorUp _seat select 0) == 0 && {round (vectorUp _seat select 1) == 0} && {round (vectorUp _seat select 2) == 1}}
diff --git a/addons/sitting/functions/fnc_sit.sqf b/addons/sitting/functions/fnc_sit.sqf
index e77e2d2b13..61872dd1a0 100644
--- a/addons/sitting/functions/fnc_sit.sqf
+++ b/addons/sitting/functions/fnc_sit.sqf
@@ -21,7 +21,7 @@ private ["_actionID", "_configFile", "_sitDirection", "_sitPosition", "_seatPosO
params ["_seat", "_player"];
// Set global variable for standing up
-GVAR(seat) = _seat;
+GVAR(seat) = _seat; //@todo - put into player isSitting variable
// Overwrite weird position, because Arma decides to set it differently based on current animation/stance...
_player switchMove "amovpknlmstpsraswrfldnon";
From dbd0beb5140355133ee234bd1cd658a5a2cd32d7 Mon Sep 17 00:00:00 2001
From: jonpas
Date: Sun, 27 Sep 2015 01:31:23 +0200
Subject: [PATCH 32/54] Stored a global variable in player setVariable
---
addons/sitting/CfgEventHandlers.hpp | 1 +
addons/sitting/XEH_clientInit.sqf | 2 +-
addons/sitting/functions/fnc_canStand.sqf | 2 +-
addons/sitting/functions/fnc_handleInterrupt.sqf | 2 +-
addons/sitting/functions/fnc_sit.sqf | 9 +++------
addons/sitting/functions/fnc_stand.sqf | 9 ++++++---
6 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/addons/sitting/CfgEventHandlers.hpp b/addons/sitting/CfgEventHandlers.hpp
index bd13e623f0..8b3768a747 100644
--- a/addons/sitting/CfgEventHandlers.hpp
+++ b/addons/sitting/CfgEventHandlers.hpp
@@ -18,6 +18,7 @@ class Extended_Killed_EventHandlers {
};
};
+// Need initPost or there are problems with setVariable
class Extended_InitPost_EventHandlers {
class All {
class ADDON {
diff --git a/addons/sitting/XEH_clientInit.sqf b/addons/sitting/XEH_clientInit.sqf
index 9cf8278877..23816bd8d7 100644
--- a/addons/sitting/XEH_clientInit.sqf
+++ b/addons/sitting/XEH_clientInit.sqf
@@ -4,7 +4,7 @@
if (!hasInterface) exitWith {};
// Add interaction menu exception
-["isNotSitting", {!((_this select 0) getVariable [QGVAR(isSitting), false])}] call EFUNC(common,addCanInteractWithCondition);
+["isNotSitting", {isNil {(_this select 0) getVariable QGVAR(isSitting)}}] call EFUNC(common,addCanInteractWithCondition);
// Handle interruptions
["medical_onUnconscious", {_this call DFUNC(handleInterrupt)}] call EFUNC(common,addEventhandler);
diff --git a/addons/sitting/functions/fnc_canStand.sqf b/addons/sitting/functions/fnc_canStand.sqf
index c516485a82..a051e1784e 100644
--- a/addons/sitting/functions/fnc_canStand.sqf
+++ b/addons/sitting/functions/fnc_canStand.sqf
@@ -18,4 +18,4 @@
params ["_player"];
// Sitting
-(_player getVariable [QGVAR(isSitting), false])
+!isNil {_player getVariable QGVAR(isSitting)}
diff --git a/addons/sitting/functions/fnc_handleInterrupt.sqf b/addons/sitting/functions/fnc_handleInterrupt.sqf
index 328675c172..c7e0a545ff 100644
--- a/addons/sitting/functions/fnc_handleInterrupt.sqf
+++ b/addons/sitting/functions/fnc_handleInterrupt.sqf
@@ -17,6 +17,6 @@
params ["_player"];
-if (_player getVariable [QGVAR(isSitting), false]) then {
+if (!isNil {_player getVariable QGVAR(isSitting)}) then {
_player call FUNC(stand);
};
diff --git a/addons/sitting/functions/fnc_sit.sqf b/addons/sitting/functions/fnc_sit.sqf
index 61872dd1a0..1b6f979b42 100644
--- a/addons/sitting/functions/fnc_sit.sqf
+++ b/addons/sitting/functions/fnc_sit.sqf
@@ -20,9 +20,6 @@ private ["_actionID", "_configFile", "_sitDirection", "_sitPosition", "_seatPosO
params ["_seat", "_player"];
-// Set global variable for standing up
-GVAR(seat) = _seat; //@todo - put into player isSitting variable
-
// Overwrite weird position, because Arma decides to set it differently based on current animation/stance...
_player switchMove "amovpknlmstpsraswrfldnon";
@@ -60,8 +57,8 @@ _player setDir _sitDirection;
// No need for ATL/ASL as modelToWorld returns in format position
_player setPos (_seat modelToWorld _sitPosition);
-// Set variables
-_player setVariable [QGVAR(isSitting), true];
+// Set variables, save seat object on player
+_player setVariable [QGVAR(isSitting), _seat];
_seat setVariable [QGVAR(seatOccupied), true, true]; // To prevent multiple people sitting on one seat
@@ -72,7 +69,7 @@ _seatPosOrig = getPosASL _seat;
_args params ["_player", "_seat", "_seatPosOrig"];
// Remove PFH if not sitting any more
- if !(_player getVariable [QGVAR(isSitting), false]) exitWith {
+ if (isNil {_player getVariable QGVAR(isSitting)}) exitWith {
[_pfhId] call CBA_fnc_removePerFrameHandler;
TRACE_1("Remove PFH",_player getVariable [ARR_2(QGVAR(isSitting), false)]);
};
diff --git a/addons/sitting/functions/fnc_stand.sqf b/addons/sitting/functions/fnc_stand.sqf
index ef19d5f586..4c56eba1c4 100644
--- a/addons/sitting/functions/fnc_stand.sqf
+++ b/addons/sitting/functions/fnc_stand.sqf
@@ -17,7 +17,7 @@
params ["_player"];
-// remove scroll wheel action
+// Remove scroll wheel action
_player removeAction (_player getVariable [QGVAR(StandUpActionID), -1]);
// Restore animation
@@ -31,7 +31,10 @@ _animation = switch (currentWeapon _player) do {
[_player, _animation, 2] call EFUNC(common,doAnimation);
+// Get seat from variable on player
+_seat = _player getVariable [QGVAR(isSitting), objNull];
+if (isNull _seat) exitWith {};
+
// Set variables to nil
_player setVariable [QGVAR(isSitting), nil];
-GVAR(seat) setVariable [QGVAR(seatOccupied), nil, true];
-GVAR(seat) = nil;
+_seat setVariable [QGVAR(seatOccupied), nil, true];
From 85cff04e0c368caf1f426d5d587e229cfcc9b6c4 Mon Sep 17 00:00:00 2001
From: jonpas
Date: Sun, 27 Sep 2015 01:37:19 +0200
Subject: [PATCH 33/54] Stored scroll-wheel action ID into already existing
player setVariable instead of having 2
---
addons/sitting/functions/fnc_sit.sqf | 10 +---------
addons/sitting/functions/fnc_stand.sqf | 13 ++++++-------
2 files changed, 7 insertions(+), 16 deletions(-)
diff --git a/addons/sitting/functions/fnc_sit.sqf b/addons/sitting/functions/fnc_sit.sqf
index 1b6f979b42..821bb230d1 100644
--- a/addons/sitting/functions/fnc_sit.sqf
+++ b/addons/sitting/functions/fnc_sit.sqf
@@ -24,12 +24,6 @@ params ["_seat", "_player"];
_player switchMove "amovpknlmstpsraswrfldnon";
// Add scroll-wheel action to release object
-_actionID = _player getVariable [QGVAR(StandUpActionID), -1];
-
-if (_actionID != -1) then {
- _player removeAction _actionID;
-};
-
_actionID = _player addAction [
format ["%1 ", localize LSTRING(Stand)],
QUOTE((_this select 0) call FUNC(stand)),
@@ -41,8 +35,6 @@ _actionID = _player addAction [
QUOTE(_this call FUNC(canStand))
];
-_player setVariable [QGVAR(StandUpActionID), _actionID];
-
// Read config
_configFile = configFile >> "CfgVehicles" >> typeOf _seat;
_sitDirection = (getDir _seat) + getNumber (_configFile >> QGVAR(sitDirection));
@@ -58,7 +50,7 @@ _player setDir _sitDirection;
_player setPos (_seat modelToWorld _sitPosition);
// Set variables, save seat object on player
-_player setVariable [QGVAR(isSitting), _seat];
+_player setVariable [QGVAR(isSitting), [_seat, _actionID]];
_seat setVariable [QGVAR(seatOccupied), true, true]; // To prevent multiple people sitting on one seat
diff --git a/addons/sitting/functions/fnc_stand.sqf b/addons/sitting/functions/fnc_stand.sqf
index 4c56eba1c4..4c08461746 100644
--- a/addons/sitting/functions/fnc_stand.sqf
+++ b/addons/sitting/functions/fnc_stand.sqf
@@ -16,12 +16,14 @@
#include "script_component.hpp"
params ["_player"];
+private ["_animation"];
-// Remove scroll wheel action
-_player removeAction (_player getVariable [QGVAR(StandUpActionID), -1]);
+(_player getVariable QGVAR(isSitting)) params ["_seat", "_actionID"];
+
+// Remove scroll-wheel action
+_player removeAction _actionID;
// Restore animation
-private "_animation";
_animation = switch (currentWeapon _player) do {
case "": {"amovpercmstpsnonwnondnon"};
case (primaryWeapon _player): {"amovpercmstpslowwrfldnon"};
@@ -31,10 +33,7 @@ _animation = switch (currentWeapon _player) do {
[_player, _animation, 2] call EFUNC(common,doAnimation);
-// Get seat from variable on player
-_seat = _player getVariable [QGVAR(isSitting), objNull];
-if (isNull _seat) exitWith {};
-
// Set variables to nil
_player setVariable [QGVAR(isSitting), nil];
+if (isNull _seat) exitWith {};
_seat setVariable [QGVAR(seatOccupied), nil, true];
From cd510c8ff75d36e813babcb908ac2450df47dccb Mon Sep 17 00:00:00 2001
From: jonpas
Date: Sun, 27 Sep 2015 02:05:38 +0200
Subject: [PATCH 34/54] Added carrying to chairs
---
addons/dragging/CfgEventHandlers.hpp | 12 +-----------
addons/sitting/CfgVehicles.hpp | 18 ++++++++++++++++++
2 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/addons/dragging/CfgEventHandlers.hpp b/addons/dragging/CfgEventHandlers.hpp
index 2ff7d07c0d..3ee6e9b8cf 100644
--- a/addons/dragging/CfgEventHandlers.hpp
+++ b/addons/dragging/CfgEventHandlers.hpp
@@ -18,17 +18,7 @@ class Extended_Init_EventHandlers {
init = QUOTE(_this call DFUNC(initPerson));
};
};
- class StaticWeapon {
- class ADDON {
- init = QUOTE(_this call DFUNC(initObject));
- };
- };
- class ReammoBox_F {
- class ADDON {
- init = QUOTE(_this call DFUNC(initObject));
- };
- };
- class ACE_RepairItem_Base {
+ class All {
class ADDON {
init = QUOTE(_this call DFUNC(initObject));
};
diff --git a/addons/sitting/CfgVehicles.hpp b/addons/sitting/CfgVehicles.hpp
index 0d41ba1ed6..4ac0d0edb7 100644
--- a/addons/sitting/CfgVehicles.hpp
+++ b/addons/sitting/CfgVehicles.hpp
@@ -41,6 +41,9 @@ class CfgVehicles {
GVAR(canSit) = 1;
GVAR(sitDirection) = 180;
GVAR(sitPosition[]) = {0, -0.1, -0.45};
+ EGVAR(dragging,canCarry) = 1;
+ EGVAR(dragging,carryPosition[]) = {0, 0.75, 0.5};
+ EGVAR(dragging,carryDirection) = 180;
};
// Camping Chair
class Land_CampingChair_V2_F: ThingX {
@@ -48,6 +51,9 @@ class CfgVehicles {
GVAR(canSit) = 1;
GVAR(sitDirection) = 180;
GVAR(sitPosition[]) = {0, -0.1, -0.45};
+ EGVAR(dragging,canCarry) = 1;
+ EGVAR(dragging,carryPosition[]) = {0, 0.75, 0.5};
+ EGVAR(dragging,carryDirection) = 180;
};
class Furniture_base_F;
@@ -57,6 +63,9 @@ class CfgVehicles {
GVAR(canSit) = 1;
GVAR(sitDirection) = 90;
GVAR(sitPosition[]) = {0, 0, -0.5};
+ EGVAR(dragging,canCarry) = 1;
+ EGVAR(dragging,carryPosition[]) = {0, 0.75, 0.5};
+ EGVAR(dragging,carryDirection) = 270;
};
// Chair (Wooden)
class Land_ChairWood_F: Furniture_base_F {
@@ -64,6 +73,9 @@ class CfgVehicles {
GVAR(canSit) = 1;
GVAR(sitDirection) = 180;
GVAR(sitPosition[]) = {0, -0.05, 0};
+ EGVAR(dragging,canCarry) = 1;
+ EGVAR(dragging,carryPosition[]) = {0, 0.75, 0.5};
+ EGVAR(dragging,carryDirection) = 180;
};
// Office Chair
class Land_OfficeChair_01_F: Furniture_base_F {
@@ -71,6 +83,9 @@ class CfgVehicles {
GVAR(canSit) = 1;
GVAR(sitDirection) = 180;
GVAR(sitPosition[]) = {0, 0, -0.6};
+ EGVAR(dragging,canCarry) = 1;
+ EGVAR(dragging,carryPosition[]) = {0, 0.75, 0.5};
+ EGVAR(dragging,carryDirection) = 180;
};
// Rattan Chair
class Land_RattanChair_01_F: Furniture_base_F {
@@ -78,5 +93,8 @@ class CfgVehicles {
GVAR(canSit) = 1;
GVAR(sitDirection) = 180;
GVAR(sitPosition[]) = {0, -0.1, -1}; // Z must be -1 due to chair's geometry (magic floating seat point)
+ EGVAR(dragging,canCarry) = 1;
+ EGVAR(dragging,carryPosition[]) = {0, 0.75, 0.5};
+ EGVAR(dragging,carryDirection) = 180;
};
};
From ae07a71b0de9ac0b34daefc42aafe29f5c500eed Mon Sep 17 00:00:00 2001
From: jonpas
Date: Sun, 27 Sep 2015 02:13:32 +0200
Subject: [PATCH 35/54] Minimized XEH to ThingX config level
---
addons/dragging/CfgEventHandlers.hpp | 7 ++++++-
addons/sitting/CfgEventHandlers.hpp | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/addons/dragging/CfgEventHandlers.hpp b/addons/dragging/CfgEventHandlers.hpp
index 3ee6e9b8cf..532038c2c5 100644
--- a/addons/dragging/CfgEventHandlers.hpp
+++ b/addons/dragging/CfgEventHandlers.hpp
@@ -18,7 +18,12 @@ class Extended_Init_EventHandlers {
init = QUOTE(_this call DFUNC(initPerson));
};
};
- class All {
+ class StaticWeapon {
+ class ADDON {
+ init = QUOTE(_this call DFUNC(initObject));
+ };
+ };
+ class ThingX {
class ADDON {
init = QUOTE(_this call DFUNC(initObject));
};
diff --git a/addons/sitting/CfgEventHandlers.hpp b/addons/sitting/CfgEventHandlers.hpp
index 8b3768a747..da7efe1601 100644
--- a/addons/sitting/CfgEventHandlers.hpp
+++ b/addons/sitting/CfgEventHandlers.hpp
@@ -20,7 +20,7 @@ class Extended_Killed_EventHandlers {
// Need initPost or there are problems with setVariable
class Extended_InitPost_EventHandlers {
- class All {
+ class ThingX {
class ADDON {
init = QUOTE(_this call DFUNC(addSitActions))
};
From 4521df0a575776a59b0b9db77ce0acc753fdc4cf Mon Sep 17 00:00:00 2001
From: jonpas
Date: Mon, 28 Sep 2015 16:17:12 +0200
Subject: [PATCH 36/54] Add synchronizedObjects vehicle support to
assignObjectsInList with an optional parameter
---
addons/common/functions/fnc_assignObjectsInList.sqf | 12 +++++++++---
.../functions/fnc_moduleAssignMedicalVehicle.sqf | 2 +-
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/addons/common/functions/fnc_assignObjectsInList.sqf b/addons/common/functions/fnc_assignObjectsInList.sqf
index eddd792500..a09447a43a 100644
--- a/addons/common/functions/fnc_assignObjectsInList.sqf
+++ b/addons/common/functions/fnc_assignObjectsInList.sqf
@@ -8,6 +8,7 @@
* 1: Variable Name
* 2: Value
* 3: Global
+ * 4: Vehicle (default: false)
*
* Return Value:
* None
@@ -19,7 +20,7 @@
*/
#include "script_component.hpp"
-params ["_list", "_variable", "_setting", "_global"];
+params ["_list", "_variable", "_setting", "_global", ["_vehicle", false]];
if (typeName _list == "STRING") then {
_list = [_list, true, true] call FUNC(parseList);
@@ -30,8 +31,13 @@ if (typeName _list == "STRING") then {
if (!isNil "_x") then {
if (typeName _x == typeName objNull) then {
if (local _x) then {
- _x setVariable [_variable, _setting, _global];
- TRACE_4("Set variable",_x,_variable,_setting,_global);
+ if (_vehicle) then {
+ (vehicle _x) setVariable [_variable, _setting, _global];
+ TRACE_6("Set variable vehicle",_x,vehicle _x,typeOf (vehicle _x),_variable,_setting,_global);
+ } else {
+ _x setVariable [_variable, _setting, _global];
+ TRACE_5("Set variable",_x,typeOf _x,_variable,_setting,_global);
+ };
};
};
};
diff --git a/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf b/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf
index 9cbb698c82..2bc6d3a332 100644
--- a/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf
+++ b/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf
@@ -22,5 +22,5 @@ if (!isNull _logic) then {
_setting = _logic getVariable ["enabled", 0];
[_list, QGVAR(medicClass), _setting, true] call EFUNC(common,assignObjectsInList);
- [synchronizedObjects _logic, QGVAR(medicClass), _setting, true] call EFUNC(common,assignObjectsInList);
+ [synchronizedObjects _logic, QGVAR(medicClass), _setting, true, true] call EFUNC(common,assignObjectsInList);
};
From c0b78ecf3a5695c60e590330ae746c1181c93e4e Mon Sep 17 00:00:00 2001
From: PabstMirror
Date: Tue, 29 Sep 2015 11:36:30 -0500
Subject: [PATCH 37/54] Set Default Channel at mission start
---
addons/map/ACE_Settings.hpp | 22 ++++++++++++++++++++++
addons/map/CfgVehicles.hpp | 14 ++++++++++++++
addons/map/XEH_postInitClient.sqf | 15 +++++++++++++++
addons/map/functions/fnc_moduleMap.sqf | 3 ++-
addons/map/stringtable.xml | 6 ++++++
5 files changed, 59 insertions(+), 1 deletion(-)
diff --git a/addons/map/ACE_Settings.hpp b/addons/map/ACE_Settings.hpp
index 4e2a5d5706..c0d2718c1f 100644
--- a/addons/map/ACE_Settings.hpp
+++ b/addons/map/ACE_Settings.hpp
@@ -2,33 +2,55 @@ class ACE_Settings {
class GVAR(BFT_Interval) {
value = 1.0;
typeName = "SCALAR";
+ displayName = CSTRING(BFT_Interval_DisplayName);
+ description = CSTRING(BFT_Interval_Description);
};
class GVAR(BFT_Enabled) {
value = 0;
typeName = "BOOL";
+ displayName = CSTRING(BFT_Enabled_DisplayName);
+ description = CSTRING(BFT_Enabled_Description);
};
class GVAR(BFT_HideAiGroups) {
value = 0;
typeName = "BOOL";
+ displayName = CSTRING(BFT_HideAiGroups_DisplayName);
+ description = CSTRING(BFT_HideAiGroups_Description);
};
class GVAR(mapIllumination) {
value = 1;
typeName = "BOOL";
+ displayName = CSTRING(MapIllumination_DisplayName);
+ description = CSTRING(MapIllumination_Description);
};
class GVAR(mapGlow) {
value = 1;
typeName = "BOOL";
+ displayName = CSTRING(MapGlow_DisplayName);
+ description = CSTRING(MapGlow_Description);
};
class GVAR(mapShake) {
value = 1;
typeName = "BOOL";
+ displayName = CSTRING(MapShake_DisplayName);
+ description = CSTRING(MapShake_Description);
};
class GVAR(mapLimitZoom) {
value = 0;
typeName = "BOOL";
+ displayName = CSTRING(MapLimitZoom_DisplayName);
+ description = CSTRING(MapLimitZoom_Description);
};
class GVAR(mapShowCursorCoordinates) {
value = 0;
typeName = "BOOL";
+ displayName = CSTRING(MapShowCursorCoordinates_DisplayName);
+ description = CSTRING(MapShowCursorCoordinates_Description);
+ };
+ class GVAR(DefaultChannel) {
+ value = -1;
+ typeName = "SCALAR";
+ displayName = CSTRING(DefaultChannel_DisplayName);
+ description = CSTRING(DefaultChannel_Description);
};
};
diff --git a/addons/map/CfgVehicles.hpp b/addons/map/CfgVehicles.hpp
index 560453b416..7906de8bb7 100644
--- a/addons/map/CfgVehicles.hpp
+++ b/addons/map/CfgVehicles.hpp
@@ -55,6 +55,20 @@ class CfgVehicles {
typeName = "BOOL";
defaultValue = 0;
};
+ class DefaultChannel {
+ displayName = CSTRING(DefaultChannel_DisplayName);
+ description = CSTRING(DefaultChannel_Description);
+ typeName = "NUMBER";
+ class values {
+ class disable {name = ECSTRING(common,Disabled); value = -1; default = 1;};
+ class global {name = "$STR_channel_global"; value = 0;};
+ class side {name = "$STR_channel_side"; value = 1;};
+ class command {name = "$STR_channel_command"; value = 2;};
+ class group {name = "$STR_channel_group"; value = 3;};
+ class vehicle {name = "$STR_channel_vehicle"; value = 4;};
+ class direct {name = "$STR_channel_direct"; value = 5;};
+ };
+ };
};
class ModuleDescription {
description = CSTRING(Module_Description);
diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf
index 02800c2540..c162f8802d 100644
--- a/addons/map/XEH_postInitClient.sqf
+++ b/addons/map/XEH_postInitClient.sqf
@@ -56,6 +56,21 @@ call FUNC(determineZoom);
}, 0] call CBA_fnc_addPerFrameHandler;
["SettingsInitialized", {
+ if (isMultiplayer && {GVAR(DefaultChannel) != -1}) then {
+ //Set the chat channel once the map has finished loading
+ [{
+ if ((isNull findDisplay 37) && {isNull findDisplay 52} && {isNull findDisplay 53} && {isNull findDisplay 12}) exitWith {};
+ [_this select 1] call CBA_fnc_removePerFrameHandler;
+
+ setCurrentChannel GVAR(DefaultChannel);
+ if (currentChannel == GVAR(DefaultChannel)) then {
+ // ACE_LOGINFO_1("Channel Set - %1", currentChannel);
+ } else {
+ ACE_LOGERROR_2("Failed To Set Channel %1 (is %2)", GVAR(DefaultChannel), currentChannel);
+ };
+ }, 0, []] call CBA_fnc_addPerFrameHandler;
+ };
+
// Start Blue Force Tracking if Enabled
if (GVAR(BFT_Enabled)) then {
GVAR(BFT_markers) = [];
diff --git a/addons/map/functions/fnc_moduleMap.sqf b/addons/map/functions/fnc_moduleMap.sqf
index b7db6996d6..605c15127e 100644
--- a/addons/map/functions/fnc_moduleMap.sqf
+++ b/addons/map/functions/fnc_moduleMap.sqf
@@ -13,7 +13,7 @@
if !(isServer) exitWith {};
-params ["_logic", "_units", "_activated"];
+params ["_logic", "", "_activated"];
if !(_activated) exitWith {};
@@ -22,5 +22,6 @@ if !(_activated) exitWith {};
[_logic, QGVAR(mapShake), "MapShake" ] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(mapLimitZoom), "MapLimitZoom" ] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(mapShowCursorCoordinates), "MapShowCursorCoordinates"] call EFUNC(common,readSettingFromModule);
+[_logic, QGVAR(DefaultChannel), "DefaultChannel" ] call EFUNC(common,readSettingFromModule);
ACE_LOGINFO("Map Module Initialized.");
diff --git a/addons/map/stringtable.xml b/addons/map/stringtable.xml
index 8f693ef37a..76055cc45a 100644
--- a/addons/map/stringtable.xml
+++ b/addons/map/stringtable.xml
@@ -256,5 +256,11 @@
Snížit jas
Reducir brillo
+
+ Set Channel At Start
+
+
+ Change the starting marker channel at mission start
+
\ No newline at end of file
From 251437c415444f0472ea2395e1e1a860ee680826 Mon Sep 17 00:00:00 2001
From: gienkov
Date: Tue, 29 Sep 2015 20:37:30 +0200
Subject: [PATCH 38/54] pl translation
---
addons/map/stringtable.xml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/addons/map/stringtable.xml b/addons/map/stringtable.xml
index 76055cc45a..0488a13493 100644
--- a/addons/map/stringtable.xml
+++ b/addons/map/stringtable.xml
@@ -258,9 +258,11 @@
Set Channel At Start
+ Ust. domyślny kanał
Change the starting marker channel at mission start
+ Ustaw domyślny kanał dla markerów przy starcie misji
\ No newline at end of file
From 88ee846d7d6e48bb80482af3e51902e1b80d5b5e Mon Sep 17 00:00:00 2001
From: licht-im-Norden87
Date: Thu, 1 Oct 2015 01:36:27 +0200
Subject: [PATCH 39/54] Update Stringtable, german: "captives"
---
addons/captives/stringtable.xml | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml
index 864fa7c437..ed66fb7cf2 100644
--- a/addons/captives/stringtable.xml
+++ b/addons/captives/stringtable.xml
@@ -99,7 +99,7 @@
Cable ties that allow you to restrain prisoners.
- Kabelbinder ermöglichen es, Gefangene zu fesseln.
+ Mit Kabelbindern können Personen gefesselt werden.
Opaska zaciskowa pozwala na skrępowanie dłoni u więźnia.
Los precintos permiten maniatar prisioneros
Les Serflex permettent de menotter les prisonniers.
@@ -206,7 +206,7 @@
Skuwanie sojuszników
Se puede esposar el bando propio
Může spoutat spolubojovníky
- Kann Teamkollegen fesseln
+ Kann Kameraden fesseln
Pode algemar o próprio lado
Peut libérer sa propre faction
Saját oldal megbilincselhető
@@ -217,7 +217,7 @@
Czy gracze mogą skuwać sojuszników?
Pueden los jugadores esposar unidades en su propio bando
Mohou hráči spoutat jednotky na své straně
- Können Spieler eigene Einheiten fesseln
+ Spieler können eigene Einheiten fesseln.
Os jogadores podem algemar unidades do seu lado
Les joueurs peuvent utiliser les Serflex sur leur propre camp
A játékosok megkötözhetik-e a saját oldalukon lévő egységeket
@@ -239,7 +239,7 @@
Gracze mogą skapitulować po schowaniu swojej broni do kabury
Los jugadores pueden rendirse después de enfundar su arma
Hráč se může vzdát poté, co si skryje zbraň
- Spieler können kapitulieren, nachdem sie ihre Waffe geholstert haben
+ Spieler können kapitulieren, nachdem sie ihre Waffe geholstert haben.
Jogadores podem se render depois de guardar sua arma
Les joueurs peuvent se rendre après avoir rangé leur arme
A játékosok megadhatják magukat a fegyverük elrakása után
@@ -247,6 +247,7 @@
Require surrendering
+ Benötigt Kapitulation
Wymagaj kapitulacji
Requer rendição
Требовать пленения
@@ -254,6 +255,7 @@
Require Players to surrender before they can be arrested
+ Spieler müssen zunächst kapitulieren bevor sie gefangen genommen werden können.
Wymagaj od graczy kapitulacji zanim będzie można ich zaaresztować
Requer que jogadores se rendam antes de poderem ser presos
Требуется, чтобы игрок сдался в плен прежде, чем его можно будет связать
@@ -261,6 +263,7 @@
Surrendering only
+ Nur Kapitulieren.
Tylko kapitulacja
Somente rendição
Только сдавшийся в плен
@@ -268,6 +271,7 @@
Surrendering or No weapon
+ Kapitulieren oder keine Waffe.
Kapitulacja lub brak broni
Rendição ou desarmado
Сдавшийся или безоружный
From 66e89143603ed362c54766898063f94d9cc01891 Mon Sep 17 00:00:00 2001
From: licht-im-Norden87
Date: Thu, 1 Oct 2015 04:38:21 +0200
Subject: [PATCH 40/54] Update stringtable.xml
---
addons/captives/stringtable.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml
index ed66fb7cf2..0e1714d225 100644
--- a/addons/captives/stringtable.xml
+++ b/addons/captives/stringtable.xml
@@ -99,7 +99,7 @@
Cable ties that allow you to restrain prisoners.
- Mit Kabelbindern können Personen gefesselt werden.
+ Mit Kabelbindern können Gefangene gefesselt werden.
Opaska zaciskowa pozwala na skrępowanie dłoni u więźnia.
Los precintos permiten maniatar prisioneros
Les Serflex permettent de menotter les prisonniers.
From 4d867cb4f78470995be722d1f82ef0210746c32f Mon Sep 17 00:00:00 2001
From: licht-im-Norden87
Date: Sat, 3 Oct 2015 04:36:38 +0200
Subject: [PATCH 41/54] Update README_DE.md
---
docs/README_DE.md | 42 +++++++++++++++++++++++++++++++++---------
1 file changed, 33 insertions(+), 9 deletions(-)
diff --git a/docs/README_DE.md b/docs/README_DE.md
index 9921bf3fc6..e80c5e48da 100644
--- a/docs/README_DE.md
+++ b/docs/README_DE.md
@@ -29,16 +29,40 @@ Da die MOD vollkommen als **open-source** Projekt gestaltet ist, steht es jedem
Die Mod ist **modular gestaltet** — beinahe jede PBO kann entfernt werden, sodass jede Gemeinschaft ihre eigene Version der Mod unterhalten kann. Dies kann zum Beispiel einige Funktionalitäten ausschließen, da das Feature nicht gewünscht ist, oder es mit einer anderen MOD in Konflikt gerät etc. .Ebenfalls können viele Einstellungen vom Missionsersteller vorgenommen werden (u.a. am medizinischem System), sodass eine individuelle Erfahrung gewährleistet wird.
-### Features
-- Verbessertes medizinisches System
-- Logistik System: U.a. Transport und Fahrzeugreparatur
-- Sprengstoffsystem mit unterschiedlichen Zündern
+### Hauptmerkmale
+- Vollkommen neues 3D Interaktionssystem
+- Leistungs- und stabilitätsoptimiert
+- Hauptmerkmal auf Modularität und individuelle Anpassungsmöglichkeiten
+- Neue, flexible Spieler- und Servereinstellungen
+- Verbessertes Sanitätssystem mit unterschiedlichen Stufen (Basis/Erweitert) Spielbarkeit/Realismus
+- Echte und stetige Wettersynchronisation
+- Ballistik basierend auf vielen Faktoren u.a. Wetter und Wind
- Gefangenensystem
-- Reale Namen für Arma 3 Fahrzeuge und Waffen
-- Realistisches, ballistisches Verhalten (Wind und Luftfeuchtigkeit)
-- Simulation der Rückstrahlzone
-- Ein Feuerleitsystem für gepanzerte Fahrzeuge und Hubschrauber
-***und noch viel mehr...***
+- Sprengtoffmechaniken mit den unterschiedlichsten Auslösern
+- Kartenverbesserungen – Setzen von Markierungen ; Kartenwerkzeuge
+- Erweitertes Raketenlenksystem
+
+#### Weitere Mechaniken
+- Tragen und Ziehen
+- Waffen und Fahrzeuge tragen die Namen ihrer Vorbilder in der echten Welt
+- Ein Feuerleitsystem (FLS) für Hubschrauber und Panzer
+- Realistische Ballistik/Feuerleitsystem werdeb in C/C++ Erweiterungen berechnet
+- Rückstrahlzonen- und Überdrucksimulation
+- Einwegwaffen
+- Realistische G-Kräfte
+- Fahrzeuge abschließen
+- Realistische Nacht- und Thermalsicht
+- Magazin umpacken
+- Realistische Waffen Er- bzw. Überhitzung
+- Temporäre Taubheit bei zu lauten Geräuschen
+- Verbesserte Ragdollphysik
+- Verbesserte Interaktionen für AARs und Munitionsschlepper
+- Einstellbare Zielfernrohre
+- Keine Ruheanimationen bei gesenkter Waffe
+- No talking player avatar
+- Über Hindernisse springen, über Mauern klettern, Zäune durchtrennen
+- Vector IV, MicroDAGR und Kestrel
+***und noch viel viel mehr...***
#### Anleitungen
Du hast ACE3 installiert, hast aber keine Ahnung was und wie alles funktioniert und wo sich was befindet?
From 978d00211284dbd978bbfbbabbdfdd36751acf9a Mon Sep 17 00:00:00 2001
From: licht-im-Norden87
Date: Sat, 3 Oct 2015 04:37:28 +0200
Subject: [PATCH 42/54] Update README_DE.md
---
docs/README_DE.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/README_DE.md b/docs/README_DE.md
index e80c5e48da..c716f0fa22 100644
--- a/docs/README_DE.md
+++ b/docs/README_DE.md
@@ -38,7 +38,7 @@ Die Mod ist **modular gestaltet** — beinahe jede PBO kann entfernt werden, sod
- Echte und stetige Wettersynchronisation
- Ballistik basierend auf vielen Faktoren u.a. Wetter und Wind
- Gefangenensystem
-- Sprengtoffmechaniken mit den unterschiedlichsten Auslösern
+- Sprengtoffmechaniken mit den unterschiedlichsten Zündern
- Kartenverbesserungen – Setzen von Markierungen ; Kartenwerkzeuge
- Erweitertes Raketenlenksystem
From 2afbe36b89067b6a2940ea14f6daec14b2038b73 Mon Sep 17 00:00:00 2001
From: licht-im-Norden87
Date: Sat, 3 Oct 2015 04:39:22 +0200
Subject: [PATCH 43/54] Update README_DE.md
---
docs/README_DE.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/README_DE.md b/docs/README_DE.md
index c716f0fa22..a54bf70e59 100644
--- a/docs/README_DE.md
+++ b/docs/README_DE.md
@@ -46,7 +46,7 @@ Die Mod ist **modular gestaltet** — beinahe jede PBO kann entfernt werden, sod
- Tragen und Ziehen
- Waffen und Fahrzeuge tragen die Namen ihrer Vorbilder in der echten Welt
- Ein Feuerleitsystem (FLS) für Hubschrauber und Panzer
-- Realistische Ballistik/Feuerleitsystem werdeb in C/C++ Erweiterungen berechnet
+- Viele Funktionen werden in C/C++ Erweiterungen berechnet
- Rückstrahlzonen- und Überdrucksimulation
- Einwegwaffen
- Realistische G-Kräfte
From 411ddac3b992cd6fe2ed1f413bade6c957a066e7 Mon Sep 17 00:00:00 2001
From: licht-im-Norden87
Date: Sat, 3 Oct 2015 04:53:00 +0200
Subject: [PATCH 44/54] Update README_DE.md
---
docs/README_DE.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/README_DE.md b/docs/README_DE.md
index a54bf70e59..23be2069d3 100644
--- a/docs/README_DE.md
+++ b/docs/README_DE.md
@@ -27,7 +27,7 @@
Da die MOD vollkommen als **open-source** Projekt gestaltet ist, steht es jedem frei Änderungen vorzuschlagen, oder seine eigene, modifizierte Version zu erstellen, solange diese ebenfalls der Öffentlichkeit zugänglich ist und mit GNU General Public License übereinstimmt. (Weitere Informationen ist der Lizenzdatei in diesem Projekt entnehmbar)
-Die Mod ist **modular gestaltet** — beinahe jede PBO kann entfernt werden, sodass jede Gemeinschaft ihre eigene Version der Mod unterhalten kann. Dies kann zum Beispiel einige Funktionalitäten ausschließen, da das Feature nicht gewünscht ist, oder es mit einer anderen MOD in Konflikt gerät etc. .Ebenfalls können viele Einstellungen vom Missionsersteller vorgenommen werden (u.a. am medizinischem System), sodass eine individuelle Erfahrung gewährleistet wird.
+Die Mod ist **modular gestaltet** — beinahe jede PBO kann entfernt werden, sodass jede Gemeinschaft ihre eigene Version der Mod unterhalten kann. Dies kann zum Beispiel einige Funktionalitäten ausschließen, da das Feature nicht gewünscht ist, oder es mit einer anderen MOD in Konflikt gerät etc..Ebenfalls können viele Einstellungen vom Missionsersteller vorgenommen werden (u.a. am Sanitätssystem), sodass eine individuelle Erfahrung gewährleistet werden kann.
### Hauptmerkmale
- Vollkommen neues 3D Interaktionssystem
@@ -69,11 +69,11 @@ Du hast ACE3 installiert, hast aber keine Ahnung was und wie alles funktioniert
- [Erste Schritte](http://ace3mod.com/wiki/user/getting-started.html).
#### Mitwirken
-Wenn du bei der Entwicklung der MOD mithelfen möchtest, so kannst du dies tun, indem du nach Fehlern Ausschau hältst, oder neue Funktionen vorschlägst. Um etwas beizutragen, "Forke" einfach dieses Archiv (bzw. repository) und erstelle deine "Pull-Request", welche von anderen Entwicklern und Beiträgern überprüft wird. Bitte trage dich dabei in [`AUTHORS.txt`](https://github.com/acemod/ACE3/blob/master/AUTHORS.txt) mit deinem Nutzernamen und einer gütligen Email-Adresse ein.
+Wenn du bei der Entwicklung der MOD mithelfen möchtest kannst du dies tun, indem du nach Fehlern Ausschau hältst oder neue Funktionen vorschlägst. Um etwas beizutragen, "Forke" einfach dieses Archiv (bzw. "repository") und erstelle deine "Pull-Request", welche von anderen Entwicklern und Beiträgern überprüft wird. Bitte trage dich dabei in [`AUTHORS.txt`](https://github.com/acemod/ACE3/blob/master/AUTHORS.txt) mit deinem Nutzernamen und einer gütligen Email-Adresse ein.
-Um einen Fehler oder ein Feature zu melden bzw. ein bereits Bestehendes zu ändern - nutze unseren [Issue Tracker](https://github.com/acemod/ACE3/issues). Besuche auch:
+Um einen Fehler, Anregungen oder neue Funktionalitäten uns mitzuteilen: Nutze unseren [Issue Tracker](https://github.com/acemod/ACE3/issues). Besuche auch:
- [Wie kann ich ein Problem melden](http://ace3mod.com/wiki/user/how-to-report-an-issue.html)
-- [Wie kann ich ein Feature Request erstellen](http://ace3mod.com/wiki/user/how-to-make-a-feature-request.html)
+- [Wie kann ich ein Wunsch zu einer neuen Funktion mitteilen? ](http://ace3mod.com/wiki/user/how-to-make-a-feature-request.html)
#### Testen & MOD erstellen
Wenn du die neusten Entwicklungen erleben und uns dabei helfen möchtest bestehende Fehler zu entdecken, lade dir einfach die "Master Branch" herunter. Entweder nutzt du [Git](https://help.github.com/articles/fetching-a-remote/) - wenn die Schritte bekannt sind - oder du lädst es dir direkt über [diesen Link](https://github.com/acemod/ACE3/archive/master.zip) herunter.
From e056a3b2cdf773c59b2ef64f396076d923f7c88f Mon Sep 17 00:00:00 2001
From: licht-im-Norden87
Date: Sat, 3 Oct 2015 04:54:10 +0200
Subject: [PATCH 45/54] Update README_DE.md
---
docs/README_DE.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/README_DE.md b/docs/README_DE.md
index 23be2069d3..b08dddcc1e 100644
--- a/docs/README_DE.md
+++ b/docs/README_DE.md
@@ -59,8 +59,8 @@ Die Mod ist **modular gestaltet** — beinahe jede PBO kann entfernt werden, sod
- Verbesserte Interaktionen für AARs und Munitionsschlepper
- Einstellbare Zielfernrohre
- Keine Ruheanimationen bei gesenkter Waffe
-- No talking player avatar
- Über Hindernisse springen, über Mauern klettern, Zäune durchtrennen
+- Keine "sprechender Charkater"
- Vector IV, MicroDAGR und Kestrel
***und noch viel viel mehr...***
From 8cbd57309317a62ff8fe640ab1c226561ec27c38 Mon Sep 17 00:00:00 2001
From: licht-im-Norden87
Date: Thu, 8 Oct 2015 19:20:17 +0200
Subject: [PATCH 46/54] Update README_DE.md
---
docs/README_DE.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/README_DE.md b/docs/README_DE.md
index b08dddcc1e..4e09c46108 100644
--- a/docs/README_DE.md
+++ b/docs/README_DE.md
@@ -73,7 +73,7 @@ Wenn du bei der Entwicklung der MOD mithelfen möchtest kannst du dies tun, inde
Um einen Fehler, Anregungen oder neue Funktionalitäten uns mitzuteilen: Nutze unseren [Issue Tracker](https://github.com/acemod/ACE3/issues). Besuche auch:
- [Wie kann ich ein Problem melden](http://ace3mod.com/wiki/user/how-to-report-an-issue.html)
-- [Wie kann ich ein Wunsch zu einer neuen Funktion mitteilen? ](http://ace3mod.com/wiki/user/how-to-make-a-feature-request.html)
+- [Wie kann ich ein Wunsch zu einer neuen Funktion mitteilen?](http://ace3mod.com/wiki/user/how-to-make-a-feature-request.html)
#### Testen & MOD erstellen
Wenn du die neusten Entwicklungen erleben und uns dabei helfen möchtest bestehende Fehler zu entdecken, lade dir einfach die "Master Branch" herunter. Entweder nutzt du [Git](https://help.github.com/articles/fetching-a-remote/) - wenn die Schritte bekannt sind - oder du lädst es dir direkt über [diesen Link](https://github.com/acemod/ACE3/archive/master.zip) herunter.
From f7fe0c08e0af57d2529731d348b31ffd5e64caa6 Mon Sep 17 00:00:00 2001
From: PabstMirror
Date: Wed, 14 Oct 2015 11:15:44 -0500
Subject: [PATCH 47/54] #2391 - Use AGL for sitting setPos
---
addons/sitting/functions/fnc_sit.sqf | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/addons/sitting/functions/fnc_sit.sqf b/addons/sitting/functions/fnc_sit.sqf
index 5e9c36947e..b6c853f645 100644
--- a/addons/sitting/functions/fnc_sit.sqf
+++ b/addons/sitting/functions/fnc_sit.sqf
@@ -58,8 +58,8 @@ _sitRotation = if (isNumber (_configFile >> QGVAR(sitRotation))) then {getNumber
// Set direction and position
_player setDir _sitDirection;
-// No need for ATL/ASL as modelToWorld returns in format position
-_player setPos (_seat modelToWorld _sitPosition);
+//modelToWorld returns AGL
+_player setPosASL (AGLtoASL (_seat modelToWorld _sitPosition));
// Set variables
_player setVariable [QGVAR(isSitting), true];
From 38be666b37681affff13d2c8d4b286b8b5650447 Mon Sep 17 00:00:00 2001
From: KoffeinFlummi
Date: Fri, 16 Oct 2015 18:34:31 +0200
Subject: [PATCH 48/54] Use "flat-square" badge style
---
README.md | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/README.md b/README.md
index ecbc0dd01d..538dc09b08 100644
--- a/README.md
+++ b/README.md
@@ -3,25 +3,25 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
Requires the latest version of CBA A3 . Visit us on Facebook | YouTube | Twitter | Reddit
From b3032da51cb973d416709428eb68ac7554e09b8e Mon Sep 17 00:00:00 2001
From: bux578
Date: Sat, 17 Oct 2015 11:48:12 +0200
Subject: [PATCH 49/54] reorder badges, social networks
---
README.md | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/README.md b/README.md
index ecbc0dd01d..0089dca494 100644
--- a/README.md
+++ b/README.md
@@ -8,23 +8,24 @@
-
-
-
-
-
-
+
+
+
+
+
+
-Requires the latest version of CBA A3 . Visit us on Facebook | YouTube | Twitter | Reddit
+Requires the latest version of CBA A3 .
+Visit us on Twitter | Facebook | YouTube | Reddit
**ACE3** is a joint effort by the teams behind **ACE2**, **AGM** and **CSE** to improve the realism and authenticity of Arma 3.
@@ -43,6 +44,7 @@ The mod is **built modularly**, so almost any included PBO can be easily removed
- Captivity system
- Explosives system, including different trigger types
- Map screen improvements – marker placement and map tools
+- Logistics
- Advanced missile guidance and laser designation
#### Additional features
From 26c051d397b9d63213c82dd8015b5a23f6beadc2 Mon Sep 17 00:00:00 2001
From: PabstMirror
Date: Sun, 18 Oct 2015 11:48:21 -0500
Subject: [PATCH 50/54] Sitting - Fix missing semicolon
---
addons/sitting/CfgEventHandlers.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/addons/sitting/CfgEventHandlers.hpp b/addons/sitting/CfgEventHandlers.hpp
index da7efe1601..3481fa1fb5 100644
--- a/addons/sitting/CfgEventHandlers.hpp
+++ b/addons/sitting/CfgEventHandlers.hpp
@@ -22,7 +22,7 @@ class Extended_Killed_EventHandlers {
class Extended_InitPost_EventHandlers {
class ThingX {
class ADDON {
- init = QUOTE(_this call DFUNC(addSitActions))
+ init = QUOTE(_this call DFUNC(addSitActions));
};
};
};
From 602832cc0c0d3f0c9bdf43bd9b213ea96d6ab062 Mon Sep 17 00:00:00 2001
From: bux578
Date: Mon, 19 Oct 2015 07:29:02 +0200
Subject: [PATCH 51/54] adjust german translations
---
addons/captives/stringtable.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml
index 0e1714d225..0ab6cb457d 100644
--- a/addons/captives/stringtable.xml
+++ b/addons/captives/stringtable.xml
@@ -1,4 +1,4 @@
-
+
@@ -255,7 +255,7 @@
Require Players to surrender before they can be arrested
- Spieler müssen zunächst kapitulieren bevor sie gefangen genommen werden können.
+ Spieler müssen sich erst ergeben, bevor sie gefangen genommen werden können
Wymagaj od graczy kapitulacji zanim będzie można ich zaaresztować
Requer que jogadores se rendam antes de poderem ser presos
Требуется, чтобы игрок сдался в плен прежде, чем его можно будет связать
@@ -263,7 +263,7 @@
Surrendering only
- Nur Kapitulieren.
+ Nur Ergeben
Tylko kapitulacja
Somente rendição
Только сдавшийся в плен
@@ -271,7 +271,7 @@
Surrendering or No weapon
- Kapitulieren oder keine Waffe.
+ Ergeben oder keine Waffe
Kapitulacja lub brak broni
Rendição ou desarmado
Сдавшийся или безоружный
From a873481c361e9871c27a21f237d4e650a6072227 Mon Sep 17 00:00:00 2001
From: bux578
Date: Mon, 19 Oct 2015 07:37:14 +0200
Subject: [PATCH 52/54] improve german readme
---
docs/README_DE.md | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/docs/README_DE.md b/docs/README_DE.md
index 07af1a092c..dc571fe9b2 100644
--- a/docs/README_DE.md
+++ b/docs/README_DE.md
@@ -30,24 +30,24 @@
Da die MOD vollkommen als **open-source** Projekt gestaltet ist, steht es jedem frei Änderungen vorzuschlagen, oder seine eigene, modifizierte Version zu erstellen, solange diese ebenfalls der Öffentlichkeit zugänglich ist und mit GNU General Public License übereinstimmt. (Weitere Informationen ist der Lizenzdatei in diesem Projekt entnehmbar)
-Die Mod ist **modular gestaltet** — beinahe jede PBO kann entfernt werden, sodass jede Gemeinschaft ihre eigene Version der Mod unterhalten kann. Dies kann zum Beispiel einige Funktionalitäten ausschließen, da das Feature nicht gewünscht ist, oder es mit einer anderen MOD in Konflikt gerät etc..Ebenfalls können viele Einstellungen vom Missionsersteller vorgenommen werden (u.a. am Sanitätssystem), sodass eine individuelle Erfahrung gewährleistet werden kann.
+Die Mod ist **modular aufgebaut**. Beinahe jede PBO kann entfernt werden, sodass jede Gemeinschaft ihre eigene Version der Mod unterhalten kann. Dies kann zum Beispiel einige Funktionalitäten ausschließen, wenn gewisse Features nicht gewünscht sind, oder es mit einer anderen Mod in Konflikt gerät. Ebenfalls können viele Einstellungen vom Missionsersteller vorgenommen werden (u.a. am Sanitätssystem), sodass eine individuelle Erfahrung gewährleistet werden kann.
### Hauptmerkmale
-- Vollkommen neues 3D Interaktionssystem
+- Vollkommen neues 3D-Interaktionssystem
- Leistungs- und stabilitätsoptimiert
- Hauptmerkmal auf Modularität und individuelle Anpassungsmöglichkeiten
- Neue, flexible Spieler- und Servereinstellungen
-- Verbessertes Sanitätssystem mit unterschiedlichen Stufen (Basis/Erweitert) Spielbarkeit/Realismus
+- Verbessertes Sanitätssystem mit unterschiedlichen Stufen (Basis/Erweitert)
- Echte und stetige Wettersynchronisation
- Ballistik basierend auf vielen Faktoren u.a. Wetter und Wind
- Gefangenensystem
-- Sprengtoffmechaniken mit den unterschiedlichsten Zündern
-- Kartenverbesserungen – Setzen von Markierungen ; Kartenwerkzeuge
-- Erweitertes Raketenlenksystem
+- Sprengtoffmechaniken mit unterschiedlichen Zündern
+- Kartenverbesserungen – Setzen von Markierungen / Kartenwerkzeuge
+- Erweitertes Raketenlenksystem
#### Weitere Mechaniken
- Tragen und Ziehen
-- Waffen und Fahrzeuge tragen die Namen ihrer Vorbilder in der echten Welt
+- Waffen und Fahrzeuge tragen die Namen ihrer Vorbilder aus der echten Welt
- Ein Feuerleitsystem (FLS) für Hubschrauber und Panzer
- Viele Funktionen werden in C/C++ Erweiterungen berechnet
- Rückstrahlzonen- und Überdrucksimulation
@@ -55,11 +55,11 @@ Die Mod ist **modular gestaltet** — beinahe jede PBO kann entfernt werden, sod
- Realistische G-Kräfte
- Fahrzeuge abschließen
- Realistische Nacht- und Thermalsicht
-- Magazin umpacken
+- Magazine umpacken
- Realistische Waffen Er- bzw. Überhitzung
-- Temporäre Taubheit bei zu lauten Geräuschen
-- Verbesserte Ragdollphysik
-- Verbesserte Interaktionen für AARs und Munitionsschlepper
+- Temporäre Taubheit bei zu lauten Geräuschen
+- Verbesserte Ragdoll-Physik
+- Verbesserte Interaktionen für MG2s und Munitionsschlepper
- Einstellbare Zielfernrohre
- Keine Ruheanimationen bei gesenkter Waffe
- Über Hindernisse springen, über Mauern klettern, Zäune durchtrennen
@@ -72,12 +72,12 @@ Du hast ACE3 installiert, hast aber keine Ahnung was und wie alles funktioniert
- [Erste Schritte](http://ace3mod.com/wiki/user/getting-started.html).
#### Mitwirken
-Wenn du bei der Entwicklung der MOD mithelfen möchtest kannst du dies tun, indem du nach Fehlern Ausschau hältst oder neue Funktionen vorschlägst. Um etwas beizutragen, "Forke" einfach dieses Archiv (bzw. "repository") und erstelle deine "Pull-Request", welche von anderen Entwicklern und Beiträgern überprüft wird. Bitte trage dich dabei in [`AUTHORS.txt`](https://github.com/acemod/ACE3/blob/master/AUTHORS.txt) mit deinem Nutzernamen und einer gütligen Email-Adresse ein.
+Wenn du bei der Entwicklung von ACE3 mithelfen möchtest, kannst du dies tun, indem du nach Fehlern Ausschau hältst oder neue Funktionen vorschlägst. Um etwas beizutragen, "Forke" dieses Repository und erstelle deine "Pull-Requests", welche von anderen Entwicklern und Beiträgern überprüft werden. Bitte trage dich dabei in [`AUTHORS.txt`](https://github.com/acemod/ACE3/blob/master/AUTHORS.txt) mit deinem Nutzernamen und einer gültigen Email-Adresse ein.
-Um einen Fehler, Anregungen oder neue Funktionalitäten uns mitzuteilen: Nutze unseren [Issue Tracker](https://github.com/acemod/ACE3/issues). Besuche auch:
+Um uns einen Fehler, Anregungen oder neue Funktionalitäten mitzuteilen: Nutze unseren [Issue Tracker](https://github.com/acemod/ACE3/issues). Besuche auch:
- [Wie kann ich ein Problem melden](http://ace3mod.com/wiki/user/how-to-report-an-issue.html)
- [Wie kann ich ein Wunsch zu einer neuen Funktion mitteilen?](http://ace3mod.com/wiki/user/how-to-make-a-feature-request.html)
-#### Testen & MOD erstellen
-Wenn du die neusten Entwicklungen erleben und uns dabei helfen möchtest bestehende Fehler zu entdecken, lade dir einfach die "Master Branch" herunter. Entweder nutzt du [Git](https://help.github.com/articles/fetching-a-remote/) - wenn die Schritte bekannt sind - oder du lädst es dir direkt über [diesen Link](https://github.com/acemod/ACE3/archive/master.zip) herunter.
-Wie du deine eigene Entwicklungsumgebung und eine Testversion von ACE3 erstellst folge [dieser Anleitung](https://github.com/acemod/ACE3/blob/master/documentation/development/setting-up-the-development-environment.md).
+#### Testen & Mod erstellen
+Wenn du die neusten Entwicklungen erleben und uns dabei helfen möchtest bestehende Fehler zu entdecken, lade dir die "Master Branch" herunter. Entweder nutzt du [Git](https://help.github.com/articles/fetching-a-remote/) - wenn die Schritte bekannt sind - oder du lädst es dir direkt über [diesen Link](https://github.com/acemod/ACE3/archive/master.zip) herunter.
+Wie du deine eigene Entwicklungsumgebung und eine Testversion von ACE3 erstellst, folge [dieser Anleitung](https://github.com/acemod/ACE3/blob/master/documentation/development/setting-up-the-development-environment.md).
From c5fd41b9a1993677b62ac0766aabcb7ffa54af0f Mon Sep 17 00:00:00 2001
From: KoffeinFlummi
Date: Mon, 19 Oct 2015 09:44:40 +0200
Subject: [PATCH 53/54] Add flat badges to other READMEs
---
docs/README_DE.md | 14 +++++++-------
docs/README_PL.md | 14 +++++++-------
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/docs/README_DE.md b/docs/README_DE.md
index 24be427392..7fa29c7489 100644
--- a/docs/README_DE.md
+++ b/docs/README_DE.md
@@ -3,25 +3,25 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
Benötigt die aktuellste Version von CBA A3 . Besucht uns auf Facebook | YouTube | Twitter | Reddit
diff --git a/docs/README_PL.md b/docs/README_PL.md
index b12f574b6f..4d7f5d1e09 100644
--- a/docs/README_PL.md
+++ b/docs/README_PL.md
@@ -3,25 +3,25 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
Wymaga najnowszej wersji CBA A3 . Odwiedź nas na Facebook | YouTube | Twitter | Reddit
From 5db3f6111336418ff9759d86072659b4fae4a455 Mon Sep 17 00:00:00 2001
From: bux578
Date: Mon, 19 Oct 2015 10:59:48 +0200
Subject: [PATCH 54/54] add back the flat-square styles
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 0a13712be1..a407f5a299 100644
--- a/README.md
+++ b/README.md
@@ -10,10 +10,10 @@
-
+
-
+