From 8bc6aceecaf1416f39460d61dd29f84c9d9cd27a Mon Sep 17 00:00:00 2001 From: jodav Date: Mon, 12 Jan 2015 10:20:50 +0100 Subject: [PATCH] postCBA --- addons/respawn/CfgAddons.hpp | 5 + addons/respawn/CfgEventHandlers.hpp | 20 ++ addons/respawn/CfgVehicleClasses.hpp | 5 + addons/respawn/CfgVehicles.hpp | 206 ++++++++++++++++++++ addons/respawn/XEH_preInit.sqf | 16 ++ addons/respawn/config.cpp | 279 +-------------------------- addons/respawn/script_component.hpp | 12 ++ 7 files changed, 273 insertions(+), 270 deletions(-) create mode 100644 addons/respawn/CfgAddons.hpp create mode 100644 addons/respawn/CfgEventHandlers.hpp create mode 100644 addons/respawn/CfgVehicleClasses.hpp create mode 100644 addons/respawn/CfgVehicles.hpp create mode 100644 addons/respawn/XEH_preInit.sqf create mode 100644 addons/respawn/script_component.hpp diff --git a/addons/respawn/CfgAddons.hpp b/addons/respawn/CfgAddons.hpp new file mode 100644 index 0000000000..910dc2ac4f --- /dev/null +++ b/addons/respawn/CfgAddons.hpp @@ -0,0 +1,5 @@ +class CfgAddons { + class GVAR(Rallypoints) { + list[] = {"ACE_Rallypoint_West", "ACE_Rallypoint_East", "ACE_Rallypoint_Independent", "ACE_RallypointExit_West", "ACE_RallypointExit_East", "ACE_RallypointExit_Independent"}; + }; +}; diff --git a/addons/respawn/CfgEventHandlers.hpp b/addons/respawn/CfgEventHandlers.hpp new file mode 100644 index 0000000000..687de2a825 --- /dev/null +++ b/addons/respawn/CfgEventHandlers.hpp @@ -0,0 +1,20 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE( call compile preprocessFileLineNumbers PATHTOF(XEH_preInit.sqf) ); + }; +}; + +class Extended_Killed_EventHandlers { + class CAManBase { + class GVAR(HandleGear) { + killed = QUOTE( _this call FUNC(handleKilled) ); + }; + }; +}; +class Extended_Respawn_EventHandlers { + class CAManBase { + class GVAR(HandleGear) { + respawn = QUOTE( _this call FUNC(handleRespawn) ); + }; + }; +}; diff --git a/addons/respawn/CfgVehicleClasses.hpp b/addons/respawn/CfgVehicleClasses.hpp new file mode 100644 index 0000000000..2907b719e9 --- /dev/null +++ b/addons/respawn/CfgVehicleClasses.hpp @@ -0,0 +1,5 @@ +class CfgVehicleClasses { + class GVAR(Rallypoints) { + displayName = "ACE Respawn"; + }; +}; diff --git a/addons/respawn/CfgVehicles.hpp b/addons/respawn/CfgVehicles.hpp new file mode 100644 index 0000000000..51ef4f030c --- /dev/null +++ b/addons/respawn/CfgVehicles.hpp @@ -0,0 +1,206 @@ +class CfgVehicles { + class Module_F; + class ACE_ModuleRespawn: Module_F { + author = "$STR_ACE_Core_ACETeam"; + category = "ACE"; + displayName = "Respawn System"; + function = FUNC(module); + scope = 2; + isGlobal = 1; + icon = PATHTOF(UI\Icon_Module_Respawn_ca.paa); + class Arguments { + class SavePreDeathGear { + displayName = "Save Gear?"; + description = "Respawn with the gear a soldier had just before his death?"; + typeName = "BOOL"; + class values { + class Yes { name = "Yes"; value = 1;}; + class No { default = 1; name = "No"; value = 0; }; + }; + }; + class RemoveDeadBodiesDisonncected { + displayName = "Remove bodies?"; + description = "Remove player bodies after disconnect?"; + typeName = "BOOL"; + class values { + class Yes { default = 1; name = "Yes"; value = 1;}; + class No { name = "No"; value = 0; }; + }; + }; + }; + }; + + class ACE_ModuleFriendlyFire: Module_F { + author = "$STR_ACE_Core_ACETeam"; + category = "ACE"; + displayName = "Friendly Fire Messages"; + function = FUNC(moduleFriendlyFire); + scope = 2; + isGlobal = 1; + icon = PATHTOF(UI\Icon_Module_FriendlyFire_ca.paa); + class Arguments { + }; + }; + + class ACE_ModuleRallypoint: Module_F { + author = "$STR_ACE_Core_ACETeam"; + category = "ACE"; + displayName = "Rallypoint System"; + function = FUNC(moduleRallypoint); + scope = 2; + isGlobal = 1; + icon = PATHTOF(UI\Icon_Module_Rallypoint_ca.paa); + class Arguments { + }; + }; + + // rallypoints + class FlagCarrier; + class Flag_NATO_F: FlagCarrier { + class ACE_Actions; + }; + + class Flag_CSAT_F: FlagCarrier { + class ACE_Actions; + }; + + class Flag_AAF_F: FlagCarrier { + class ACE_Actions; + }; + + // static + class ACE_Rallypoint_West: Flag_NATO_F { + author = "$STR_ACE_Core_ACETeam"; + displayName = "Rallypoint West Base"; + vehicleClass = QGVAR(Rallypoints); + + class EventHandlers { + init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_nato_CO.paa'; _this call FUNC(initRallypoint); + }; + class ACE_Actions: ACE_Actions { + class ACE_Teleport { + displayName = "Teleport to Rallypoint"; + distance = 4; + condition = QUOTE( side group _player == west ); + statement = QUOTE( [_player, side group _player, false] call FUNC(teleportToRallypoint); ); + showDisabled = 1; + priority = 1; + }; + }; + }; + + class ACE_Rallypoint_East: Flag_CSAT_F { + author = "$STR_ACE_Core_ACETeam"; + displayName = "Rallypoint East Base"; + vehicleClass = QGVAR(Rallypoints); + + class EventHandlers { + init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_CSAT_CO.paa'; _this call FUNC(initRallypoint); + }; + class ACE_Actions: ACE_Actions { + class ACE_Teleport { + displayName = "Teleport to Rallypoint"; + distance = 4; + condition = QUOTE( side group _player == east ); + statement = QUOTE( [_player, side group _player, false] call FUNC(teleportToRallypoint); )"; + showDisabled = 1; + priority = 1; + }; + }; + }; + + class ACE_Rallypoint_Independent: Flag_AAF_F { + author = "$STR_ACE_Core_ACETeam"; + displayName = "Rallypoint Independent Base"; + vehicleClass = QGVAR(Rallypoints); + + class EventHandlers { + init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_AAF_CO.paa'; _this call FUNC(initRallypoint); + }; + class ACE_Actions: ACE_Actions { + class ACE_Teleport { + displayName = "Teleport to Rallypoint"; + distance = 4; + condition = QUOTE( side group _player == independent ); + statement = QUOTE( [_player, side group _player, false] call FUNC(teleportToRallypoint); )"; + showDisabled = 1; + priority = 1; + }; + }; + }; + + // moveable + class ACE_RallypointExit_West: Flag_NATO_F { + author = "$STR_ACE_Core_ACETeam"; + displayName = "Rallypoint West"; + vehicleClass = QGVAR(Rallypoints); + + class EventHandlers { + init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_nato_CO.paa'; _this call FUNC(initRallypoint); + }; + class ACE_Actions: ACE_Actions { + class ACE_Teleport { + displayName = "Teleport to Base"; + distance = 4; + condition = QUOTE( side group _player == west ); + statement = QUOTE( [_player, side group _player, true] call FUNC(teleportToRallypoint); ); + showDisabled = 1; + priority = 1; + }; + }; + }; + + class ACE_RallypointExit_East: Flag_CSAT_F { + author = "$STR_ACE_Core_ACETeam"; + displayName = "Rallypoint East"; + vehicleClass = QGVAR(Rallypoints); + + class EventHandlers { + init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_CSAT_CO.paa'; _this call FUNC(initRallypoint); + }; + class ACE_Actions: ACE_Actions { + class ACE_Teleport { + displayName = "Teleport to Base"; + distance = 4; + condition = QUOTE( side group _player == east ); + statement = QUOTE( [_player, side group _player, true] call FUNC(teleportToRallypoint); ); + showDisabled = 1; + priority = 1; + }; + }; + }; + + class ACE_RallypointExit_Independent: Flag_AAF_F { + author = "$STR_ACE_Core_ACETeam"; + displayName = "Rallypoint Independent"; + vehicleClass = QGVAR(Rallypoints); + + class EventHandlers { + init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_AAF_CO.paa'; _this call FUNC(initRallypoint); + }; + class ACE_Actions: ACE_Actions { + class ACE_Teleport { + displayName = "Teleport to Base"; + distance = 4; + condition = QUOTE( side group _player == independent ); + statement = QUOTE( [_player, side group _player, true] call FUNC(teleportToRallypoint); ); + showDisabled = 1; + priority = 1; + }; + }; + }; + + // team leader + class Man; + class CAManBase: Man { + class ACE_SelfActions { + class ACE_MoveRallypoint { + displayName = "Move Rallypoint"; + condition = QUOTE( [_player, side group _player] call FUNC(canMoveRallypoint) ); + statement = QUOTE( [_player, side group _player] call FUNC(moveRallypoint) ); + showDisabled = 0; + priority = -0.5; + }; + }; + }; +}; \ No newline at end of file diff --git a/addons/respawn/XEH_preInit.sqf b/addons/respawn/XEH_preInit.sqf new file mode 100644 index 0000000000..9ce46777dd --- /dev/null +++ b/addons/respawn/XEH_preInit.sqf @@ -0,0 +1,16 @@ +#include "script_component.hpp" + +PREP(canMoveRallypoint); +PREP(getAllGear); +PREP(handleKilled); +PREP(handleRespawn); +PREP(initRallypoint); +PREP(module); +PREP(moduleFriendlyFire); +PREP(moduleRallypoint); +PREP(moveRallypoint); +PREP(removeBody); +PREP(removeDisconnectedPlayer); +PREP(restoreGear); +PREP(showFriendlyFireMessage); +PREP(teleportToRallypoint); diff --git a/addons/respawn/config.cpp b/addons/respawn/config.cpp index a959cc34f7..f193410a4a 100644 --- a/addons/respawn/config.cpp +++ b/addons/respawn/config.cpp @@ -1,9 +1,11 @@ +#include "script_component.hpp" + class CfgPatches { - class AGM_Respawn { + class ADDON { units[] = {}; - weapons[] = {"AGM_Rallypoint_West", "AGM_Rallypoint_East", "AGM_Rallypoint_Independent", "AGM_RallypointExit_West", "AGM_RallypointExit_East", "AGM_RallypointExit_Independent"}; + weapons[] = {"ACE_Rallypoint_West", "ACE_Rallypoint_East", "ACE_Rallypoint_Independent", "ACE_RallypointExit_West", "ACE_RallypointExit_East", "ACE_RallypointExit_Independent"}; requiredVersion = 0.60; - requiredAddons[] = {AGM_Core}; + requiredAddons[] = {"ace_core"}; version = "0.95"; versionStr = "0.95"; versionAr[] = {0,95,0}; @@ -12,270 +14,7 @@ class CfgPatches { }; }; -class CfgFunctions { - class AGM_Respawn { - class AGM_Respawn { - file = "AGM_Respawn\functions"; - class canMoveRallypoint; - class getAllGear; - class handleKilled; - class handleRespawn; - class initRallypoint; - class module; - class moduleFriendlyFire; - class moduleRallypoint; - class moveRallypoint; - class removeBody; - class removeDisconnectedPlayer; - class restoreGear; - class showFriendlyFireMessage; - class teleportToRallypoint; - }; - }; -}; - -class Extended_Killed_EventHandlers { - class CAManBase { - class AGM_Respawn_HandleGear { - killed = "_this call AGM_Respawn_fnc_handleKilled"; - }; - }; -}; -class Extended_Respawn_EventHandlers { - class CAManBase { - class AGM_Respawn_HandleGear { - respawn = "_this call AGM_Respawn_fnc_handleRespawn"; - }; - }; -}; - -class CfgAddons { - class AGM_Respawn_Rallypoints { - list[] = {"AGM_Rallypoint_West", "AGM_Rallypoint_East", "AGM_Rallypoint_Independent", "AGM_RallypointExit_West", "AGM_RallypointExit_East", "AGM_RallypointExit_Independent"}; - }; -}; - -class CfgVehicleClasses { - class AGM_Respawn_Rallypoints { - displayName = "AGM Respawn"; - }; -}; - -class CfgVehicles { - class Module_F; - class AGM_ModuleRespawn: Module_F { - author = "$STR_AGM_Core_AGMTeam"; - category = "AGM"; - displayName = "Respawn System"; - function = "AGM_Respawn_fnc_module"; - scope = 2; - isGlobal = 1; - icon = "\AGM_Respawn\UI\Icon_Module_Respawn_ca.paa"; - class Arguments { - class SavePreDeathGear { - displayName = "Save Gear?"; - description = "Respawn with the gear a soldier had just before his death?"; - typeName = "BOOL"; - class values { - class Yes { name = "Yes"; value = 1;}; - class No { default = 1; name = "No"; value = 0; }; - }; - }; - class RemoveDeadBodiesDisonncected { - displayName = "Remove bodies?"; - description = "Remove player bodies after disconnect?"; - typeName = "BOOL"; - class values { - class Yes { default = 1; name = "Yes"; value = 1;}; - class No { name = "No"; value = 0; }; - }; - }; - /*class BodyRemoveTimer { - displayName = "Time to remove bodies."; - description = "The amount of time (in seconds) after that a unit's body gets removed. Default: 90"; - typeName = "NUMBER"; - defaultValue = 90; - };*/ - }; - }; - - class AGM_ModuleFriendlyFire: Module_F { - author = "$STR_AGM_Core_AGMTeam"; - category = "AGM"; - displayName = "Friendly Fire Messages"; - function = "AGM_Respawn_fnc_moduleFriendlyFire"; - scope = 2; - isGlobal = 1; - icon = "\AGM_Respawn\UI\Icon_Module_FriendlyFire_ca.paa"; - class Arguments { - }; - }; - - class AGM_ModuleRallypoint: Module_F { - author = "$STR_AGM_Core_AGMTeam"; - category = "AGM"; - displayName = "Rallypoint System"; - function = "AGM_Respawn_fnc_moduleRallypoint"; - scope = 2; - isGlobal = 1; - icon = "\AGM_Respawn\UI\Icon_Module_Rallypoint_ca.paa"; - class Arguments { - }; - }; - - // rallypoints - class FlagCarrier; - class Flag_NATO_F: FlagCarrier { - class AGM_Actions; - }; - - class Flag_CSAT_F: FlagCarrier { - class AGM_Actions; - }; - - class Flag_AAF_F: FlagCarrier { - class AGM_Actions; - }; - - // static - class AGM_Rallypoint_West: Flag_NATO_F { - author = "$STR_AGM_Core_AGMTeam"; - displayName = "Rallypoint West Base"; - vehicleClass = "AGM_Respawn_Rallypoints"; - - class EventHandlers { - init = "(_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_nato_CO.paa'; _this call AGM_Respawn_fnc_initRallypoint"; - }; - class AGM_Actions: AGM_Actions { - class AGM_Teleport { - displayName = "Teleport to Rallypoint"; - distance = 4; - condition = "side group _player == west"; - statement = "[_player, side group _player, false] call AGM_Respawn_fnc_teleportToRallypoint;"; - showDisabled = 1; - priority = 1; - }; - }; - }; - - class AGM_Rallypoint_East: Flag_CSAT_F { - author = "$STR_AGM_Core_AGMTeam"; - displayName = "Rallypoint East Base"; - vehicleClass = "AGM_Respawn_Rallypoints"; - - class EventHandlers { - init = "(_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_CSAT_CO.paa'; _this call AGM_Respawn_fnc_initRallypoint"; - }; - class AGM_Actions: AGM_Actions { - class AGM_Teleport { - displayName = "Teleport to Rallypoint"; - distance = 4; - condition = "side group _player == east"; - statement = "[_player, side group _player, false] call AGM_Respawn_fnc_teleportToRallypoint;"; - showDisabled = 1; - priority = 1; - }; - }; - }; - - class AGM_Rallypoint_Independent: Flag_AAF_F { - author = "$STR_AGM_Core_AGMTeam"; - displayName = "Rallypoint Independent Base"; - vehicleClass = "AGM_Respawn_Rallypoints"; - - class EventHandlers { - init = "(_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_AAF_CO.paa'; _this call AGM_Respawn_fnc_initRallypoint"; - }; - class AGM_Actions: AGM_Actions { - class AGM_Teleport { - displayName = "Teleport to Rallypoint"; - distance = 4; - condition = "side group _player == independent"; - statement = "[_player, side group _player, false] call AGM_Respawn_fnc_teleportToRallypoint;"; - showDisabled = 1; - priority = 1; - }; - }; - }; - - // moveable - class AGM_RallypointExit_West: Flag_NATO_F { - author = "$STR_AGM_Core_AGMTeam"; - displayName = "Rallypoint West"; - vehicleClass = "AGM_Respawn_Rallypoints"; - - class EventHandlers { - init = "(_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_nato_CO.paa'; _this call AGM_Respawn_fnc_initRallypoint"; - }; - class AGM_Actions: AGM_Actions { - class AGM_Teleport { - displayName = "Teleport to Base"; - distance = 4; - condition = "side group _player == west"; - statement = "[_player, side group _player, true] call AGM_Respawn_fnc_teleportToRallypoint;"; - showDisabled = 1; - priority = 1; - }; - }; - }; - - class AGM_RallypointExit_East: Flag_CSAT_F { - author = "$STR_AGM_Core_AGMTeam"; - displayName = "Rallypoint East"; - vehicleClass = "AGM_Respawn_Rallypoints"; - - class EventHandlers { - init = "(_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_CSAT_CO.paa'; _this call AGM_Respawn_fnc_initRallypoint"; - }; - class AGM_Actions: AGM_Actions { - class AGM_Teleport { - displayName = "Teleport to Base"; - distance = 4; - condition = "side group _player == east"; - statement = "[_player, side group _player, true] call AGM_Respawn_fnc_teleportToRallypoint;"; - showDisabled = 1; - priority = 1; - }; - }; - }; - - class AGM_RallypointExit_Independent: Flag_AAF_F { - author = "$STR_AGM_Core_AGMTeam"; - displayName = "Rallypoint Independent"; - vehicleClass = "AGM_Respawn_Rallypoints"; - - class EventHandlers { - init = "(_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_AAF_CO.paa'; _this call AGM_Respawn_fnc_initRallypoint"; - }; - class AGM_Actions: AGM_Actions { - class AGM_Teleport { - displayName = "Teleport to Base"; - distance = 4; - condition = "side group _player == independent"; - statement = "[_player, side group _player, true] call AGM_Respawn_fnc_teleportToRallypoint;"; - showDisabled = 1; - priority = 1; - }; - }; - }; - - // team leader - class Man; - class CAManBase: Man { - class AGM_SelfActions { - class AGM_MoveRallypoint { - displayName = "Move Rallypoint"; - condition = "[_player, side group _player] call AGM_Respawn_fnc_canMoveRallypoint"; - statement = "[_player, side group _player] call AGM_Respawn_fnc_moveRallypoint"; - showDisabled = 0; - priority = -0.5; - }; - }; - }; -}; - -class AGM_Parameters_Boolean { - // Boolean Parameters (0/1) - AGM_Respawn_SavePreDeathGear = 0; - AGM_Respawn_RemoveDeadBodiesDisonncected = 1; -}; +#include "CfgEventHandlers.hpp" +#include "CfgAddons.hpp" +#include "CfgVehicleClasses.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/respawn/script_component.hpp b/addons/respawn/script_component.hpp new file mode 100644 index 0000000000..0ecb27b1d4 --- /dev/null +++ b/addons/respawn/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT respawn +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_RESPAWN + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_RESPAWN + #define DEBUG_SETTINGS DEBUG_SETTINGS_RESPAWN +#endif + +#include "\z\ace\addons\main\script_macros.hpp"