From a118cae13d0146bb33d6b8fe942a135f923c3bd0 Mon Sep 17 00:00:00 2001 From: Kavinsky Date: Fri, 10 Apr 2015 04:36:28 +0200 Subject: [PATCH] unified ACE_Attachable config entry now ACE_Attachable its a string and hold the effect for the item --- addons/attach/CfgMagazines.hpp | 16 +++++++--------- addons/attach/CfgWeapons.hpp | 3 +-- addons/attach/functions/fnc_attach.sqf | 6 +++--- .../functions/fnc_getChildrenAttachActions.sqf | 4 ++-- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/addons/attach/CfgMagazines.hpp b/addons/attach/CfgMagazines.hpp index a8b56c76ed..a000222adc 100644 --- a/addons/attach/CfgMagazines.hpp +++ b/addons/attach/CfgMagazines.hpp @@ -2,33 +2,31 @@ class CfgMagazines { class CA_Magazine; class B_IR_Grenade: CA_Magazine { - ACE_Attachable = 1; - ACE_attachable_effect = "B_IRStrobe"; + ACE_Attachable = "B_IRStrobe"; }; class O_IR_Grenade: B_IR_Grenade { - ACE_attachable_effect = "O_IRStrobe"; + ACE_Attachable = "O_IRStrobe"; }; class I_IR_Grenade: B_IR_Grenade { - ACE_attachable_effect = "I_IRStrobe"; + ACE_Attachable = "I_IRStrobe"; }; class SmokeShell; class Chemlight_green: SmokeShell { - ACE_Attachable = 1; - ACE_attachable_effect = "Chemlight_green"; + ACE_Attachable = "Chemlight_green"; }; class Chemlight_blue: Chemlight_green { - ACE_attachable_effect = "Chemlight_blue"; + ACE_Attachable = "Chemlight_blue"; }; class Chemlight_red: Chemlight_green { - ACE_attachable_effect = "Chemlight_red"; + ACE_Attachable = "Chemlight_red"; }; class Chemlight_yellow: Chemlight_green { - ACE_attachable_effect = "Chemlight_yellow"; + ACE_Attachable = "Chemlight_yellow"; }; }; diff --git a/addons/attach/CfgWeapons.hpp b/addons/attach/CfgWeapons.hpp index 6737662f10..9734ceb273 100644 --- a/addons/attach/CfgWeapons.hpp +++ b/addons/attach/CfgWeapons.hpp @@ -4,8 +4,7 @@ class CfgWeapons { class InventoryItem_Base_F; class ACE_IR_Strobe_Item: ACE_ItemCore { - ACE_attachable = 1; - ACE_attachable_effect = "ACE_IR_Strobe_Effect"; + ACE_attachable = "ACE_IR_Strobe_Effect"; author = "$STR_ACE_Common_ACETeam"; scope = 2; displayName = "$STR_ACE_IrStrobe_Name"; diff --git a/addons/attach/functions/fnc_attach.sqf b/addons/attach/functions/fnc_attach.sqf index 654932824a..3bb54eee16 100644 --- a/addons/attach/functions/fnc_attach.sqf +++ b/addons/attach/functions/fnc_attach.sqf @@ -27,15 +27,15 @@ if ((_itemClassname == "") || {!(_this call FUNC(canAttach))}) exitWith {ERROR(" _selfAttachPosition = [_unit, [-0.05, 0, 0.12], "rightshoulder"]; -_itemVehClass = getText (configFile >> "CfgWeapons" >> _itemClassname >> "ACE_attachable_effect"); +_itemVehClass = getText (configFile >> "CfgWeapons" >> _itemClassname >> "ACE_Attachable"); _onAtachText = getText (configFile >> "CfgWeapons" >> _itemClassname >> "displayName"); if (_itemVehClass == "") then { - _itemVehClass = getText (configFile >> "CfgMagazines" >> _itemClassname >> "ACE_attachable_effect"); + _itemVehClass = getText (configFile >> "CfgMagazines" >> _itemClassname >> "ACE_Attachable"); _onAtachText = getText (configFile >> "CfgMagazines" >> _itemClassname >> "displayName"); }; -if (_itemVehClass == "") exitWith {ERROR("no ACE_attachable_effect for Item");}; +if (_itemVehClass == "") exitWith {ERROR("no ACE_Attachable for Item");}; _onAtachText = format [localize "STR_ACE_Attach_Item_Attached", _onAtachText]; diff --git a/addons/attach/functions/fnc_getChildrenAttachActions.sqf b/addons/attach/functions/fnc_getChildrenAttachActions.sqf index 6ff9410475..3594e10bd6 100644 --- a/addons/attach/functions/fnc_getChildrenAttachActions.sqf +++ b/addons/attach/functions/fnc_getChildrenAttachActions.sqf @@ -26,7 +26,7 @@ _actions = []; if !(_x in _listed) then { _listed pushBack _x; _item = ConfigFile >> "CfgMagazines" >> _x; - if (getNumber (_item >> "ACE_Attachable") == 1) then { + if (getText (_item >> "ACE_Attachable") != "") then { _displayName = getText(_item >> "displayName"); _picture = getText(_item >> "picture"); _action = [_x, _displayName, _picture, {_this call FUNC(attach)}, {_this call FUNC(canAttach)}, {}, [_x]] call EFUNC(interact_menu,createAction); @@ -39,7 +39,7 @@ _actions = []; if !(_x in _listed) then { _listed pushBack _x; _item = ConfigFile >> "CfgWeapons" >> _x; - if (getNumber (_item >> "ACE_Attachable") == 1) then { + if (getText (_item >> "ACE_Attachable") != "") then { _displayName = getText(_item >> "displayName"); _picture = getText(_item >> "picture"); _action = [_x, _displayName, _picture, {_this call FUNC(attach)}, {_this call FUNC(canAttach)}, {}, [_x]] call EFUNC(interact_menu,createAction);