Performed initial conversion from AGM to ACE. Added necessary boilerplate files.

This commit is contained in:
Garth L-H de Wet 2015-02-02 22:52:08 +02:00
parent 03cef93ac7
commit 966cb6ffdf
16 changed files with 169 additions and 151 deletions

View File

@ -0,0 +1 @@
z\ace\addons\parachute

View 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));
};
};

View 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)

View File

@ -1,18 +1,18 @@
class RscText; class RscText;
class RscPicture; class RscPicture;
class RscTitles { class RscTitles {
class AGM_Altimeter { class ACE_Altimeter {
idd = 9935; idd = 9935;
enableSimulation = 1; enableSimulation = 1;
movingEnable = 0; movingEnable = 0;
fadeIn=0; fadeIn=0;
fadeOut=1; fadeOut=1;
duration = 10e10; duration = 10e10;
onLoad = "uiNamespace setVariable ['AGM_Altimeter', _this select 0];"; onLoad = "uiNamespace setVariable ['ACE_Altimeter', _this select 0];";
class controls { class controls {
class AltimeterImage: RscPicture { class AltimeterImage: RscPicture {
idc = 1200; idc = 1200;
text = "AGM_Parachute\UI\watch_altimeter.paa"; text = PATHTOF(UI\watch_altimeter.paa);
x = 0.118437 * safezoneW + safezoneX; x = 0.118437 * safezoneW + safezoneX;
y = 0.621 * safezoneH + safezoneY; y = 0.621 * safezoneH + safezoneY;
w = 0.20625 * safezoneW; w = 0.20625 * safezoneW;
@ -48,4 +48,4 @@ class RscTitles {
}; };
}; };
}; };
}; };

View 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"

View File

@ -0,0 +1,10 @@
#include "script_component.hpp"
ADDON = false;
PREP(doLanding);
PREP(hideAltimeter);
PREP(onEachFrame);
PREP(showAltimeter);
ADDON = true;

View File

@ -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"

View File

@ -1,81 +1,52 @@
#include "script_component.hpp"
class CfgPatches { class CfgPatches {
class AGM_Parachute { class ACE_Parachute {
units[] = {"AGM_NonSteerableParachute"}; units[] = {"ACE_NonSteerableParachute"};
weapons[] = {"AGM_Altimeter"}; weapons[] = {"ACE_Altimeter"};
requiredVersion = 0.60; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {AGM_Core}; requiredAddons[] = {"ace_common"};
version = "0.95"; VERSION_CONFIG;
versionStr = "0.95";
versionAr[] = {0,95,0};
author[] = {"Garth 'LH' de Wet"}; author[] = {"Garth 'LH' de Wet"};
authorUrl = "http://garth.snakebiteink.co.za/";
}; };
}; };
class CfgFunctions { #include "CfgEventHandlers.hpp"
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 "RscTitles.hpp" #include "RscTitles.hpp"
class CfgWeapons { class CfgWeapons {
class ItemWatch; class ItemWatch;
class AGM_Altimeter:ItemWatch { class ACE_Altimeter:ItemWatch {
author = "$STR_AGM_Core_AGMTeam"; author = "$STR_ACE_Common_ACETeam";
descriptionShort = "$STR_AGM_Parachute_AltimeterDescription"; descriptionShort = "$STR_ACE_Parachute_AltimeterDescription";
displayName = "$STR_AGM_Parachute_AltimeterDisplayName"; displayName = "$STR_ACE_Parachute_AltimeterDisplayName";
picture = "\AGM_Parachute\UI\watch_altimeter.paa"; picture = PATHTOF(UI\watch_altimeter.paa);
}; };
}; };
class CfgVehicles { class CfgVehicles {
class Box_NATO_Support_F; class Box_NATO_Support_F;
class AGM_Box_Misc: Box_NATO_Support_F { class ACE_Box_Misc: Box_NATO_Support_F {
class TransportItems { class TransportItems {
class _xx_AGM_Altimeter { class _xx_ACE_Altimeter {
name = "AGM_Altimeter"; name = "ACE_Altimeter";
count = 6; count = 6;
}; };
}; };
class TransportBackpacks { class TransportBackpacks {
class _xx_AGM_NonSteerableParachute { class _xx_ACE_NonSteerableParachute {
backpack = "AGM_NonSteerableParachute"; backpack = "ACE_NonSteerableParachute";
count = 4; count = 4;
}; };
}; };
}; };
class B_Parachute; class B_Parachute;
class AGM_NonSteerableParachute: B_Parachute { class ACE_NonSteerableParachute: B_Parachute {
author = "$STR_AGM_Core_AGMTeam"; author = "$STR_ACE_Common_ACETeam";
scope = 2; scope = 2;
displayName = "$STR_AGM_Parachute_NonSteerableParachute"; displayName = "$STR_ACE_Parachute_NonSteerableParachute";
//picture = "\A3\Characters_F\data\ui\icon_b_parachute_ca.paa"; // @todo //picture = "\A3\Characters_F\data\ui\icon_b_parachute_ca.paa"; // @todo
//model = "\A3\Weapons_F\Ammoboxes\Bags\Backpack_Parachute"; // @todo //model = "\A3\Weapons_F\Ammoboxes\Bags\Backpack_Parachute"; // @todo
backpackSimulation = "ParachuteNonSteerable"; //ParachuteSteerable backpackSimulation = "ParachuteNonSteerable"; //ParachuteSteerable
@ -84,7 +55,7 @@ class CfgVehicles {
mass = 100; mass = 100;
}; };
class B_Soldier_05_f; class B_Pilot_F: B_Soldier_05_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 = "AGM_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 = "AGM_NonSteerableParachute";}; class O_helipilot_F; class O_Pilot_F: O_helipilot_F {backpack = "ACE_NonSteerableParachute";};
}; };

View File

@ -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];

View File

@ -1,25 +1,27 @@
/* /*
Name: AGM_Parachute_fnc_doLanding Name: ACE_Parachute_fnc_doLanding
Author: Garth de Wet (LH) Author: Garth de Wet (LH)
Description: Description:
Performs the landing animation fix Performs the landing animation fix
Parameters: Parameters:
0: OBJECT - unit 0: OBJECT - unit
Returns: Returns:
Nothing Nothing
Example: Example:
[player] call AGM_Parachute_fnc_doLanding; [player] call ACE_Parachute_fnc_doLanding;
*/ */
#include "script_component.hpp"
private ["_unit"];
_unit = _this select 0; _unit = _this select 0;
["AGM_ParachuteFix", "OnEachFrame"] call BIS_fnc_removeStackedEventHandler; ["ACE_ParachuteFix", "OnEachFrame"] call BIS_fnc_removeStackedEventHandler;
AGM_Parachuting_PFH = false; ACE_Parachuting_PFH = false;
[_unit, "AmovPercMevaSrasWrflDf_AmovPknlMstpSrasWrflDnon", 2] call AGM_Core_fnc_doAnimation; [_unit, "AmovPercMevaSrasWrflDf_AmovPknlMstpSrasWrflDnon", 2] call ACE_Core_fnc_doAnimation;
[_unit] spawn { [_unit] spawn {
sleep 1; sleep 1;
(_this select 0) playActionNow "Crouch"; (_this select 0) playActionNow "Crouch";
}; };

View 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];

View File

@ -1,23 +1,24 @@
/* /*
Name: AGM_Parachute_fnc_onEachFrame Name: ACE_Parachute_fnc_onEachFrame
Author: Garth de Wet (LH) Author: Garth de Wet (LH)
Description: Description:
Checks if a unit can defuse an explosive Checks if a unit can defuse an explosive
Parameters: Parameters:
0: OBJECT - unit 0: OBJECT - unit
Returns: Returns:
Nothing Nothing
Example: Example:
call AGM_Parachute_fnc_onEachFrame; call ACE_Parachute_fnc_onEachFrame;
*/ */
#include "script_component.hpp"
private "_player"; private "_player";
_player = AGM_player; _player = ACE_player;
if (isNull _player) exitWith {["AGM_ParachuteFix", "OnEachFrame"] call BIS_fnc_removeStackedEventHandler;AGM_Parachuting_PFH = false;}; if (isNull _player) exitWith {["ACE_ParachuteFix", "OnEachFrame"] call BIS_fnc_removeStackedEventHandler;ACE_Parachuting_PFH = false;};
if !((vehicle _player) isKindOf "ParachuteBase") exitWith {}; if !((vehicle _player) isKindOf "ParachuteBase") exitWith {};
if (isTouchingGround _player) 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 { 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. // I believe this will not work for Zeus units.
deleteVehicle (vehicle _player); deleteVehicle (vehicle _player);
[_player] call AGM_Parachute_fnc_doLanding; [_player] call ACE_Parachute_fnc_doLanding;
}; };

