Guest User

Sickboy

a guest
Mar 11th, 2008
520
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.39 KB | None | 0 0
  1. // Extended event handlers by Solus and Killswitch
  2. class CfgPatches
  3. {
  4.     class Extended_EventHandlers
  5.     {
  6.         units[]={};
  7.         requiredVersion = 0.1;
  8.         requiredAddons[] = {"CACharacters","CAWeapons","CAWeapons3","CAAir"};
  9.         SLX_XEH2_Version = 1.3;
  10.     };
  11.    
  12.     // This is for backwards compatibility with the two older addons,
  13.     // whose CfgPatches names might have snuck into mission.sqm's or
  14.     // been used as requiredAddons by other addons.
  15.     class Extended_Init_EventHandlers
  16.     {
  17.         units[] = {};
  18.         requiredVersion = 0.1;
  19.         requiredAddons[] = {};
  20.     };
  21.     class Extended_Fired_EventHandlers
  22.     {
  23.         units[] = {};
  24.         requiredVersion = 0.1;
  25.         requiredAddons[] = {};
  26.     };
  27. };
  28.  
  29. class CfgAddons
  30. {
  31.     class PreloadAddons
  32.     {
  33.         class Extended_EventHandlers
  34.         {
  35.             list[]={"Extended_EventHandlers"};
  36.         };
  37.     };
  38. };
  39.  
  40. // Base event handlers class for CfgVehicles class EventHandlers to inherit.
  41. class Extended_EventHandlers
  42. {
  43.     // Here are the init and fired event handlers from the original two addons
  44.     init = "[_this select 0,""Extended_Init_EventHandlers""] call compile preprocessFile ""\Extended_EventHandlers\Init.sqf"";if(isNil 'XEH_temp')then{XEH_temp=true;execVM '\Extended_EventHandlers\temp.sqf'}";
  45.     // Get the shot fired, then put the info and the shot in an array and exec the getVariable Extended_FiredEH compiled scripts/functions.
  46.     fired = "_shot=nearestObject[_this select 0,_this select 4];[_this select 0,_this select 1,_this select 2,_this select 3,_this select 4,_shot]call((_this select 0)getVariable""Extended_FiredEH"")";
  47.  
  48.     // Here follows the other ArmA events and their event handlers.
  49.     animChanged     = "_this call ((_this select 0) getVariable ""Extended_AnimChangedEH"")";
  50.     animDone        = "_this call ((_this select 0) getVariable ""Extended_AnimDoneEH"")";
  51.     dammaged        = "_this call ((_this select 0) getVariable ""Extended_DammagedEH"")";
  52.     engine          = "_this call ((_this select 0) getVariable ""Extended_EngineEH"")";
  53.     fuel            = "_this call ((_this select 0) getVariable ""Extended_FuelEH"")";
  54.     gear            = "_this call ((_this select 0) getVariable ""Extended_GearEH"")";
  55.     getIn           = "_this call ((_this select 0) getVariable ""Extended_GetInEH"")";
  56.     getOut          = "_this call ((_this select 0) getVariable ""Extended_GetOutEH"")";
  57.     hit             = "_this call ((_this select 0) getVariable ""Extended_HitEH"")";
  58.     incomingMissile = "_this call ((_this select 0) getVariable ""Extended_IncomingMissileEH"")";
  59.     killed          = "_this call ((_this select 0) getVariable ""Extended_KilledEH"")";
  60.     landedTouchDown = "_this call ((_this select 0) getVariable ""Extended_LandedTouchDownEH"")";
  61.     landedStopped   = "_this call ((_this select 0) getVariable ""Extended_LandedStoppedEH"")";
  62. };
  63.  
  64. // Extended EH classes, where new events are defined.
  65. class Extended_Init_EventHandlers
  66. {
  67. // Default Extended Event Handlers: Add extended event handlers to compile code.
  68.     class All
  69.     {
  70.         // Compile code for other EHs to run and put them in the setVariable.
  71.         // Set up code for the remaining event handlers too...
  72.         SLX_Init_Other_All="_this call compile preprocessFile""\Extended_EventHandlers\InitOthers.sqf"";";
  73.     };
  74. };
  75. class Extended_Fired_EventHandlers
  76. {
  77. };
  78. class Extended_AnimChanged_EventHandlers
  79. {
  80. };
  81. class Extended_AnimDone_EventHandlers
  82. {
  83. };
  84. class Extended_Dammaged_EventHandlers
  85. {
  86. };
  87. class Extended_Engine_EventHandlers
  88. {
  89. };
  90. class Extended_Fuel_EventHandlers
  91. {
  92. };
  93. class Extended_Gear_EventHandlers
  94. {
  95. };
  96. class Extended_GetIn_EventHandlers
  97. {
  98. };
  99. class Extended_GetOut_EventHandlers
  100. {
  101. };
  102. class Extended_Hit_EventHandlers
  103. {
  104. };
  105. class Extended_IncomingMissile_EventHandlers
  106. {
  107. };
  108. class Extended_Killed_EventHandlers
  109. {
  110. };
  111. class Extended_LandedTouchDown_EventHandlers
  112. {
  113. };
  114. class Extended_LandedStopped_EventHandlers
  115. {
  116. };
  117. // Make event handler classes inherit extended event handlers.
  118. class CfgVehicles
  119. {
  120.     class All;
  121.     class Air;
  122.     class Man;
  123.     class AllVehicles: All
  124.     {
  125.         class EventHandlers : Extended_EventHandlers {};
  126.     };
  127.     class CAManBase: Man
  128.     {
  129.         class EventHandlers : Extended_EventHandlers {};
  130.     };
  131.     class Helicopter: Air
  132.     {
  133.         class EventHandlers : Extended_EventHandlers {};
  134.     };
  135.     class Plane: Air
  136.     {
  137.         class EventHandlers : Extended_EventHandlers {};
  138.     };
  139.     class ParachuteBase: Helicopter
  140.     {
  141.         class EventHandlers : Extended_EventHandlers {};
  142.     };
  143.     class AV8B: Plane
  144.     {
  145.         class EventHandlers : Extended_EventHandlers {};
  146.     };
  147. };
Advertisement
Add Comment
Please, Sign In to add comment