mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Performed initial conversion from AGM to ACE. Added necessary boilerplate files.
This commit is contained in:
parent
03cef93ac7
commit
966cb6ffdf
1
addons/parachute/$PBOPREFIX$
Normal file
1
addons/parachute/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\ace\addons\parachute
|
10
addons/parachute/CfgEventHandlers.hpp
Normal file
10
addons/parachute/CfgEventHandlers.hpp
Normal file
@ -0,0 +1,10 @@
|
||||
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));
|
||||
};
|
||||
};
|
11
addons/parachute/README.md
Normal file
11
addons/parachute/README.md
Normal file
@ -0,0 +1,11 @@
|
||||
ace_parachute
|
||||
===========
|
||||
|
||||
Improves parachutes and adds an altimeter.
|
||||
|
||||
## Maintainers
|
||||
|
||||
The people responsible for merging changes to this component or answering potential questions.
|
||||
|
||||
- [CorruptedHeart](https://github.com/CorruptedHeart)
|
||||
- [esteldunedain](https://github.com/esteldunedain)
|
@ -1,18 +1,18 @@
|
||||
class RscText;
|
||||
class RscPicture;
|
||||
class RscTitles {
|
||||
class AGM_Altimeter {
|
||||
class ACE_Altimeter {
|
||||
idd = 9935;
|
||||
enableSimulation = 1;
|
||||
movingEnable = 0;
|
||||
fadeIn=0;
|
||||
fadeOut=1;
|
||||
duration = 10e10;
|
||||
onLoad = "uiNamespace setVariable ['AGM_Altimeter', _this select 0];";
|
||||
onLoad = "uiNamespace setVariable ['ACE_Altimeter', _this select 0];";
|
||||
class controls {
|
||||
class AltimeterImage: RscPicture {
|
||||
idc = 1200;
|
||||
text = "AGM_Parachute\UI\watch_altimeter.paa";
|
||||
text = PATHTOF(UI\watch_altimeter.paa);
|
||||
x = 0.118437 * safezoneW + safezoneX;
|
||||
y = 0.621 * safezoneH + safezoneY;
|
||||
w = 0.20625 * safezoneW;
|
||||
|
30
addons/parachute/XEH_postInit.sqf
Normal file
30
addons/parachute/XEH_postInit.sqf
Normal file
@ -0,0 +1,30 @@
|
||||
#include "script_component.hpp"
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
["ACE3", localize "STR_ACE_Parachute_showAltimeter",
|
||||
{
|
||||
if (!('ACE_Altimeter' in assignedItems ace_player)) exitWith {false};
|
||||
if (isNull (missionNamespace getVariable ['ACE_Parachute_AltimeterFnc', scriptNull])) then {
|
||||
[ace_player] call ACE_Parachute_fnc_showAltimeter
|
||||
} else {
|
||||
call ACE_Parachute_fnc_hideAltimeter
|
||||
};
|
||||
true
|
||||
}, [24, false, false, false], false, "keydown"] call CALLSTACK(cba_fnc_registerKeybind);
|
||||
|
||||
[] spawn {
|
||||
ACE_Parachuting_PFH = false;
|
||||
while {true} do {
|
||||
sleep 1;
|
||||
// I believe this doesn't work for Zeus.
|
||||
// vehicle _player
|
||||
if (!ACE_Parachuting_PFH && {(vehicle ACE_player) isKindOf "ParachuteBase"}) then {
|
||||
ACE_Parachuting_PFH = true;
|
||||
["ACE_ParachuteFix", "OnEachFrame", {call ACE_Parachute_fnc_onEachFrame;}] call BIS_fnc_addStackedEventHandler;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
// don't show speed and height when in expert mode
|
||||
["Parachute", {if (!cadetMode) then {_dlg = _this select 0; {(_dlg displayCtrl _x) ctrlShow false} forEach [121, 122, 1004, 1005, 1006, 1014];};}] call ACE_Core_fnc_addInfoDisplayEventHandler; //@todo addEventHandler infoDisplayChanged with select 1 == "Parachute"
|
||||
["Soldier", {if (!cadetMode) then {_dlg = _this select 0; {_ctrl = (_dlg displayCtrl _x); _ctrl ctrlSetPosition [0,0,0,0]; _ctrl ctrlCommit 0;} forEach [380, 382]};}] call ACE_Core_fnc_addInfoDisplayEventHandler; //@todo addEventHandler infoDisplayChanged with select 1 == "Soldier"
|
10
addons/parachute/XEH_preInit.sqf
Normal file
10
addons/parachute/XEH_preInit.sqf
Normal file
@ -0,0 +1,10 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
ADDON = false;
|
||||
|
||||
PREP(doLanding);
|
||||
PREP(hideAltimeter);
|
||||
PREP(onEachFrame);
|
||||
PREP(showAltimeter);
|
||||
|
||||
ADDON = true;
|
@ -1,33 +0,0 @@
|
||||
/*
|
||||
Name: AGM_Parachute_fnc_init
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Auto called by Arma.
|
||||
Initialises the parachute system.
|
||||
|
||||
Parameters:
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
Example:
|
||||
call AGM_Parachute_fnc_init;
|
||||
*/
|
||||
[] spawn {
|
||||
AGM_Parachuting_PFH = false;
|
||||
while {true} do {
|
||||
sleep 1;
|
||||
// I believe this doesn't work for Zeus.
|
||||
// vehicle _player
|
||||
if (!AGM_Parachuting_PFH && {(vehicle AGM_player) isKindOf "ParachuteBase"}) then {
|
||||
AGM_Parachuting_PFH = true;
|
||||
["AGM_ParachuteFix", "OnEachFrame", {call AGM_Parachute_fnc_onEachFrame;}] call BIS_fnc_addStackedEventHandler;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
// don't show speed and height when in expert mode
|
||||
["Parachute", {if (!cadetMode) then {_dlg = _this select 0; {(_dlg displayCtrl _x) ctrlShow false} forEach [121, 122, 1004, 1005, 1006, 1014];};}] call AGM_Core_fnc_addInfoDisplayEventHandler; //@todo addEventHandler infoDisplayChanged with select 1 == "Parachute"
|
||||
["Soldier", {if (!cadetMode) then {_dlg = _this select 0; {_ctrl = (_dlg displayCtrl _x); _ctrl ctrlSetPosition [0,0,0,0]; _ctrl ctrlCommit 0;} forEach [380, 382]};}] call AGM_Core_fnc_addInfoDisplayEventHandler; //@todo addEventHandler infoDisplayChanged with select 1 == "Soldier"
|
@ -1,81 +1,52 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class AGM_Parachute {
|
||||
units[] = {"AGM_NonSteerableParachute"};
|
||||
weapons[] = {"AGM_Altimeter"};
|
||||
requiredVersion = 0.60;
|
||||
requiredAddons[] = {AGM_Core};
|
||||
version = "0.95";
|
||||
versionStr = "0.95";
|
||||
versionAr[] = {0,95,0};
|
||||
class ACE_Parachute {
|
||||
units[] = {"ACE_NonSteerableParachute"};
|
||||
weapons[] = {"ACE_Altimeter"};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common"};
|
||||
VERSION_CONFIG;
|
||||
author[] = {"Garth 'LH' de Wet"};
|
||||
authorUrl = "http://garth.snakebiteink.co.za/";
|
||||
};
|
||||
};
|
||||
|
||||
class CfgFunctions {
|
||||
class AGM_Parachute {
|
||||
class AGM_Parachute {
|
||||
file = "\AGM_Parachute\functions";
|
||||
class onEachFrame;
|
||||
class doLanding;
|
||||
class hideAltimeter;
|
||||
class showAltimeter;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class AGM_Parachute {
|
||||
clientInit = "call compile preprocessFileLineNumbers '\AGM_Parachute\clientInit.sqf';";
|
||||
};
|
||||
};
|
||||
|
||||
class AGM_Core_Default_Keys {
|
||||
class showAltimeterNew {
|
||||
displayName = "$STR_AGM_Parachute_showAltimeter";
|
||||
condition = "'AGM_Altimeter' in assignedItems _player";
|
||||
statement = "if (isNull (missionNamespace getVariable ['AGM_Parachute_AltimeterFnc', scriptNull])) then {[_player] call AGM_Parachute_fnc_showAltimeter} else {call AGM_Parachute_fnc_hideAltimeter}";
|
||||
exceptions[] = {"AGM_Drag_isNotDragging", "AGM_Medical_canTreat", "AGM_Interaction_isNotEscorting"};
|
||||
key = 24;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "RscTitles.hpp"
|
||||
|
||||
class CfgWeapons {
|
||||
class ItemWatch;
|
||||
class AGM_Altimeter:ItemWatch {
|
||||
author = "$STR_AGM_Core_AGMTeam";
|
||||
descriptionShort = "$STR_AGM_Parachute_AltimeterDescription";
|
||||
displayName = "$STR_AGM_Parachute_AltimeterDisplayName";
|
||||
picture = "\AGM_Parachute\UI\watch_altimeter.paa";
|
||||
class ACE_Altimeter:ItemWatch {
|
||||
author = "$STR_ACE_Common_ACETeam";
|
||||
descriptionShort = "$STR_ACE_Parachute_AltimeterDescription";
|
||||
displayName = "$STR_ACE_Parachute_AltimeterDisplayName";
|
||||
picture = PATHTOF(UI\watch_altimeter.paa);
|
||||
};
|
||||
};
|
||||
|
||||
class CfgVehicles {
|
||||
class Box_NATO_Support_F;
|
||||
class AGM_Box_Misc: Box_NATO_Support_F {
|
||||
class ACE_Box_Misc: Box_NATO_Support_F {
|
||||
class TransportItems {
|
||||
class _xx_AGM_Altimeter {
|
||||
name = "AGM_Altimeter";
|
||||
class _xx_ACE_Altimeter {
|
||||
name = "ACE_Altimeter";
|
||||
count = 6;
|
||||
};
|
||||
};
|
||||
class TransportBackpacks {
|
||||
class _xx_AGM_NonSteerableParachute {
|
||||
backpack = "AGM_NonSteerableParachute";
|
||||
class _xx_ACE_NonSteerableParachute {
|
||||
backpack = "ACE_NonSteerableParachute";
|
||||
count = 4;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class B_Parachute;
|
||||
class AGM_NonSteerableParachute: B_Parachute {
|
||||
author = "$STR_AGM_Core_AGMTeam";
|
||||
class ACE_NonSteerableParachute: B_Parachute {
|
||||
author = "$STR_ACE_Common_ACETeam";
|
||||
scope = 2;
|
||||
displayName = "$STR_AGM_Parachute_NonSteerableParachute";
|
||||
displayName = "$STR_ACE_Parachute_NonSteerableParachute";
|
||||
//picture = "\A3\Characters_F\data\ui\icon_b_parachute_ca.paa"; // @todo
|
||||
//model = "\A3\Weapons_F\Ammoboxes\Bags\Backpack_Parachute"; // @todo
|
||||
backpackSimulation = "ParachuteNonSteerable"; //ParachuteSteerable
|
||||
@ -84,7 +55,7 @@ class CfgVehicles {
|
||||
mass = 100;
|
||||
};
|
||||
|
||||
class B_Soldier_05_f; class B_Pilot_F: B_Soldier_05_f {backpack = "AGM_NonSteerableParachute";};
|
||||
class I_Soldier_04_F; class I_pilot_F: I_Soldier_04_F {backpack = "AGM_NonSteerableParachute";};
|
||||
class O_helipilot_F; class O_Pilot_F: O_helipilot_F {backpack = "AGM_NonSteerableParachute";};
|
||||
class B_Soldier_05_f; class B_Pilot_F: B_Soldier_05_f {backpack = "ACE_NonSteerableParachute";};
|
||||
class I_Soldier_04_F; class I_pilot_F: I_Soldier_04_F {backpack = "ACE_NonSteerableParachute";};
|
||||
class O_helipilot_F; class O_Pilot_F: O_helipilot_F {backpack = "ACE_NonSteerableParachute";};
|
||||
};
|
||||
|
@ -1,18 +0,0 @@
|
||||
/*
|
||||
Name: AGM_Parachute_fnc_hideAltimeter
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Removes the altimeter from the screen.
|
||||
|
||||
Parameters:
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
Example:
|
||||
call AGM_Parachute_fnc_hideAltimeter
|
||||
*/
|
||||
terminate AGM_Parachute_AltimeterFnc;
|
||||
(["AGM_Altimeter"] call BIS_fnc_rscLayer) cutText ["","PLAIN",0,true];
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Name: AGM_Parachute_fnc_doLanding
|
||||
Name: ACE_Parachute_fnc_doLanding
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
@ -13,12 +13,14 @@
|
||||
Nothing
|
||||
|
||||
Example:
|
||||
[player] call AGM_Parachute_fnc_doLanding;
|
||||
[player] call ACE_Parachute_fnc_doLanding;
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private ["_unit"];
|
||||
_unit = _this select 0;
|
||||
["AGM_ParachuteFix", "OnEachFrame"] call BIS_fnc_removeStackedEventHandler;
|
||||
AGM_Parachuting_PFH = false;
|
||||
[_unit, "AmovPercMevaSrasWrflDf_AmovPknlMstpSrasWrflDnon", 2] call AGM_Core_fnc_doAnimation;
|
||||
["ACE_ParachuteFix", "OnEachFrame"] call BIS_fnc_removeStackedEventHandler;
|
||||
ACE_Parachuting_PFH = false;
|
||||
[_unit, "AmovPercMevaSrasWrflDf_AmovPknlMstpSrasWrflDnon", 2] call ACE_Core_fnc_doAnimation;
|
||||
[_unit] spawn {
|
||||
sleep 1;
|
||||
(_this select 0) playActionNow "Crouch";
|
19
addons/parachute/functions/fnc_hideAltimeter.sqf
Normal file
19
addons/parachute/functions/fnc_hideAltimeter.sqf
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
Name: ACE_Parachute_fnc_hideAltimeter
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
Description:
|
||||
Removes the altimeter from the screen.
|
||||
|
||||
Parameters:
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
|
||||
Example:
|
||||
call ACE_Parachute_fnc_hideAltimeter
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
terminate ACE_Parachute_AltimeterFnc;
|
||||
(["ACE_Altimeter"] call BIS_fnc_rscLayer) cutText ["","PLAIN",0,true];
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Name: AGM_Parachute_fnc_onEachFrame
|
||||
Name: ACE_Parachute_fnc_onEachFrame
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
@ -13,11 +13,12 @@
|
||||
Nothing
|
||||
|
||||
Example:
|
||||
call AGM_Parachute_fnc_onEachFrame;
|
||||
call ACE_Parachute_fnc_onEachFrame;
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private "_player";
|
||||
_player = AGM_player;
|
||||
if (isNull _player) exitWith {["AGM_ParachuteFix", "OnEachFrame"] call BIS_fnc_removeStackedEventHandler;AGM_Parachuting_PFH = false;};
|
||||
_player = ACE_player;
|
||||
if (isNull _player) exitWith {["ACE_ParachuteFix", "OnEachFrame"] call BIS_fnc_removeStackedEventHandler;ACE_Parachuting_PFH = false;};
|
||||
if !((vehicle _player) isKindOf "ParachuteBase") exitWith {};
|
||||
if (isTouchingGround _player) exitWith {};
|
||||
|
||||
@ -27,5 +28,5 @@ _pos = getPosASL (Vehicle _player);
|
||||
if ((lineIntersects [_pos, _pos vectorAdd [0,0,-0.5], vehicle _player, _player]) || {((ASLtoATL _pos) select 2) < 0.75}) then {
|
||||
// I believe this will not work for Zeus units.
|
||||
deleteVehicle (vehicle _player);
|
||||
[_player] call AGM_Parachute_fnc_doLanding;
|
||||
[_player] call ACE_Parachute_fnc_doLanding;
|
||||
};
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Name: AGM_Parachute_fnc_showAltimeter
|
||||
Name: ACE_Parachute_fnc_showAltimeter
|
||||
|
||||
Author: Garth de Wet (LH)
|
||||
|
||||
@ -13,14 +13,15 @@
|
||||
Nothing
|
||||
|
||||
Example:
|
||||
[player] call AGM_Parachute_fnc_showAltimeter
|
||||
[player] call ACE_Parachute_fnc_showAltimeter
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private ["_unit"];
|
||||
_unit = _this select 0;
|
||||
(["AGM_Altimeter"] call BIS_fnc_rscLayer) cutRsc ["AGM_Altimeter", "PLAIN",0,true];
|
||||
if (isNull (uiNamespace getVariable ["AGM_Altimeter", displayNull])) exitWith {};
|
||||
(["ACE_Altimeter"] call BIS_fnc_rscLayer) cutRsc ["ACE_Altimeter", "PLAIN",0,true];
|
||||
if (isNull (uiNamespace getVariable ["ACE_Altimeter", displayNull])) exitWith {};
|
||||
|
||||
AGM_Parachute_AltimeterFnc = [uiNamespace getVariable ["AGM_Altimeter", displayNull], _unit] spawn {
|
||||
ACE_Parachute_AltimeterFnc = [uiNamespace getVariable ["ACE_Altimeter", displayNull], _unit] spawn {
|
||||
private ["_height", "_hour", "_minute", "_descentRate"];
|
||||
_unit = _this select 1;
|
||||
_height = floor ((getPosASL _unit) select 2);
|
||||
@ -36,7 +37,7 @@ AGM_Parachute_AltimeterFnc = [uiNamespace getVariable ["AGM_Altimeter", displayN
|
||||
_curTime = time;
|
||||
_prevTime = _curTime;
|
||||
while {true} do {
|
||||
_TimeText ctrlSetText (format ["%1:%2",[_hour, 2] call AGM_Core_fnc_numberToDigitsString,[_minute, 2] call AGM_Core_fnc_numberToDigitsString]);
|
||||
_TimeText ctrlSetText (format ["%1:%2",[_hour, 2] call ACE_Core_fnc_numberToDigitsString,[_minute, 2] call ACE_Core_fnc_numberToDigitsString]);
|
||||
_HeightText ctrlSetText (format ["%1", floor(_height)]);
|
||||
_DecendRate ctrlSetText (format ["%1", _descentRate max 0]);
|
||||
sleep 0.2;
|
||||
@ -47,6 +48,6 @@ AGM_Parachute_AltimeterFnc = [uiNamespace getVariable ["AGM_Altimeter", displayN
|
||||
_prevTime = _curTime;
|
||||
|
||||
// close altimeter, @todo _unit can change due to team switch, zeus!
|
||||
if !("AGM_Altimeter" in assignedItems _unit) exitWith {call AGM_Parachute_fnc_hideAltimeter};
|
||||
if !("ACE_Altimeter" in assignedItems _unit) exitWith {call ACE_Parachute_fnc_hideAltimeter};
|
||||
};
|
||||
};
|
1
addons/parachute/functions/script_component.hpp
Normal file
1
addons/parachute/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
||||
#include "\z\ace\addons\parachute\script_component.hpp"
|
12
addons/parachute/script_component.hpp
Normal file
12
addons/parachute/script_component.hpp
Normal file
@ -0,0 +1,12 @@
|
||||
#define COMPONENT parachute
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
#ifdef DEBUG_ENABLED_PARACHUTE
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_SETTINGS_PARACHUTE
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_PARACHUTE
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Edited with tabler - 2014-12-11 -->
|
||||
<Project name="AGM">
|
||||
<Project name="ACE">
|
||||
<Package name="Parachute">
|
||||
<Key ID="STR_AGM_Parachute_showAltimeter">
|
||||
<Key ID="STR_ACE_Parachute_showAltimeter">
|
||||
<English>Altimeter</English>
|
||||
<French>Altimètre</French>
|
||||
<German>Höhenmesser</German>
|
||||
@ -12,7 +12,7 @@
|
||||
<Hungarian>Magasságmérő</Hungarian>
|
||||
<Russian>Высотомер</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_AGM_Parachute_AltimeterDisplayName">
|
||||
<Key ID="STR_ACE_Parachute_AltimeterDisplayName">
|
||||
<English>Altimeter Watch</English>
|
||||
<French>Montre altimètre</French>
|
||||
<German>Höhenmesser</German>
|
||||
@ -22,7 +22,7 @@
|
||||
<Hungarian>Magasságmérő</Hungarian>
|
||||
<Russian>Часы с высотомером</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_AGM_Parachute_AltimeterDescription">
|
||||
<Key ID="STR_ACE_Parachute_AltimeterDescription">
|
||||
<English>Used to show height, descent rate and the time.</English>
|
||||
<French>Affiche la hauteur, le taux de descente et l'heure.</French>
|
||||
<German>Zeigt Höhe, Fallgeschwindigkeit und Uhrzeit.</German>
|
||||
@ -32,7 +32,7 @@
|
||||
<Hungarian>Mutatja a magasságot, zuhanás sebességét és az időt.</Hungarian>
|
||||
<Russian>Используется для определения высоты, скорости снижения и времени.</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_AGM_Parachute_NonSteerableParachute">
|
||||
<Key ID="STR_ACE_Parachute_NonSteerableParachute">
|
||||
<English>Non-Steerable Parachute</English>
|
||||
<German>Ungelenkter Fallschirm</German>
|
||||
<Spanish>Paracaídas no dirigible</Spanish>
|
||||
|
Loading…
Reference in New Issue
Block a user