View File

@ -1,26 +1,27 @@
/* /*
Name: AGM_Parachute_fnc_showAltimeter Name: ACE_Parachute_fnc_showAltimeter
Author: Garth de Wet (LH) Author: Garth de Wet (LH)
Description: Description:
Displays the altimeter on screen. Displays the altimeter on screen.
Parameters: Parameters:
0: OBJECT - unit to track for the altimeter 0: OBJECT - unit to track for the altimeter
Returns: Returns:
Nothing Nothing
Example: Example:
[player] call AGM_Parachute_fnc_showAltimeter [player] call ACE_Parachute_fnc_showAltimeter
*/ */
#include "script_component.hpp"
private ["_unit"]; private ["_unit"];
_unit = _this select 0; _unit = _this select 0;
(["AGM_Altimeter"] call BIS_fnc_rscLayer) cutRsc ["AGM_Altimeter", "PLAIN",0,true]; (["ACE_Altimeter"] call BIS_fnc_rscLayer) cutRsc ["ACE_Altimeter", "PLAIN",0,true];
if (isNull (uiNamespace getVariable ["AGM_Altimeter", displayNull])) exitWith {}; 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"]; private ["_height", "_hour", "_minute", "_descentRate"];
_unit = _this select 1; _unit = _this select 1;
_height = floor ((getPosASL _unit) select 2); _height = floor ((getPosASL _unit) select 2);
@ -36,7 +37,7 @@ AGM_Parachute_AltimeterFnc = [uiNamespace getVariable ["AGM_Altimeter", displayN
_curTime = time; _curTime = time;
_prevTime = _curTime; _prevTime = _curTime;
while {true} do { 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)]); _HeightText ctrlSetText (format ["%1", floor(_height)]);
_DecendRate ctrlSetText (format ["%1", _descentRate max 0]); _DecendRate ctrlSetText (format ["%1", _descentRate max 0]);
sleep 0.2; sleep 0.2;
@ -47,6 +48,6 @@ AGM_Parachute_AltimeterFnc = [uiNamespace getVariable ["AGM_Altimeter", displayN
_prevTime = _curTime; _prevTime = _curTime;
// close altimeter, @todo _unit can change due to team switch, zeus! // 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};
}; };
}; };

