diff --git a/README.md b/README.md index 77548f7ea4..42991161ed 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@
Requires the latest version of CBA A3 | BIF thread
-**ACE 3** is a join effort by the teams behind **ACE 2**, **AGM** and **CSE** to improve the realism and authenticity of Arma 3. +**ACE 3** is a joint effort by the teams behind **ACE 2**, **AGM** and **CSE** to improve the realism and authenticity of Arma 3. This mod is entirely **open-source**, and everyone is free to propose changes or maintain their own, customized version as long as they make their changes open to the public in accordance with the GNU General Public License (for more information check the license file attached to this project). diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 144194b96f..c71232a55a 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -19,6 +19,7 @@ PREP(ASLToPosition); PREP(beingCarried); PREP(binarizeNumber); PREP(blurScreen); +PREP(cachedCall); PREP(callCustomEventHandlers); PREP(callCustomEventHandlersGlobal); PREP(canGetInPosition); @@ -47,6 +48,7 @@ PREP(displayTextPicture); PREP(displayTextStructured); PREP(doAnimation); PREP(endRadioTransmission); +PREP(eraseCache); PREP(execNextFrame); PREP(execPersistentFnc); PREP(execRemoteFnc); @@ -109,6 +111,7 @@ PREP(insertionSort); PREP(interpolateFromArray); PREP(inTransitionAnim); PREP(inWater); +PREP(isAlive); PREP(isArrested); PREP(isAutoWind); PREP(isAwake); @@ -200,6 +203,9 @@ PREP(logDisplays); PREP(monitor); PREP(showUser); +PREP(dumpPerformanceCounters); +PREP(dumpArray); + // ACE_CuratorFix PREP(addCuratorUnloadEventhandler); PREP(fixCrateContent); @@ -228,6 +234,9 @@ PREP(hashListSelect); PREP(hashListSet); PREP(hashListPush); +//Debug +ACE_COUNTERS = []; + // Load settings if (isServer) then { call FUNC(loadSettingsOnServer); diff --git a/addons/common/functions/fnc_cachedCall.sqf b/addons/common/functions/fnc_cachedCall.sqf new file mode 100644 index 0000000000..0c9aafcfc8 --- /dev/null +++ b/addons/common/functions/fnc_cachedCall.sqf @@ -0,0 +1,30 @@ +/* + * Author: CAA-Picard and Jaynus + * Returns the result of the function and caches it up to a given time + * + * Arguments: + * 0: Parameters
+ * 2: Namespace to store the cache on
+ * 3: Cache uid
+ * 4: Max duration of the cache
+ *
+ * Return Value:
+ * Result of the function
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+EXPLODE_5_PVT(_this,_params,_function,_namespace,_uid,_duration);
+
+if (((_namespace getVariable [_uid, [-99999]]) select 0) < diag_tickTime) then {
+ _namespace setVariable [_uid, [diag_tickTime + _duration, _params call _function]];
+#ifdef DEBUG_MODE_FULL
+ diag_log format ["Calculated result: %1 %2", _namespace, _uid];
+} else {
+ diag_log format ["Cached result : %1 %2", _namespace, _uid];
+#endif
+};
+
+(_namespace getVariable _uid) select 1
diff --git a/addons/common/functions/fnc_dumpArray.sqf b/addons/common/functions/fnc_dumpArray.sqf
new file mode 100644
index 0000000000..a6f08cdd39
--- /dev/null
+++ b/addons/common/functions/fnc_dumpArray.sqf
@@ -0,0 +1,25 @@
+//fnc_dumpArray.sqf
+#include "script_component.hpp"
+
+private ["_var", "_depth", "_pad", "_i", "_x"];
+
+_var = _this select 0;
+_depth = _this select 1;
+_pad = "";
+for "_i" from 0 to _depth do {
+ _pad = _pad + toString [9];
+};
+_depth = _depth + 1;
+if(IS_ARRAY(_var)) then {
+ if((count _var) > 0) then {
+ diag_log text format["%1[", _pad];
+ {
+ [_x, _depth] call FUNC(dumpArray);
+ } forEach _var;
+ diag_log text format["%1],", _pad];
+ } else {
+ diag_log text format["%1[],", _pad];
+ };
+} else {
+ diag_log text format["%1%2", _pad, [_var] call FUNC(formatVar)];
+};
diff --git a/addons/common/functions/fnc_dumpPerformanceCounters.sqf b/addons/common/functions/fnc_dumpPerformanceCounters.sqf
new file mode 100644
index 0000000000..ded6514c9a
--- /dev/null
+++ b/addons/common/functions/fnc_dumpPerformanceCounters.sqf
@@ -0,0 +1,73 @@
+//fnc_dumpPerformanceCounters.sqf
+#define DEBUG_MODE_FULL
+#include "script_component.hpp"
+
+/*
+diag_log text format["REGISTERED ACE PFH HANDLERS"];
+diag_log text format["-------------------------------------------"];
+if(!isNil "ACE_PFH") then {
+ {
+ private["_pfh"];
+ _pfh = _x select 0;
+ diag_log text format["Registered PFH: id=%1, %1:%2", (_pfh select 0), (_pfh select 1), (_pfh select 2) ];
+ } forEach ACE_PFH;
+};*/
+
+diag_log text format["ACE COUNTER RESULTS"];
+diag_log text format["-------------------------------------------"];
+{
+ private["_counterEntry", "_iter", "_total", "_count", "_delta", "_averageResult"];
+ _counterEntry = _x;
+ _iter = 0;
+ _total = 0;
+ _count = 0;
+ _averageResult = 0;
+ if( (count _counterEntry) > 3) then {
+ // calc
+ {
+ if(_iter > 2) then {
+ _count = _count + 1;
+ _delta = (_x select 1) - (_x select 0);
+
+ _total = _total + _delta;
+ };
+ _iter = _iter + 1;
+ } forEach _counterEntry;
+
+ // results
+ _averageResult = (_total / _count) * 1000;
+
+ // dump results
+ diag_log text format["%1: Average: %2s / %3 = %4ms", (_counterEntry select 0), _total, _count, _averageResult];
+ } else {
+ diag_log text format["%1: No results", (_counterEntry select 0) ];
+ };
+} forEach ACE_COUNTERS;
+
+/*
+// Dump PFH Trackers
+diag_log text format["ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER"];
+diag_log text format["-------------------------------------------"];
+{
+ private["_delay"];
+ _delay = _x select 2;
+ //if(_delay > 0) then { _delay = _delay / 1000; };
+
+ diag_log text format["%1: %2s, delay=%3, handle=%4",(_x select 0), _delay, (_x select 3), (_x select 4)];
+} forEach ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER;
+
+// Dump PFH Trackers
+diag_log text format["ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER"];
+diag_log text format["-------------------------------------------"];
+{
+ private["_delta"];
+ _delta = _x select 1;
+ //if(_delta > 0) then { _delta = _delta / 1000; };
+ diag_log text format[" DELTA: %1s", _delta];
+} forEach ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER;
+
+//{
+//
+//} forEach ACRE_EXCESSIVE_FRAME_TRACKER;
+
+*/
\ No newline at end of file
diff --git a/addons/common/functions/fnc_eraseCache.sqf b/addons/common/functions/fnc_eraseCache.sqf
new file mode 100644
index 0000000000..00f49f4833
--- /dev/null
+++ b/addons/common/functions/fnc_eraseCache.sqf
@@ -0,0 +1,18 @@
+/*
+ * Author: CAA-Picard
+ * Deletes a cached result
+ *
+ * Arguments:
+ * 0: Namespace to store the cache on
+ * 1: Cache uid
+ *
+ * Return Value:
+ * None
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+EXPLODE_2_PVT(_this,_namespace,_uid);
+
+_namespace setVariable [_uid, nil];
diff --git a/addons/common/functions/fnc_isAlive.sqf b/addons/common/functions/fnc_isAlive.sqf
new file mode 100644
index 0000000000..1d5a99ac6b
--- /dev/null
+++ b/addons/common/functions/fnc_isAlive.sqf
@@ -0,0 +1,14 @@
+/*
+ * Author: commy2
+ *
+ * Check if the object still exists and is alive. This function exists because 'alive objNull' actually returns true.
+ *
+ * Argument:
+ * 0: Any object (Object)
+ *
+ * Return value:
+ * The object exists and is alive (Bool).
+ */
+#include "script_component.hpp"
+
+!isNull (_this select 0) && {alive (_this select 0)}
diff --git a/addons/goggles/XEH_postInit.sqf b/addons/goggles/XEH_postInit.sqf
index d73ac0a850..ee62dfdd66 100644
--- a/addons/goggles/XEH_postInit.sqf
+++ b/addons/goggles/XEH_postInit.sqf
@@ -26,7 +26,7 @@ if (!hasInterface) exitWith {};
false
},
{false},
-[20, true, true, false], false] call CALLSTACK(cba_fnc_addKeybind);
+[20, [true, true, false]], false] call cba_fnc_addKeybind;
if isNil(QGVAR(UsePP)) then {
GVAR(UsePP) = true;
diff --git a/addons/interact_menu/XEH_preInit.sqf b/addons/interact_menu/XEH_preInit.sqf
index d3ea2451b9..487f1c017f 100644
--- a/addons/interact_menu/XEH_preInit.sqf
+++ b/addons/interact_menu/XEH_preInit.sqf
@@ -3,6 +3,7 @@
ADDON = false;
PREP(addAction);
+PREP(addClassAction);
PREP(compileMenu);
PREP(compileMenuSelfAction);
PREP(collectActiveActionTree);
@@ -11,6 +12,7 @@ PREP(keyDownSelfAction);
PREP(keyUp);
PREP(keyUpSelfAction);
PREP(removeAction);
+PREP(removeClassAction);
PREP(render);
PREP(renderIcon);
PREP(renderBaseMenu);
@@ -23,7 +25,8 @@ GVAR(keyDownTime) = 0;
GVAR(lastTime) = diag_tickTime;
GVAR(rotationAngle) = 0;
-GVAR(selectedAction) = {};
+GVAR(selectedAction) = [[],[]];
+GVAR(selectedStatement) = {};
GVAR(actionSelected) = false;
GVAR(selectedTarget) = objNull;
diff --git a/addons/interact_menu/functions/fnc_addAction.sqf b/addons/interact_menu/functions/fnc_addAction.sqf
index 136205766e..c7dd6ecab3 100644
--- a/addons/interact_menu/functions/fnc_addAction.sqf
+++ b/addons/interact_menu/functions/fnc_addAction.sqf
@@ -13,6 +13,7 @@
* 6: Statement
* 7: Condition
* 8: Distance
+ * 9: Other parameters (Optional)
*
* Return value:
* The entry full path, which can be used to remove the entry, or add children entries .
@@ -26,7 +27,7 @@
EXPLODE_9_PVT(_this,_object,_typeNum,_fullPath,_displayName,_icon,_position,_statement,_condition,_distance);
-private ["_varName","_actions"];
+private ["_varName","_actions","_params","_entry"];
_varName = [QGVAR(actions),QGVAR(selfActions)] select _typeNum;
_actions = _object getVariable [_varName, []];
@@ -34,7 +35,11 @@ if((count _actions) == 0) then {
_object setVariable [_varName, _actions];
};
-private "_entry";
+_params = [false,false,false,false];
+if (count _this > 9) then {
+ _params = _this select 9;
+};
+
_entry = [
[
_displayName,
@@ -43,7 +48,7 @@ _entry = [
_statement,
_condition,
_distance,
- [false,false,false],
+ _params,
+ _fullPath
],
[]
diff --git a/addons/interact_menu/functions/fnc_addClassAction.sqf b/addons/interact_menu/functions/fnc_addClassAction.sqf
new file mode 100644
index 0000000000..5916edbfbc
--- /dev/null
+++ b/addons/interact_menu/functions/fnc_addClassAction.sqf
@@ -0,0 +1,87 @@
+/*
+ * Author: CAA-Picard
+ * Add an ACE action to a class, under a certain path
+ * Note: This function is NOT global.
+ *
+ * Argument:
+ * 0: TypeOf of the class
+ * 1: Type of action, 0 for actions, 1 for self-actions
+ * 2: Full path of the new action
+ * 3: Name of the action shown in the menu
+ * 4: Icon
+ * 5: Position (Position or Selection Name) or
+ * 6: Statement
+ * 7: Condition
+ * 8: Distance
+ * 9: Other parameters (Optional)
+ *
+ * Return value:
+ * The entry full path, which can be used to remove the entry, or add children entries .
+ *
+ * Example:
+ * [typeOf cursorTarget, 0,["ACE_TapShoulderRight","VulcanPinch"],"Vulcan Pinch","",[0,0,0],{_target setDamage 1;},{true},100] call ace_interact_menu_fnc_addClassAction;
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+EXPLODE_9_PVT(_this,_objectType,_typeNum,_fullPath,_displayName,_icon,_position,_statement,_condition,_distance);
+
+private ["_varName","_actions","_params","_entry", "_parentLevel", "_foundParentLevel", "_fnc_findFolder"];
+
+_varName = format [[QGVAR(Act_%1), QGVAR(SelfAct_%1)] select _typeNum, _objectType];
+_actions = missionNamespace getVariable [_varName, []];
+if((count _actions) == 0) then {
+ missionNamespace setVariable [_varName, _actions];
+};
+
+_params = [false,false,false,false];
+if (count _this > 9) then {
+ _params = _this select 9;
+};
+
+// Search the class action trees and find where to insert the entry
+_parentLevel = _actions;
+_foundParentLevel = false;
+
+_fnc_findFolder = {
+ EXPLODE_3_PVT(_this,_fullPath,_level,_classActions);
+
+ if (count _fullPath == _level + 1) then {
+ _parentLevel = _classActions;
+ _foundParentLevel = true;
+ };
+
+ if (_foundParentLevel) exitWith {};
+
+ {
+ EXPLODE_2_PVT(_x,_actionData,_actionChildren);
+ if (((_actionData select 7) select _level) isEqualTo (_fullPath select _level)) exitWith {
+ // The action should go somewhere in here
+ [_fullPath, _level + 1, _actionChildren] call _fnc_findFolder;
+ };
+ } forEach _classActions;
+};
+
+[_fullPath, 0, _actions] call _fnc_findFolder;
+
+// Exit if there's no entry point to insert this action
+if (!_foundParentLevel) exitWith {};
+
+_entry = [
+ [
+ _displayName,
+ _icon,
+ _position,
+ _statement,
+ _condition,
+ _distance,
+ _params,
+ + _fullPath
+ ],
+ []
+ ];
+
+_parentLevel pushBack _entry;
+
+_fullPath
diff --git a/addons/interact_menu/functions/fnc_compileMenu.sqf b/addons/interact_menu/functions/fnc_compileMenu.sqf
index c2ebac5034..d509f5abc8 100644
--- a/addons/interact_menu/functions/fnc_compileMenu.sqf
+++ b/addons/interact_menu/functions/fnc_compileMenu.sqf
@@ -24,7 +24,7 @@ if !(isNil {missionNamespace getVariable [_actionsVarName, nil]}) exitWith {};
private "_recurseFnc";
_recurseFnc = {
private ["_actions", "_displayName", "_distance", "_icon", "_statement", "_selection", "_condition", "_showDisabled",
- "_enableInside", "_children", "_entry", "_entryCfg", "_fullPath"];
+ "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_fullPath"];
EXPLODE_2_PVT(_this,_actionsCfg,_parentPath);
_actions = [];
@@ -48,6 +48,7 @@ _recurseFnc = {
_showDisabled = (getNumber (_entryCfg >> "showDisabled")) > 0;
_enableInside = (getNumber (_entryCfg >> "enableInside")) > 0;
_canCollapse = (getNumber (_entryCfg >> "canCollapse")) > 0;
+ _runOnHover = (getNumber (_entryCfg >> "runOnHover")) > 0;
_fullPath = (+ _parentPath);
_fullPath pushBack (configName _entryCfg);
@@ -63,7 +64,7 @@ _recurseFnc = {
_statement,
_condition,
_distance,
- [_showDisabled,_enableInside,_canCollapse],
+ [_showDisabled,_enableInside,_canCollapse,_runOnHover],
_fullPath
],
_children
diff --git a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf
index 0dd82e5178..42b76785f5 100644
--- a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf
+++ b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf
@@ -24,7 +24,7 @@ if !(isNil {missionNamespace getVariable [_actionsVarName, nil]}) exitWith {};
private "_recurseFnc";
_recurseFnc = {
private ["_actions", "_displayName", "_distance", "_icon", "_statement", "_selection", "_condition", "_showDisabled",
- "_enableInside", "_children", "_entry", "_entryCfg", "_fullPath"];
+ "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_fullPath"];
EXPLODE_2_PVT(_this,_actionsCfg,_parentPath);
_actions = [];
@@ -45,6 +45,7 @@ _recurseFnc = {
_showDisabled = (getNumber (_entryCfg >> "showDisabled")) > 0;
_enableInside = (getNumber (_entryCfg >> "enableInside")) > 0;
_canCollapse = (getNumber (_entryCfg >> "canCollapse")) > 0;
+ _runOnHover = (getNumber (_entryCfg >> "runOnHover")) > 0;
_fullPath = (+ _parentPath);
_fullPath pushBack (configName _entryCfg);
@@ -60,7 +61,7 @@ _recurseFnc = {
_statement,
_condition,
10, //distace
- [_showDisabled,_enableInside,_canCollapse],
+ [_showDisabled,_enableInside,_canCollapse,_runOnHover],
_fullPath
],
_children
diff --git a/addons/interact_menu/functions/fnc_keyUp.sqf b/addons/interact_menu/functions/fnc_keyUp.sqf
index b2b5f35547..70e7438125 100644
--- a/addons/interact_menu/functions/fnc_keyUp.sqf
+++ b/addons/interact_menu/functions/fnc_keyUp.sqf
@@ -12,13 +12,18 @@
*/
#include "script_component.hpp"
-GVAR(keyDown) = false;
if(GVAR(actionSelected)) then {
this = GVAR(selectedTarget);
_player = ACE_Player;
_target = GVAR(selectedTarget);
- [GVAR(selectedTarget), ACE_player] call GVAR(selectedAction);
+ [GVAR(selectedTarget), ACE_player] call GVAR(selectedStatement);
};
+
+if (GVAR(keyDown)) then {
+ GVAR(keyDown) = false;
+ ["interactMenuClosed", [0]] call FUNC(localEvent);
+};
+
GVAR(expanded) = false;
GVAR(lastPath) = [];
GVAR(menuDepthPath) = [];
diff --git a/addons/interact_menu/functions/fnc_keyUpSelfAction.sqf b/addons/interact_menu/functions/fnc_keyUpSelfAction.sqf
index 0f784e640b..924fd4cca6 100644
--- a/addons/interact_menu/functions/fnc_keyUpSelfAction.sqf
+++ b/addons/interact_menu/functions/fnc_keyUpSelfAction.sqf
@@ -16,13 +16,18 @@ if (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]) then {
closeDialog 0;
};
-GVAR(keyDownSelfAction) = false;
if(GVAR(actionSelected)) then {
this = GVAR(selectedTarget);
_player = ACE_Player;
_target = GVAR(selectedTarget);
- [GVAR(selectedTarget), ACE_player] call GVAR(selectedAction);
+ [GVAR(selectedTarget), ACE_player] call GVAR(selectedStatement);
};
+
+if (GVAR(keyDownSelfAction)) then {
+ GVAR(keyDownSelfAction) = false;
+ ["interactMenuClosed", [1]] call FUNC(localEvent);
+};
+
GVAR(expanded) = false;
GVAR(lastPath) = [];
GVAR(menuDepthPath) = [];
diff --git a/addons/interact_menu/functions/fnc_removeClassAction.sqf b/addons/interact_menu/functions/fnc_removeClassAction.sqf
new file mode 100644
index 0000000000..9ba29cd357
--- /dev/null
+++ b/addons/interact_menu/functions/fnc_removeClassAction.sqf
@@ -0,0 +1,72 @@
+/*
+ * Author: CAA-Picard
+ * Removes a class action from a class
+ * Note: This function is NOT global.
+ *
+ * Argument:
+ * 0: TypeOf of the class
+ * 1: Type of action, 0 for actions, 1 for self-actions
+ * 2: Full path of the new action
+ *
+ * Return value:
+ * None
+ *
+ * Example:
+ * [typeOf cursorTarget, 0,["ACE_TapShoulderRight","VulcanPinch"]] call ace_interact_menu_fnc_removeClassAction;
+ *
+ * Public: No
+ */
+#include "script_component.hpp"
+
+EXPLODE_3_PVT(_this,_objectType,_typeNum,_fullPath);
+
+private ["_varName","_actions","_parentLevel", "_actionIndex", "_foundAction", "_fnc_findFolder"];
+
+_varName = format [[QGVAR(Act_%1), QGVAR(SelfAct_%1)] select _typeNum, _objectType];
+_actions = missionNamespace getVariable [_varName, []];
+
+// Search the class action trees and find where to insert the entry
+_parentLevel = _actions;
+_actionIndex = -1;
+_foundAction = false;
+
+_fnc_findFolder = {
+ EXPLODE_3_PVT(_this,_fullPath,_level,_classActions);
+
+ if (count _fullPath == _level + 1) then {
+ _parentLevel = _classActions;
+ };
+
+ {
+ EXPLODE_2_PVT(_x,_actionData,_actionChildren);
+ if (((_actionData select 7) select _level) isEqualTo (_fullPath select _level)) exitWith {
+ if (_level + 1 == count _fullPath) exitWith {
+ _actionIndex = _forEachIndex;
+ _foundAction = true;
+ };
+ [_fullPath, _level + 1, _actionChildren] call _fnc_findFolder;
+ };
+ if (_foundAction) exitWith {};
+ } forEach _classActions;
+};
+
+[_fullPath, 0, _actions] call _fnc_findFolder;
+
+// Exit if the action was not found
+if (!_foundAction) exitWith {};
+
+_entry = [
+ [
+ _displayName,
+ _icon,
+ _position,
+ _statement,
+ _condition,
+ _distance,
+ _params,
+ + _fullPath
+ ],
+ []
+ ];
+
+_parentLevel deleteAt _actionIndex;
diff --git a/addons/interact_menu/functions/fnc_render.sqf b/addons/interact_menu/functions/fnc_render.sqf
index f5723f0c5d..3930068c25 100644
--- a/addons/interact_menu/functions/fnc_render.sqf
+++ b/addons/interact_menu/functions/fnc_render.sqf
@@ -143,7 +143,9 @@ if(GVAR(keyDown) || GVAR(keyDownSelfAction)) then {
_foundTarget = true;
GVAR(actionSelected) = true;
GVAR(selectedTarget) = (_closest select 0) select 0;
- GVAR(selectedAction) = (((_closest select 0) select 1) select 0) select 3;
+ GVAR(selectedAction) = (_closest select 0) select 1;
+ GVAR(selectedStatement) = ((GVAR(selectedAction)) select 0) select 3;
+
_misMatch = false;
_hoverPath = (_closest select 2);
@@ -165,6 +167,16 @@ if(GVAR(keyDown) || GVAR(keyDownSelfAction)) then {
if(!GVAR(expanded) && diag_tickTime-GVAR(startHoverTime) > 0.25) then {
GVAR(expanded) = true;
GVAR(menuDepthPath) = +GVAR(lastPath);
+
+ // Execute the current action if it's run on hover
+ private "_runOnHover";
+ _runOnHover = ((GVAR(selectedAction) select 0) select 6) select 3;
+ if (_runOnHover) then {
+ this = GVAR(selectedTarget);
+ _player = ACE_Player;
+ _target = GVAR(selectedTarget);
+ [GVAR(selectedTarget), ACE_player] call GVAR(selectedStatement);
+ };
};
};
};
diff --git a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf
index 7ff430fa08..e3a8a0c9a4 100644
--- a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf
+++ b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf
@@ -58,8 +58,14 @@ if ((_sPos select 1) < safeZoneY || (_sPos select 1) > safeZoneY + safeZon
// Collect active tree
-// @todo: cache activeActionTree?
-_activeActionTree = ([_object, _baseAction] call FUNC(collectActiveActionTree));
+private "_uid";
+_uid = format [QGVAR(ATCache_%1), (_actionData select 7) select 0];
+_activeActionTree = [
+ [_object, _baseAction],
+ DFUNC(collectActiveActionTree),
+ _object, _uid, 0.2
+ ] call EFUNC(common,cachedCall);
+
// Check if there's something left for rendering
if (count _activeActionTree == 0) exitWith {false};
diff --git a/addons/interaction/XEH_clientInit.sqf b/addons/interaction/XEH_clientInit.sqf
index 89001b0039..0e05014cf7 100644
--- a/addons/interaction/XEH_clientInit.sqf
+++ b/addons/interaction/XEH_clientInit.sqf
@@ -22,37 +22,22 @@ GVAR(isOpeningDoor) = false;
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
- if !(!GVAR(isOpeningDoor) &&
- {[2] call FUNC(getDoor) select 1 != ''}
- ) exitWith {false};
+ if (GVAR(isOpeningDoor) || {[2] call FUNC(getDoor) select 1 == ''}) exitWith {false};
// Statement
call EFUNC(interaction,openDoor);
true
},
-{},
-[57, [false, true, false]], false] call cba_fnc_addKeybind;
-
-["ACE3",
-localize "STR_ACE_Interaction_OpenDoor",
{
- // Conditions: canInteract
- _exceptions = [];
- if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
- // Conditions: specific
- if !(GVAR(isOpeningDoor)) exitWith {false};
-
+ //Probably don't want any condidtions here, so variable never gets locked down
// Statement
GVAR(isOpeningDoor) = false;
true
},
-[57, [false, true, false]],
-false,
-"keyup"
-] call cba_fnc_registerKeybind;
+[57, [false, true, false]], false] call cba_fnc_addKeybind; //Key CTRL+Space
-["ACE3",
-localize "STR_ACE_Interaction_TapShoulder",
+
+["ACE3", QGVAR(tapShoulder), localize "STR_ACE_Interaction_TapShoulder",
{
// Conditions: canInteract
_exceptions = [];
@@ -64,13 +49,10 @@ localize "STR_ACE_Interaction_TapShoulder",
[ACE_player, cursorTarget] call FUNC(tapShoulder);
true
},
-[20, [true, false, false]],
-false,
-"keydown"
-] call cba_fnc_registerKeybind;
+{false},
+[20, [true, false, false]], false] call cba_fnc_addKeybind;
-["ACE3",
-localize "STR_ACE_Interaction_ModifierKey",
+["ACE3", QGVAR(modifierKey), localize "STR_ACE_Interaction_ModifierKey",
{
// Conditions: canInteract
_exceptions = ["ACE_Drag_isNotDragging"];
@@ -81,24 +63,9 @@ localize "STR_ACE_Interaction_ModifierKey",
// Return false so it doesn't block other actions
false
},
-[29, [false, false, false]],
-false,
-"keydown"
-] call cba_fnc_registerKeybind;
-
-["ACE3",
-localize "STR_ACE_Interaction_ModifierKey",
{
- // Conditions: canInteract
- _exceptions = ["ACE_Drag_isNotDragging"];
- if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
-
- // Statement
+ //Probably don't want any condidtions here, so variable never gets locked down
ACE_Modifier = 0;
- // Return false so it doesn't block other actions
- false
+ false;
},
-[29, [false, false, false]],
-false,
-"keyup"
-] call cba_fnc_registerKeybind;
+[29, [false, false, false]], false] call cba_fnc_addKeybind;
diff --git a/addons/interaction/functions/fnc_openDoor.sqf b/addons/interaction/functions/fnc_openDoor.sqf
index d8cd8b0693..616538a6ff 100644
--- a/addons/interaction/functions/fnc_openDoor.sqf
+++ b/addons/interaction/functions/fnc_openDoor.sqf
@@ -47,7 +47,7 @@ playSound "ACE_Sound_Click";
!GVAR(isOpeningDoor) || {getPosASL ACE_player distance _position > 1}
};
- if (!_usedMouseWheel && {time < _time}) then {
+ if (!_usedMouseWheel && {time < _time} && {[] call EGVAR(common,canInteract)}) then {
_phase = [0, 1] select (_house animationPhase (_animations select 0) < 0.5);
{_house animate [_x, _phase]} forEach _animations;
diff --git a/addons/main/script_debug.hpp b/addons/main/script_debug.hpp
new file mode 100644
index 0000000000..642de3428d
--- /dev/null
+++ b/addons/main/script_debug.hpp
@@ -0,0 +1,46 @@
+/**
+STACK TRACING
+**/
+//#define ENABLE_CALLSTACK
+
+#ifdef ENABLE_CALLSTACK
+
+#define CALLSTACK(function) {private ['_ret']; if(ACE_IS_ERRORED) then { ['AUTO','AUTO'] call ACE_DUMPSTACK_FNC; ACE_IS_ERRORED = false; }; ACE_IS_ERRORED = true; ACE_STACK_TRACE set [ACE_STACK_DEPTH, [diag_tickTime, __FILE__, __LINE__, ACE_CURRENT_FUNCTION, 'ANON', _this]]; ACE_STACK_DEPTH = ACE_STACK_DEPTH + 1; ACE_CURRENT_FUNCTION = 'ANON'; _ret = _this call ##function; ACE_STACK_DEPTH = ACE_STACK_DEPTH - 1; ACE_IS_ERRORED = false; _ret;}
+#define CALLSTACK_NAMED(function, functionName) {private ['_ret']; if(ACE_IS_ERRORED) then { ['AUTO','AUTO'] call ACE_DUMPSTACK_FNC; ACE_IS_ERRORED = false; }; ACE_IS_ERRORED = true; ACE_STACK_TRACE set [ACE_STACK_DEPTH, [diag_tickTime, __FILE__, __LINE__, ACE_CURRENT_FUNCTION, functionName, _this]]; ACE_STACK_DEPTH = ACE_STACK_DEPTH + 1; ACE_CURRENT_FUNCTION = functionName; _ret = _this call ##function; ACE_STACK_DEPTH = ACE_STACK_DEPTH - 1; ACE_IS_ERRORED = false; _ret;}
+#define DUMPSTACK ([__FILE__, __LINE__] call ACE_DUMPSTACK_FNC)
+
+#define FUNC(var1) {private ['_ret']; if(ACE_IS_ERRORED) then { ['AUTO','AUTO'] call ACE_DUMPSTACK_FNC; ACE_IS_ERRORED = false; }; ACE_IS_ERRORED = true; ACE_STACK_TRACE set [ACE_STACK_DEPTH, [diag_tickTime, __FILE__, __LINE__, ACE_CURRENT_FUNCTION, 'TRIPLES(ADDON,fnc,var1)', _this]]; ACE_STACK_DEPTH = ACE_STACK_DEPTH + 1; ACE_CURRENT_FUNCTION = 'TRIPLES(ADDON,fnc,var1)'; _ret = _this call TRIPLES(ADDON,fnc,var1); ACE_STACK_DEPTH = ACE_STACK_DEPTH - 1; ACE_IS_ERRORED = false; _ret;}
+#define EFUNC(var1,var2) {private ['_ret']; if(ACE_IS_ERRORED) then { ['AUTO','AUTO'] call ACE_DUMPSTACK_FNC; ACE_IS_ERRORED = false; }; ACE_IS_ERRORED = true; ACE_STACK_TRACE set [ACE_STACK_DEPTH, [diag_tickTime, __FILE__, __LINE__, ACE_CURRENT_FUNCTION, 'TRIPLES(DOUBLES(PREFIX,var1),fnc,var2)', _this]]; ACE_STACK_DEPTH = ACE_STACK_DEPTH + 1; ACE_CURRENT_FUNCTION = 'TRIPLES(DOUBLES(PREFIX,var1),fnc,var2)'; _ret = _this call TRIPLES(DOUBLES(PREFIX,var1),fnc,var2); ACE_STACK_DEPTH = ACE_STACK_DEPTH - 1; ACE_IS_ERRORED = false; _ret;}
+
+#else
+#define CALLSTACK(function) function
+#define CALLSTACK_NAMED(function, functionName) function
+#define DUMPSTACK
+
+#define FUNC(var1) TRIPLES(ADDON,fnc,var1)
+#define EFUNC(var1,var2) TRIPLES(DOUBLES(PREFIX,var1),fnc,var2)
+
+#endif
+
+
+/**
+PERFORMANCE COUNTERS SECTION
+**/
+//#define ENABLE_PERFORMANCE_COUNTERS
+
+#ifdef ENABLE_PERFORMANCE_COUNTERS
+ #define ADDPFH(function, timing, args) call { _ret = [function, timing, args, #function] call EFUNC(sys_sync,perFrame_add); if(isNil "ACE_PFH" ) then { ACE_PFH=[]; }; ACE_PFH pushBack [[_ret, __FILE__, __LINE__], [function, timing, args]]; _ret }
+
+ #define CREATE_COUNTER(x) if(isNil "ACE_COUNTERS" ) then { ACE_COUNTERS=[]; }; GVAR(DOUBLES(x,counter))=[]; GVAR(DOUBLES(x,counter)) set[0, QUOTE(GVAR(DOUBLES(x,counter)))]; GVAR(DOUBLES(x,counter)) set[1, diag_tickTime]; ACE_COUNTERS pushBack GVAR(DOUBLES(x,counter));
+ #define BEGIN_COUNTER(x) if(isNil QUOTE(GVAR(DOUBLES(x,counter)))) then { CREATE_COUNTER(x) }; GVAR(DOUBLES(x,counter)) set[2, diag_tickTime];
+ #define END_COUNTER(x) GVAR(DOUBLES(x,counter)) pushBack [(GVAR(DOUBLES(x,counter)) select 2), diag_tickTime];
+
+ #define DUMP_COUNTERS ([__FILE__, __LINE__] call ACE_DUMPCOUNTERS_FNC)
+#else
+ #define ADDPFH(function, timing, args) [function, timing, args, #function] call EFUNC(sys_sync,perFrame_add)
+
+ #define CREATE_COUNTER(x) /* disabled */
+ #define BEGIN_COUNTER(x) /* disabled */
+ #define END_COUNTER(x) /* disabled */
+ #define DUMP_COUNTERS /* disabled */
+#endif
\ No newline at end of file
diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp
index cc589aac3e..33f1037905 100644
--- a/addons/main/script_macros.hpp
+++ b/addons/main/script_macros.hpp
@@ -223,26 +223,6 @@
#define PREP_MODULE(folder) [] call compile preprocessFileLineNumbers QUOTE(PATHTOF(folder\__PREP__.sqf))
-
-#ifdef ENABLE_CALLSTACK
-#define CALLSTACK(function) {private ['_ret']; if(ACE_IS_ERRORED) then { ['AUTO','AUTO'] call ACE_DUMPSTACK_FNC; ACE_IS_ERRORED = false; }; ACE_IS_ERRORED = true; ACE_STACK_TRACE set [ACE_STACK_DEPTH, [diag_tickTime, __FILE__, __LINE__, ACE_CURRENT_FUNCTION, 'ANON', _this]]; ACE_STACK_DEPTH = ACE_STACK_DEPTH + 1; ACE_CURRENT_FUNCTION = 'ANON'; _ret = _this call ##function; ACE_STACK_DEPTH = ACE_STACK_DEPTH - 1; ACE_IS_ERRORED = false; _ret;}
-#define CALLSTACK_NAMED(function, functionName) {private ['_ret']; if(ACE_IS_ERRORED) then { ['AUTO','AUTO'] call ACE_DUMPSTACK_FNC; ACE_IS_ERRORED = false; }; ACE_IS_ERRORED = true; ACE_STACK_TRACE set [ACE_STACK_DEPTH, [diag_tickTime, __FILE__, __LINE__, ACE_CURRENT_FUNCTION, functionName, _this]]; ACE_STACK_DEPTH = ACE_STACK_DEPTH + 1; ACE_CURRENT_FUNCTION = functionName; _ret = _this call ##function; ACE_STACK_DEPTH = ACE_STACK_DEPTH - 1; ACE_IS_ERRORED = false; _ret;}
-#define DUMPSTACK ([__FILE__, __LINE__] call ACE_DUMPSTACK_FNC)
-
-#define FUNC(var1) {private ['_ret']; if(ACE_IS_ERRORED) then { ['AUTO','AUTO'] call ACE_DUMPSTACK_FNC; ACE_IS_ERRORED = false; }; ACE_IS_ERRORED = true; ACE_STACK_TRACE set [ACE_STACK_DEPTH, [diag_tickTime, __FILE__, __LINE__, ACE_CURRENT_FUNCTION, 'TRIPLES(ADDON,fnc,var1)', _this]]; ACE_STACK_DEPTH = ACE_STACK_DEPTH + 1; ACE_CURRENT_FUNCTION = 'TRIPLES(ADDON,fnc,var1)'; _ret = _this call TRIPLES(ADDON,fnc,var1); ACE_STACK_DEPTH = ACE_STACK_DEPTH - 1; ACE_IS_ERRORED = false; _ret;}
-#define EFUNC(var1,var2) {private ['_ret']; if(ACE_IS_ERRORED) then { ['AUTO','AUTO'] call ACE_DUMPSTACK_FNC; ACE_IS_ERRORED = false; }; ACE_IS_ERRORED = true; ACE_STACK_TRACE set [ACE_STACK_DEPTH, [diag_tickTime, __FILE__, __LINE__, ACE_CURRENT_FUNCTION, 'TRIPLES(DOUBLES(PREFIX,var1),fnc,var2)', _this]]; ACE_STACK_DEPTH = ACE_STACK_DEPTH + 1; ACE_CURRENT_FUNCTION = 'TRIPLES(DOUBLES(PREFIX,var1),fnc,var2)'; _ret = _this call TRIPLES(DOUBLES(PREFIX,var1),fnc,var2); ACE_STACK_DEPTH = ACE_STACK_DEPTH - 1; ACE_IS_ERRORED = false; _ret;}
-
-#else
-#define CALLSTACK(function) function
-#define CALLSTACK_NAMED(function, functionName) function
-#define DUMPSTACK
-
-#define FUNC(var1) TRIPLES(ADDON,fnc,var1)
-#define EFUNC(var1,var2) TRIPLES(DOUBLES(PREFIX,var1),fnc,var2)
-
-#endif
-
-
#define HASH_CREATE ([] call EFUNC(common,hashCreate))
#define HASH_SET(hash, key, val) ([hash, key, val, __FILE__, __LINE__] call EFUNC(common,hashSet))
#define HASH_GET(hash, key) ([hash, key, __FILE__, __LINE__] call EFUNC(common,hashGet))
@@ -254,3 +234,5 @@
#define HASHLIST_SELECT(hashList, index) ([hashList, index, __FILE__, __LINE__] call EFUNC(common,hashListSelect))
#define HASHLIST_SET(hashList, index, value) ([hashList, index, value, __FILE__, __LINE__] call EFUNC(common,hashListSet))
#define HASHLIST_PUSH(hashList, value) ([hashList, value, __FILE__, __LINE__] call EFUNC(common,hashListPush))
+
+#include "script_debug.hpp"
\ No newline at end of file
diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp
index 600a85a1bf..a15167f820 100644
--- a/addons/medical/CfgVehicles.hpp
+++ b/addons/medical/CfgVehicles.hpp
@@ -347,7 +347,8 @@ class CfgVehicles {
class ACE_Actions {
class ACE_Head {
- statement = QUOTE([ARR_3(_target, true, 0)] call DEFUNC(displayPatientInformation));
+ runOnHover = 1;
+ statement = QUOTE([ARR_3(_target, true, 0)] call DFUNC(displayPatientInformation));
class Bandage_Head {
displayName = "Bandage Head";
@@ -406,7 +407,8 @@ class CfgVehicles {
displayName = "Medical";
distance = 5.0;
condition = "true";
- statement = QUOTE([ARR_3(_target, true, 1)] call DEFUNC(displayPatientInformation));
+ runOnHover = 1;
+ statement = QUOTE([ARR_3(_target, true, 1)] call DFUNC(displayPatientInformation));
showDisabled = 1;
priority = 2;
hotkey = "M";
@@ -481,7 +483,8 @@ class CfgVehicles {
};
};
class ACE_ArmLeft {
- statement = QUOTE([ARR_3(_target, true, 2)] call DEFUNC(displayPatientInformation));
+ runOnHover = 1;
+ statement = QUOTE([ARR_3(_target, true, 2)] call DFUNC(displayPatientInformation));
class Bandage_LeftArm {
displayName = "Bandage Left Arm";
@@ -602,7 +605,8 @@ class CfgVehicles {
};
};
class ACE_ArmRight {
- statement = QUOTE([ARR_3(_target, true, 3)] call DEFUNC(displayPatientInformation));
+ runOnHover = 1;
+ statement = QUOTE([ARR_3(_target, true, 3)] call DFUNC(displayPatientInformation));
class Bandage_RightArm {
displayName = "Bandage Right Arm";
distance = 2.0;
@@ -723,7 +727,8 @@ class CfgVehicles {
};
class ACE_LegLeft {
- statement = QUOTE([ARR_3(_target, true, 4)] call DEFUNC(displayPatientInformation));
+ runOnHover = 1;
+ statement = QUOTE([ARR_3(_target, true, 4)] call DFUNC(displayPatientInformation));
class Bandage_LeftLeg {
displayName = "Bandage Left Leg";
distance = 2.0;
@@ -834,7 +839,8 @@ class CfgVehicles {
};
};
class ACE_LegRight {
- statement = QUOTE([ARR_3(_target, true, 5)] call DEFUNC(displayPatientInformation));
+ runOnHover = 1;
+ statement = QUOTE([ARR_3(_target, true, 5)] call DFUNC(displayPatientInformation));
class Bandage_RightLeg {
displayName = "Bandage Right Leg";
distance = 2.0;
diff --git a/addons/overheating/config.cpp b/addons/overheating/config.cpp
index c3778862e6..b72660ce72 100644
--- a/addons/overheating/config.cpp
+++ b/addons/overheating/config.cpp
@@ -19,3 +19,14 @@ class CfgPatches {
#include "CfgVehicles.hpp"
#include "CfgWeapons.hpp"
+
+class ACE_Settings {
+ class GVAR(DisplayTextOnJam) {
+ typeName = "BOOL";
+ isClientSetable = 1;
+ value = 1;
+ displayName = "$STR_ACE_overheating_SettingDisplayTextName";
+ description = "$STR_ACE_overheating_SettingDisplayTextDesc";
+ };
+};
+
diff --git a/addons/overheating/functions/fnc_clearJam.sqf b/addons/overheating/functions/fnc_clearJam.sqf
index 76941d75ac..4bba92eb3f 100644
--- a/addons/overheating/functions/fnc_clearJam.sqf
+++ b/addons/overheating/functions/fnc_clearJam.sqf
@@ -42,13 +42,16 @@ if (_weapon in _jammedWeapons) then {
};
_unit playActionNow _clearJamAction;
- };
- if (_weapon == primaryWeapon _unit) then {
- playSound QGVAR(fixing_rifle);
- } else {
- if (_weapon == secondaryWeapon _unit) then {
- playSound QGVAR(fixing_pistol);
+ if (_weapon == primaryWeapon _unit) then {
+ playSound QGVAR(fixing_rifle);
+ } else {
+ if (_weapon == secondaryWeapon _unit) then {
+ playSound QGVAR(fixing_pistol);
+ };
};
};
- [localize "STR_ACE_Overheating_WeaponUnjammed"] call EFUNC(common,displayTextStructured);
+
+ if (GVAR(DisplayTextOnJam)) then {
+ [localize "STR_ACE_Overheating_WeaponUnjammed"] call EFUNC(common,displayTextStructured);
+ };
};
diff --git a/addons/overheating/functions/fnc_jamWeapon.sqf b/addons/overheating/functions/fnc_jamWeapon.sqf
index f11b72688c..7810fb0ce2 100644
--- a/addons/overheating/functions/fnc_jamWeapon.sqf
+++ b/addons/overheating/functions/fnc_jamWeapon.sqf
@@ -61,7 +61,7 @@ if (_unit getVariable [QGVAR(JammingActionID), -1] == -1) then {
_statement = {
playSound3D ["a3\sounds_f\weapons\Other\dry9.wss", _this select 0];
- if (!(missionNamespace getVariable [QGVAR(knowAboutJam), false]) && {(_this select 1) ammo currentWeapon (_this select 1) > 0}) then {
+ if (!(missionNamespace getVariable [QGVAR(knowAboutJam), false]) && {(_this select 1) ammo currentWeapon (_this select 1) > 0} && {GVAR(DisplayTextOnJam)}) then {
[localize "STR_ACE_Overheating_WeaponJammed"] call EFUNC(common,displayTextStructured);
GVAR(knowAboutJam) = true;
};
diff --git a/addons/overheating/stringtable.xml b/addons/overheating/stringtable.xml
index f8cea2ddb9..bea2c61ca2 100644
--- a/addons/overheating/stringtable.xml
+++ b/addons/overheating/stringtable.xml
@@ -2,6 +2,12 @@
+
+ Display text on jam
+
+
+ Display a notification whenever your weapon gets jammed
+
Spare barrel
Ersatzlauf
diff --git a/addons/parachute/XEH_postInit.sqf b/addons/parachute/XEH_postInit.sqf
index 71e35910b9..c80f093209 100644
--- a/addons/parachute/XEH_postInit.sqf
+++ b/addons/parachute/XEH_postInit.sqf
@@ -30,7 +30,7 @@ if (!hasInterface) exitWith {};
true
},
{false},
-[24, false, false, false], false] call CALLSTACK(cba_fnc_addKeybind);
+[24, [false, false, false]], false] call cba_fnc_addKeybind;
GVAR(PFH) = false;
["playerVehicleChanged",{
diff --git a/addons/reload/CfgEventHandlers.hpp b/addons/reload/CfgEventHandlers.hpp
index 754ff0db87..c93f74e0bd 100644
--- a/addons/reload/CfgEventHandlers.hpp
+++ b/addons/reload/CfgEventHandlers.hpp
@@ -14,7 +14,7 @@ class Extended_PostInit_EventHandlers {
class Extended_Take_EventHandlers {
class CAManBase {
class ACE_AmmoIndicatorReload {
- clientTake = QUOTE(if (_this select 0 == ACE_player && {(_this select 1) in [ARR_3(uniformContainer (_this select 0), vestContainer (_this select 0), backpackContainer (_this select 0))]} && {_this select 2 == currentMagazine (_this select 0)}) then {[ARR_2(_this select 0, vehicle (_this select 0))] call FUNC(displayAmmo)};);
+ clientTake = QUOTE(if (_this select 0 == ACE_player && {GVAR(DisplayText)} && {(_this select 1) in [ARR_3(uniformContainer (_this select 0), vestContainer (_this select 0), backpackContainer (_this select 0))]} && {_this select 2 == currentMagazine (_this select 0)}) then {[ARR_2(_this select 0, vehicle (_this select 0))] call FUNC(displayAmmo)};);
};
};
};
diff --git a/addons/reload/config.cpp b/addons/reload/config.cpp
index 932fe89840..611cf7d6aa 100644
--- a/addons/reload/config.cpp
+++ b/addons/reload/config.cpp
@@ -21,3 +21,14 @@ class CfgPatches {
#include "CfgActions.hpp"
#include "RscInGameUI.hpp"
+
+class ACE_Settings {
+ class GVAR(DisplayText) {
+ typeName = "BOOL";
+ isClientSetable = 1;
+ value = 1;
+ displayName = "$STR_ACE_reload_SettingDisplayTextName";
+ description = "$STR_ACE_reload_SettingDisplayTextDesc";
+ };
+};
+
diff --git a/addons/reload/stringtable.xml b/addons/reload/stringtable.xml
index 18af718873..40f36c6549 100644
--- a/addons/reload/stringtable.xml
+++ b/addons/reload/stringtable.xml
@@ -2,6 +2,12 @@
+
+ Check ammo on weapon reload
+
+
+ Check the ammo in your new magazine on magazine reload.
+
Check Ammo
Munition prüfen
diff --git a/addons/weaponselect/config.cpp b/addons/weaponselect/config.cpp
index adebcd322c..9bf9c7c39c 100644
--- a/addons/weaponselect/config.cpp
+++ b/addons/weaponselect/config.cpp
@@ -13,3 +13,13 @@ class CfgPatches {
};
#include "CfgEventHandlers.hpp"
+
+class ACE_Settings {
+ class GVAR(DisplayText) {
+ typeName = "BOOL";
+ isClientSetable = 1;
+ value = 1;
+ displayName = "$STR_ACE_Weaponselect_SettingDisplayTextName";
+ description = "$STR_ACE_Weaponselect_SettingDisplayTextDesc";
+ };
+};
diff --git a/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf b/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf
index 2f8a4c3f87..4605bd3861 100644
--- a/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf
+++ b/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf
@@ -14,6 +14,8 @@
private ["_magazine", "_numberofMagazines"];
+if !(GVAR(DisplayText)) exitwith {};
+
_magazine = _this select 0;
_numberofMagazines = _this select 1;
diff --git a/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf b/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf
index 685ef4b76e..72977e6ad6 100644
--- a/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf
+++ b/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf
@@ -36,9 +36,10 @@ if (_nextMuzzle != "") then {
// There is a no muzzle with magazines --> select nothing
GVAR(CurrentGrenadeMuzzleFrag) = ""; GVAR(CurrentGrenadeMuzzleOther) = "";
- _text = [localize "STR_ACE_WeaponSelect_NoGrenadesLeft", [1,0,0]] call EFUNC(common,stringToColoredText);
- [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured);
-
+ if (GVAR(DisplayText)) then {
+ _text = [localize "STR_ACE_WeaponSelect_NoGrenadesLeft", [1,0,0]] call EFUNC(common,stringToColoredText);
+ [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured);
+ };
};
if (_nextMuzzle in GVAR(FragMuzzles)) then {
diff --git a/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf b/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf
index 4b6c4dabb2..6eb1714b51 100644
--- a/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf
+++ b/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf
@@ -35,10 +35,10 @@ if (_nextMuzzle != "") then {
} else {
// There is a no muzzle with magazines --> select nothing
GVAR(CurrentGrenadeMuzzleFrag) = "";
-
- _text = [localize "STR_ACE_WeaponSelect_NoFragsLeft", [1,0,0]] call EFUNC(common,stringToColoredText);
- [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured);
-
+ if (GVAR(DisplayText)) then {
+ _text = [localize "STR_ACE_WeaponSelect_NoFragsLeft", [1,0,0]] call EFUNC(common,stringToColoredText);
+ [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured);
+ };
};
GVAR(CurrentGrenadeMuzzleIsFrag) = true;
diff --git a/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf b/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf
index 62b5325011..32c0e43666 100644
--- a/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf
+++ b/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf
@@ -35,10 +35,10 @@ if (_nextMuzzle != "") then {
} else {
// There is a no muzzle with magazines --> select nothing
GVAR(CurrentGrenadeMuzzleOther) = "";
-
- _text = [localize "STR_ACE_WeaponSelect_NoMiscGrenadeLeft", [1,0,0]] call EFUNC(common,stringToColoredText);
- [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured);
-
+ if (GVAR(DisplayText)) then {
+ _text = [localize "STR_ACE_WeaponSelect_NoMiscGrenadeLeft", [1,0,0]] call EFUNC(common,stringToColoredText);
+ [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured);
+ };
};
GVAR(CurrentGrenadeMuzzleIsFrag) = false;
diff --git a/addons/weaponselect/stringtable.xml b/addons/weaponselect/stringtable.xml
index a8c736b4fb..3a39d59396 100644
--- a/addons/weaponselect/stringtable.xml
+++ b/addons/weaponselect/stringtable.xml
@@ -2,6 +2,12 @@
+
+ Display text on grenade throw
+
+
+ Display a hint or text on grenade throw.
+
Select Pistol
Pistole auswählen
diff --git a/extras/assets/icons/Icons_Modules.psd b/extras/assets/icons/Icons_Modules.psd
new file mode 100644
index 0000000000..d240738a19
Binary files /dev/null and b/extras/assets/icons/Icons_Modules.psd differ