diff --git a/.hemtt/missions/test.Stratis/mission.sqm b/.hemtt/missions/test.Stratis/mission.sqm index dd3f691..9b1a187 100644 Binary files a/.hemtt/missions/test.Stratis/mission.sqm and b/.hemtt/missions/test.Stratis/mission.sqm differ diff --git a/addons/m119/XEH_PREP.hpp b/addons/m119/XEH_PREP.hpp index e69de29..bfe4ee7 100644 --- a/addons/m119/XEH_PREP.hpp +++ b/addons/m119/XEH_PREP.hpp @@ -0,0 +1,5 @@ +PREP(init); +PREP(canOpenBreech); +PREP(canCloseBreech); +PREP(openBreech); +PREP(closeBreech); diff --git a/addons/m119/XEH_preInit.sqf b/addons/m119/XEH_preInit.sqf index 408c089..7ad3f0c 100644 --- a/addons/m119/XEH_preInit.sqf +++ b/addons/m119/XEH_preInit.sqf @@ -2,4 +2,6 @@ #include "XEH_PREP.hpp" +[QUOTE(TBD_M119), "init", {_this call FUNC(init)}] call CBA_fnc_addClassEventHandler; + ADDON = true; diff --git a/addons/m119/functions/.gitkeep b/addons/m119/functions/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/addons/m119/functions/fnc_canCloseBreech.sqf b/addons/m119/functions/fnc_canCloseBreech.sqf new file mode 100644 index 0000000..18a8053 --- /dev/null +++ b/addons/m119/functions/fnc_canCloseBreech.sqf @@ -0,0 +1,31 @@ + +/* + FILE: fnc_canCloseBreech.sqf + + Name: tbd_m119_m119_fnc_canCloseBreech + + Author(s): + ilbinek + + Description: + Checks if the M119 can close the breech + + Parameters: + _arty - object - M119 to be canCloseBreeched + + Returns: + Nothing + + Examples: + > [_arty] call tbd_m119_m119_fnc_canCloseBreech; + + Public: + No +*/ + +#include "..\script_component.hpp" + +params ["_arty"]; + +private _ret = _arty getVariable [QGVAR(breech), false] && _arty animationSourcePhase "open_breech_source" == 1; +_ret diff --git a/addons/m119/functions/fnc_canOpenBreech.sqf b/addons/m119/functions/fnc_canOpenBreech.sqf new file mode 100644 index 0000000..82dd5ae --- /dev/null +++ b/addons/m119/functions/fnc_canOpenBreech.sqf @@ -0,0 +1,32 @@ + +/* + FILE: fnc_canOpenBreech.sqf + + Name: tbd_m119_m119_fnc_canOpenBreech + + Author(s): + ilbinek + + Description: + Checks if the M119 can open the breech + + Parameters: + _arty - object - M119 to be canCloseBreeched + + Returns: + Nothing + + Examples: + > [_arty] call tbd_m119_m119_fnc_canOpenBreech; + + Public: + Yes +*/ + + +#include "..\script_component.hpp" + +params ["_arty"]; + +private _ret = (!(_arty getVariable [QGVAR(breech), false]) && _arty animationSourcePhase "open_breech_source" == 0); +_ret diff --git a/addons/m119/functions/fnc_closeBreech.sqf b/addons/m119/functions/fnc_closeBreech.sqf new file mode 100644 index 0000000..860adde --- /dev/null +++ b/addons/m119/functions/fnc_closeBreech.sqf @@ -0,0 +1,34 @@ + +/* + FILE: fnc_closeBreech.sqf + + Name: tbd_m119_m119_fnc_closeBreech + + Author(s): + ilbinek + + Description: + Close the M119 breech + + Parameters: + _arty - object - M119 to be canCloseBreeched + + Returns: + Nothing + + Examples: + > [_arty] call tbd_m119_m119_fnc_closeBreech; + + Public: + No +*/ + +#include "..\script_component.hpp" + +params ["_arty"]; + +if !([_arty] call FUNC(canCloseBrach)) exitWith {}; + +_arty animateSource ["open_breech_source", 0]; +_arty animateSource ["handle_breech_source", 0]; +_arty setVariable [QGVAR(breech), false, true]; diff --git a/addons/m119/functions/fnc_init.sqf b/addons/m119/functions/fnc_init.sqf new file mode 100644 index 0000000..9ce2f42 --- /dev/null +++ b/addons/m119/functions/fnc_init.sqf @@ -0,0 +1,33 @@ +/* + FILE: fnc_init.sqf + + Name: tbd_m119_m119_fnc_init + + Author(s): + ilbinek + + Description: + Init all variables for the M119 + + Parameters: + _arty - object - M119 to be inited + + Returns: + Nothing + + Examples: + > [_arty] call tbd_m119_m119_fnc_init; + + Public: + No +*/ + +#include "..\script_component.hpp" + +params ["_arty"]; + +// Set the state variables +_arty setVariable [QGVAR(folded), false, true]; +_arty setVariable [QGVAR(breech), false, true]; +_arty setVariable [QGVAR(loaded), false, true]; +_arty setVariable [QGVAR(fired), false, true]; diff --git a/addons/m119/functions/fnc_openBreech.sqf b/addons/m119/functions/fnc_openBreech.sqf new file mode 100644 index 0000000..c0ff23c --- /dev/null +++ b/addons/m119/functions/fnc_openBreech.sqf @@ -0,0 +1,34 @@ + +/* + FILE: fnc_openBreech.sqf + + Name: tbd_m119_m119_fnc_openBreech + + Author(s): + ilbinek + + Description: + Open the M119 breech + + Parameters: + _arty - object - M119 to be canCloseBreeched + + Returns: + Nothing + + Examples: + > [_arty] call tbd_m119_m119_fnc_openBreech; + + Public: + No +*/ + +#include "..\script_component.hpp" + +params ["_arty"]; + +if !([_arty] call FUNC(canOpenBrach)) exitWith {}; + +_arty animateSource ["open_breech_source", 1]; +_arty animateSource ["handle_breech_source", 1]; +_arty setVariable [QGVAR(breech), true, true]; diff --git a/addons/m119/stringtable.xml b/addons/m119/stringtable.xml index fb5e908..bca847e 100644 --- a/addons/m119/stringtable.xml +++ b/addons/m119/stringtable.xml @@ -1,9 +1,25 @@ - + M119 M119 + + Open breech + Otevřít zadovku + + + Close breech + Zavřít zadovku + + + Fold + Složit + + + Unfold + Rozložit + diff --git a/addons/m119/tbd_m119/CfgVehicles.hpp b/addons/m119/tbd_m119/CfgVehicles.hpp index 6639b5c..316d2fe 100644 --- a/addons/m119/tbd_m119/CfgVehicles.hpp +++ b/addons/m119/tbd_m119/CfgVehicles.hpp @@ -168,7 +168,6 @@ class CfgVehicles { soundPosition = "konec_hlavne"; }; - class handle_breech_source { source = "user"; initPhase = 0; @@ -202,56 +201,25 @@ class CfgVehicles { initPhase = 1; animPeriod = 0; }; - }; class ACE_Actions: ACE_Actions { - class VASIL_LoadMag { - selection = "load_magazine"; - distance = 1; - condition = QUOTE([ARR_2(_target,QUOTE(QUOTE(TBD_2B9_VASILEK_MAGAZINE)))] call FUNC(canLoadWeapon)); + class TBD_OpenBreech { + selection = "int_handle_breech"; + distance = 1.5; + condition = QUOTE([ARR_1(_target)] call FUNC(canOpenBreech)); showDisabled = 0; - displayName = CSTRING(LOAD_MAGAZINE); - icon = "x\tbd_mortars\addons\main\data\load.paa"; - statement = QUOTE([ARR_2(_target,QUOTE(QUOTE(TBD_2B9_VASILEK_MAGAZINE)))] call FUNC(loadWeapon)); - }; - - class ACE_MainActions: ACE_MainActions { - selection = "interact"; - - class VASIL_Fold { - distance = 2.5; - condition = QUOTE([ARR_1(_target)] call FUNC(canFold)); - showDisabled = 0; - displayName = CSTRING(FOLD); - statement = QUOTE([ARR_1(_target)] call FUNC(fold)); - }; - - class VASIL_Unfold { - distance = 2.5; - condition = QUOTE([ARR_1(_target)] call FUNC(canUnfold)); - showDisabled = 0; - displayName = CSTRING(UNFOLD); - statement = QUOTE([ARR_1(_target)] call FUNC(unfold)); - }; + displayName = CSTRING(open_breech); + statement = QUOTE([ARR_1(_target)] call FUNC(openBreech)); }; - class VASIL_Tow { - selection = "towing_point"; - distance = 2.5; - condition = QUOTE([ARR_1(_target)] call FUNC(canBeTowed)); + class TBD_CloseBreech { + selection = "int_handle_breech"; + distance = 1.5; + condition = QUOTE([ARR_1(_target)] call FUNC(canCloseBreech)); showDisabled = 0; - displayName = CSTRING(TOW); - statement = QUOTE([ARR_1(_target)] call FUNC(tow)); - }; - - class VASIL_Detach { - selection = "towing_point"; - distance = 2.5; - condition = QUOTE(_target getVariable [ARR_2(QUOTE(QGVAR(towed)),false)]); - showDisabled = 0; - displayName = CSTRING(DETACH); - statement = QUOTE([ARR_1(_target)] call FUNC(detach)); + displayName = CSTRING(close_breech); + statement = QUOTE([ARR_1(_target)] call FUNC(closeBreech)); }; }; };