View File

@ -0,0 +1 @@
#include "\z\ace\addons\parachute\script_component.hpp"

View 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"

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- Edited with tabler - 2014-12-11 --> <!-- Edited with tabler - 2014-12-11 -->
<Project name="AGM"> <Project name="ACE">
<Package name="Parachute"> <Package name="Parachute">
<Key ID="STR_AGM_Parachute_showAltimeter"> <Key ID="STR_ACE_Parachute_showAltimeter">
<English>Altimeter</English> <English>Altimeter</English>
<French>Altimètre</French> <French>Altimètre</French>
<German>Höhenmesser</German> <German>Höhenmesser</German>
@ -12,7 +12,7 @@
<Hungarian>Magasságmérő</Hungarian> <Hungarian>Magasságmérő</Hungarian>
<Russian>Высотомер</Russian> <Russian>Высотомер</Russian>
</Key> </Key>
<Key ID="STR_AGM_Parachute_AltimeterDisplayName"> <Key ID="STR_ACE_Parachute_AltimeterDisplayName">
<English>Altimeter Watch</English> <English>Altimeter Watch</English>
<French>Montre altimètre</French> <French>Montre altimètre</French>
<German>Höhenmesser</German> <German>Höhenmesser</German>
@ -22,7 +22,7 @@
<Hungarian>Magasságmérő</Hungarian> <Hungarian>Magasságmérő</Hungarian>
<Russian>Часы с высотомером</Russian> <Russian>Часы с высотомером</Russian>
</Key> </Key>
<Key ID="STR_AGM_Parachute_AltimeterDescription"> <Key ID="STR_ACE_Parachute_AltimeterDescription">
<English>Used to show height, descent rate and the time.</English> <English>Used to show height, descent rate and the time.</English>
<French>Affiche la hauteur, le taux de descente et l'heure.</French> <French>Affiche la hauteur, le taux de descente et l'heure.</French>
<German>Zeigt Höhe, Fallgeschwindigkeit und Uhrzeit.</German> <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> <Hungarian>Mutatja a magasságot, zuhanás sebességét és az időt.</Hungarian>
<Russian>Используется для определения высоты, скорости снижения и времени.</Russian> <Russian>Используется для определения высоты, скорости снижения и времени.</Russian>
</Key> </Key>
<Key ID="STR_AGM_Parachute_NonSteerableParachute"> <Key ID="STR_ACE_Parachute_NonSteerableParachute">
<English>Non-Steerable Parachute</English> <English>Non-Steerable Parachute</English>
<German>Ungelenkter Fallschirm</German> <German>Ungelenkter Fallschirm</German>
<Spanish>Paracaídas no dirigible</Spanish> <Spanish>Paracaídas no dirigible</Spanish>