diff --git a/addons/interaction/functions/fnc_addToTooltip.sqf b/addons/interaction/functions/fnc_addToTooltip.sqf index 894223b68e..9f5595a9bc 100644 --- a/addons/interaction/functions/fnc_addToTooltip.sqf +++ b/addons/interaction/functions/fnc_addToTooltip.sqf @@ -2,4 +2,4 @@ #include "script_component.hpp" -QGVAR(CurrentTooltip) pushBack (_this select 0); +GVAR(CurrentTooltip) pushBack (_this select 0); diff --git a/addons/logistics_wirecutter/$PBOPREFIX$ b/addons/logistics_wirecutter/$PBOPREFIX$ new file mode 100644 index 0000000000..91d50071d3 --- /dev/null +++ b/addons/logistics_wirecutter/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\logistics_wirecutter \ No newline at end of file diff --git a/addons/logistics_wirecutter/CfgEventHandlers.hpp b/addons/logistics_wirecutter/CfgEventHandlers.hpp new file mode 100644 index 0000000000..f0a9f14d91 --- /dev/null +++ b/addons/logistics_wirecutter/CfgEventHandlers.hpp @@ -0,0 +1,6 @@ + +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; diff --git a/addons/logistics_wirecutter/CfgSounds.hpp b/addons/logistics_wirecutter/CfgSounds.hpp new file mode 100644 index 0000000000..9958190ec1 --- /dev/null +++ b/addons/logistics_wirecutter/CfgSounds.hpp @@ -0,0 +1,12 @@ +class CfgSounds { + class ACE_Wirecutter_sound { + name = "ACE_wirecutter_sound"; + sound[] = {QUOTE(PATHTOF(sound\wire_cut.ogg)), "db-0", 1}; + titles[] = {}; + }; + class ACE_Wirecutter_sound_long { + name = "ACE_wirecutter_sound_long"; + sound[] = {QUOTE(PATHTOF(sound\wire_cut_long.ogg)), "db-0", 1}; + titles[] = {}; + }; +}; diff --git a/addons/logistics_wirecutter/CfgVehicles.hpp b/addons/logistics_wirecutter/CfgVehicles.hpp new file mode 100644 index 0000000000..41c47c70b8 --- /dev/null +++ b/addons/logistics_wirecutter/CfgVehicles.hpp @@ -0,0 +1,98 @@ +#define MACRO_CUTWIRE \ + class ACE_Wirecutter_cut { \ + displayName = "$STR_ACE_CutFence"; \ + distance = 4; \ + condition = QUOTE('ToolKit' in items _player && {alive _target}); \ + statement = QUOTE([ARR_2(5, _target)] call FUNC(cutDownFence)); \ + showDisabled = 1; \ + priority = 2.1; \ + icon = QUOTE(PATHTOF(ui\wirecutter_ca.paa)); \ + }; + +#define MACRO_CUTWIRE_LONG \ + class ACE_Wirecutter_cut { \ + displayName = "$STR_ACE_CutFence"; \ + distance = 4; \ + condition = QUOTE('ToolKit' in items _player && {alive _target}); \ + statement = QUOTE([ARR_2(5, _target)] call FUNC(cutDownFence)); \ + showDisabled = 1; \ + priority = 2.1; \ + icon = QUOTE(PATHTOF(ui\wirecutter_ca.paa)); \ + }; + +class CfgVehicles { + + class Wall_F; + class Land_Net_Fence_4m_F: Wall_F { + class ACE_Actions { + MACRO_CUTWIRE + }; + }; + class Land_Net_Fence_8m_F: Wall_F { + class ACE_Actions { + MACRO_CUTWIRE_LONG + }; + }; + class Land_Net_FenceD_8m_F: Wall_F { + class ACE_Actions { + MACRO_CUTWIRE + }; + }; + class Land_New_WiredFence_5m_F: Wall_F { + class ACE_Actions { + MACRO_CUTWIRE + }; + }; + class Land_New_WiredFence_10m_Dam_F: Wall_F { + class ACE_Actions { + MACRO_CUTWIRE + }; + }; + class Land_New_WiredFence_10m_F: Wall_F { + class ACE_Actions { + MACRO_CUTWIRE_LONG + }; + }; + class Land_Pipe_fence_4m_F: Wall_F { + class ACE_Actions { + MACRO_CUTWIRE + }; + }; + class Land_Pipe_fence_4mNoLC_F: Wall_F { + class ACE_Actions { + MACRO_CUTWIRE + }; + }; + class Land_SportGround_fence_F: Wall_F { + class ACE_Actions { + MACRO_CUTWIRE + }; + }; + class Land_Wired_Fence_4m_F: Wall_F { + class ACE_Actions { + MACRO_CUTWIRE + }; + }; + class Land_Wired_Fence_4mD_F: Wall_F { + class ACE_Actions { + MACRO_CUTWIRE + }; + }; + class Land_Wired_Fence_8m_F: Wall_F { + class ACE_Actions { + MACRO_CUTWIRE_LONG + }; + }; + class Land_Wired_Fence_8mD_F: Wall_F { + class ACE_Actions { + MACRO_CUTWIRE + }; + }; + + class NonStrategic; + class Land_Razorwire_F: NonStrategic { + class ACE_Actions { + MACRO_CUTWIRE + }; + }; +}; diff --git a/addons/logistics_wirecutter/XEH_preInit.sqf b/addons/logistics_wirecutter/XEH_preInit.sqf new file mode 100644 index 0000000000..facd43451e --- /dev/null +++ b/addons/logistics_wirecutter/XEH_preInit.sqf @@ -0,0 +1,9 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(cutDownFence); +PREP(cutDownFenceAbort); +PREP(cutDownFenceCallback); + +ADDON = true; diff --git a/addons/logistics_wirecutter/config.cpp b/addons/logistics_wirecutter/config.cpp new file mode 100644 index 0000000000..2cc1227a7d --- /dev/null +++ b/addons/logistics_wirecutter/config.cpp @@ -0,0 +1,17 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"gpgpgpgp"}; + authorUrl = ""; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" +#include "CfgSounds.hpp" diff --git a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf new file mode 100644 index 0000000000..092b6348b0 --- /dev/null +++ b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf @@ -0,0 +1,24 @@ +// by gpgpgpgp, edited by commy2 +#include "script_component.hpp" + +PARAMS_2(_timeToCut,_fenceObject); + +// if (cadetMode) then { + // { + // [ACE_player, "{_this groupChat localize 'STR_ACE_CuttingFenceChat'}", _x] call ACE_Core_fnc_execRemoteFnc; + // } forEach units group ACE_player; +// }; + +if !([ACE_player] call EFUNC(common,isEngineer)) then { + _timeToCut = _timeToCut + 5; +}; + +[ACE_player, "AinvPknlMstpSnonWnonDr_medic5", 0] call EFUNC(common,doAnimation); + +if (_timeToCut > 4.5) then { + playSound "ACE_wirecutter_sound_long"; +} else { + playSound "ACE_wirecutter_sound"; +}; + +[_timeToCut, [_fenceObject], {(_this select 0) call FUNC(cutDownFenceCallback)}, {(_this select 0) call FUNC(cutDownFenceAbort)}, localize "STR_ACE_CuttingFence"] call EFUNC(common,progressBar); diff --git a/addons/logistics_wirecutter/functions/fnc_cutDownFenceAbort.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFenceAbort.sqf new file mode 100644 index 0000000000..d17038af7c --- /dev/null +++ b/addons/logistics_wirecutter/functions/fnc_cutDownFenceAbort.sqf @@ -0,0 +1,4 @@ +// by commy2 +#include "script_component.hpp" + +[ACE_player, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); diff --git a/addons/logistics_wirecutter/functions/fnc_cutDownFenceCallback.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFenceCallback.sqf new file mode 100644 index 0000000000..edcdee5a5d --- /dev/null +++ b/addons/logistics_wirecutter/functions/fnc_cutDownFenceCallback.sqf @@ -0,0 +1,7 @@ +#include "script_component.hpp" + +PARAMS_1(_fenceObject); + +_fenceObject setdamage 1; +[localize "STR_ACE_FenceCut"] call EFUNC(common,displayTextStructured); +[ACE_player, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); diff --git a/addons/logistics_wirecutter/functions/script_component.hpp b/addons/logistics_wirecutter/functions/script_component.hpp new file mode 100644 index 0000000000..4a5c48048c --- /dev/null +++ b/addons/logistics_wirecutter/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\logistics_wirecutter\script_component.hpp" \ No newline at end of file diff --git a/addons/logistics_wirecutter/script_component.hpp b/addons/logistics_wirecutter/script_component.hpp new file mode 100644 index 0000000000..6dae60dfd2 --- /dev/null +++ b/addons/logistics_wirecutter/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT logistics_wirecutter +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_LOGISTICS_WIRECUTTER + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_LOGISTICS_WIRECUTTER + #define DEBUG_SETTINGS DEBUG_SETTINGS_LOGISTICS_WIRECUTTER +#endif + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/logistics_wirecutter/sound/wire_cut.ogg b/addons/logistics_wirecutter/sound/wire_cut.ogg new file mode 100644 index 0000000000..246b15432c Binary files /dev/null and b/addons/logistics_wirecutter/sound/wire_cut.ogg differ diff --git a/addons/logistics_wirecutter/sound/wire_cut_long.ogg b/addons/logistics_wirecutter/sound/wire_cut_long.ogg new file mode 100644 index 0000000000..36d25c9c73 Binary files /dev/null and b/addons/logistics_wirecutter/sound/wire_cut_long.ogg differ diff --git a/addons/logistics_wirecutter/stringtable.xml b/addons/logistics_wirecutter/stringtable.xml new file mode 100644 index 0000000000..b9ec851a81 --- /dev/null +++ b/addons/logistics_wirecutter/stringtable.xml @@ -0,0 +1,54 @@ + + + + + + Cut Fence + Zaun schneiden + Cortar alambrado + Przetnij płot + Přestřihnout plot + Cisailler Clôture + Cortar Cerca + Taglia + Drótkerítés átvágása + Вырезать забор + + + Cutting Fences / Wires ... + Zaun / Draht schneiden ... + Cortando alambrado / cables ... + Przecinanie płotu / drutów ... + Přestřihnout plot / dráty ... + Cisaille l'obstacle ... + Cortando Cerca / Arame ... + Sto tagliando ... + Drótok elvágása ... + Вырезаем забор / провода ... + + + Cutting Fences! + Schneide Zaun! + Cortando alambrado! + Przecinanie płotu! + Stříhání plotu! + Cisaillage! + Cortando Cerca! + La sto tagliando! + Átvágom a drótkerítést! + Вырезаем забор! + + + Fence cut + Zaun geschnitten + Alambrado cortado + Płot przecięty + Plot přestřižen + Clôture cisaillée + Cerca cortada + Fatto! + Drótkerítés átvágva + Забор вырезан + + + \ No newline at end of file diff --git a/addons/logistics_wirecutter/ui/wirecutter_ca.paa b/addons/logistics_wirecutter/ui/wirecutter_ca.paa new file mode 100644 index 0000000000..8cd2165385 Binary files /dev/null and b/addons/logistics_wirecutter/ui/wirecutter_ca.paa differ