Browse Source

Partial implementation - interact not showing up

Prefer to avoid adding via init script, since class easier to read imo.
m3ales 4 years ago
parent
commit
d992bb868f

+ 5 - 1
addons - Copy/RD501_Main/XEH_preInit.sqf

@@ -82,4 +82,8 @@ call compile preprocessFileLineNumbers 'macro_mod_script_path\add_radio_freq_sho
         call {profileNamespace getVariable ["RD501_MedNotif_Message", "%1 is asking that you kindly hold still."]}
  ] call cba_settings_fnc_init;
  diag_log format["RD501_MedNotif[DEBUG]: %1", "Settings Added"];
-macro_prep_xeh(medical_notification\add_med_notification.sqf,add_med_notification)
+macro_prep_xeh(medical_notification\add_med_notification.sqf,add_med_notification)
+
+//R-2 Recon Drone
+macro_prep_xeh(infantry_uav\fnc_getRefuelMagazine.sqf,getRefuelMagazine)
+macro_prep_xeh(infantry_uav\fnc_refuelUAVDrone.sqf,refuelUAVDrone)

+ 11 - 0
addons - Copy/RD501_Main/functions/infantry_uav/fnc_getRefuelMagazine.sqf

@@ -0,0 +1,11 @@
+params["_unit", "_validRefuelOptions"];
+_hasItem = false;
+_items = (backpackMagazines _unit) + (uniformMagazines _unit) + (vestMagazines _unit);
+{
+	if (_x in _validRefuelOptions) exitWith
+	{
+		_unit removeMagazine _x;
+		_hasItem = true;
+	};
+} forEach _items;
+_hasItem

+ 14 - 0
addons - Copy/RD501_Main/functions/infantry_uav/fnc_refuelUAVDrone.sqf

@@ -0,0 +1,14 @@
+params["_player", "_target", "_params"];
+if(vehicle _target == _target) then
+{
+	_canRefuel = [_player, ["lightsaberG_swing"]] call rd501_fnc_getRefuelMagazine;
+	if(_canRefuel) then {
+		_target setFuel 100;
+		[format["Refuelled %1", _target], true, 2, 0] call ACE_common_fnc_displayText;
+	}else
+	{
+		[format["No fuel", _target], true, 2, 0] call ACE_common_fnc_displayText;
+	};
+}else{
+	["Cannot refuel this", true, 2, 0] call ACE_common_fnc_displayText;
+};

+ 28 - 1
addons - Copy/RD501_Vehicles/air/drones/config.cpp

@@ -169,6 +169,22 @@ class CfgVehicles
             
             class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers_base {};
         };
+		class ACE_Actions : ACE_Actions
+		{
+			class ACE_MainActions : ACE_MainActions
+			{
+				condition = macro_quote(true);
+				class RD501_Drone_Refuel
+				{
+					distance = 4;
+					displayName = "Refuel Drone";
+					condition = macro_quote(true);
+					statement = macro_quote(_this call macro_fnc_name(refuelUAVDrone));
+					position = macro_quote(call ace_interaction_fnc_getVehiclePos);
+
+				};
+			};
+		};
 		class assembleInfo
 		{
 			dissasembleTo[]=
@@ -434,7 +450,18 @@ class CfgVehicles
 	};
 	class macro_new_vehicle(drone,razor_recon):JLTS_UAV_prowler_gar
 	{
-		
+		class ACE_Actions : ACE_Actions
+		{
+			class ACE_MainActions : ACE_MainActions
+			{
+				class RD501_Drone_Refuel
+				{
+					displayName = "Refuel Drone";
+					condition = macro_quote(true);
+					statement = macro_quote(_this call macro_fnc_name(refuelUAVDrone));
+				};
+			};
+		};
 		displayName = "Hummingbird Recon Drone"
 		faction = macro_republic_faction
 		scope=2;

+ 7 - 2
addons - Copy/RD501_Vehicles/air/drones/inheritance.hpp

@@ -9,7 +9,9 @@ class Weapon_Bag_Base: Bag_Base
 };
 class JLTS_UAV_prowler_gar : JLTS_UAV_prowler_base
 {
-	
+	class ACE_Actions{
+		class ACE_MainActions;
+	};
 };
 class O_UAV_01_F:UAV_01_base_F
 {
@@ -38,7 +40,10 @@ class SWOP_Rebel_Dio_Droid:B_UAV_01_F
 };
 class swclonerecondroid:B_UAV_01_F
 {
-	
+	class ACE_Actions
+	{
+		class ACE_MainActions;
+	};
 };
 
 class UAV;