diff --git a/addons/attach/CfgMagazines.hpp b/addons/attach/CfgMagazines.hpp index d63b8db36b..8a1b590e3b 100644 --- a/addons/attach/CfgMagazines.hpp +++ b/addons/attach/CfgMagazines.hpp @@ -3,10 +3,35 @@ class CfgMagazines { class CA_Magazine; class B_IR_Grenade: CA_Magazine { ACE_Attachable = 1; + ACE_attachable_effect = "B_IRStrobe"; + }; + + class O_IR_Grenade: B_IR_Grenade { + ACE_attachable_effect = "O_IRStrobe"; + }; + + class I_IR_Grenade: B_IR_Grenade { + ACE_attachable_effect = "I_IRStrobe"; }; class SmokeShell; class Chemlight_green: SmokeShell { ACE_Attachable = 1; + ACE_attachable_effect = "Chemlight_green"; + }; + + class Chemlight_blue: Chemlight_green { + ACE_Attachable = 1; + ACE_attachable_effect = "Chemlight_blue"; + }; + + class Chemlight_red: Chemlight_green { + ACE_Attachable = 1; + ACE_attachable_effect = "Chemlight_red"; + }; + + class Chemlight_yellow: Chemlight_green { + ACE_Attachable = 1; + ACE_attachable_effect = "Chemlight_yellow"; }; }; diff --git a/addons/attach/CfgWeapons.hpp b/addons/attach/CfgWeapons.hpp index 4ad34832c5..6737662f10 100644 --- a/addons/attach/CfgWeapons.hpp +++ b/addons/attach/CfgWeapons.hpp @@ -5,6 +5,7 @@ class CfgWeapons { class ACE_IR_Strobe_Item: ACE_ItemCore { ACE_attachable = 1; + ACE_attachable_effect = "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 3703514fb6..3d9ecf4c3c 100644 --- a/addons/attach/functions/fnc_attach.sqf +++ b/addons/attach/functions/fnc_attach.sqf @@ -25,35 +25,19 @@ _itemClassname = [_args, 0, ""] call CBA_fnc_defaultParam; //Sanity Check (_unit has item in inventory, not over attach limit) if ((_itemClassname == "") || {!(_this call FUNC(canAttach))}) exitWith {ERROR("Tried to attach, but check failed");}; -_itemVehClass = ""; -_onAtachText = ""; _selfAttachPosition = [_unit, [-0.05, 0, 0.12], "rightshoulder"]; -switch (true) do { -case (_itemClassname == "ACE_IR_Strobe_Item"): { - _itemVehClass = "ACE_IR_Strobe_Effect"; - _onAtachText = localize "STR_ACE_Attach_IrStrobe_Attached"; - //_selfAttachPosition = [_unit, [0, -0.11, 0.16], "pilot"]; //makes it attach to the head a bit better, shoulder is not good for visibility - eRazeri - }; -case (_itemClassname == "B_IR_Grenade"): { - _itemVehClass = "B_IRStrobe"; - _onAtachText = localize "STR_ACE_Attach_IrGrenade_Attached"; - }; -case (_itemClassname == "O_IR_Grenade"): { - _itemVehClass = "O_IRStrobe"; - _onAtachText = localize "STR_ACE_Attach_IrGrenade_Attached"; - }; -case (_itemClassname == "I_IR_Grenade"): { - _itemVehClass = "I_IRStrobe"; - _onAtachText = localize "STR_ACE_Attach_IrGrenade_Attached"; - }; -case (toLower _itemClassname in ["chemlight_blue", "chemlight_green", "chemlight_red", "chemlight_yellow"]): { - _itemVehClass = _itemClassname; - _onAtachText = localize "STR_ACE_Attach_Chemlight_Attached"; - }; +_itemVehClass = getText (configFile >> "CfgWeapons" >> _itemClassname >> "ACE_attachable_effect"); +_onAtachText = getText (configFile >> "CfgWeapons" >> _itemClassname >> "displayName"); + +if (_itemVehClass == "") then { + _itemVehClass = getText (configFile >> "CfgMagazines" >> _itemClassname >> "ACE_attachable_effect"); + _onAtachText = getText (configFile >> "CfgMagazines" >> _itemClassname >> "displayName"); }; -if (_itemVehClass == "") exitWith {ERROR("no _itemVehClass for Item");}; +if (_itemVehClass == "") exitWith {ERROR("no ACE_attachable_effect for Item"); ERROR(_itemClassname);}; + +_onAtachText = format [localize "STR_ACE_Attach_Item_Attached", _onAtachText]; if (_unit == _attachToVehicle) then { //Self Attachment _unit removeItem _itemClassname; // Remove item diff --git a/addons/attach/functions/fnc_detach.sqf b/addons/attach/functions/fnc_detach.sqf index 124e5910d6..99ac646013 100644 --- a/addons/attach/functions/fnc_detach.sqf +++ b/addons/attach/functions/fnc_detach.sqf @@ -73,14 +73,9 @@ _attachToVehicle setVariable [QGVAR(Objects), _attachedObjects, true]; _attachToVehicle setVariable [QGVAR(ItemNames), _attachedItems, true]; // Display message -switch (true) do { -case (_itemName == "ACE_IR_Strobe_Item") : { - [localize "STR_ACE_Attach_IrStrobe_Detached"] call EFUNC(common,displayTextStructured); - }; -case (toLower _itemName in ["b_ir_grenade", "o_ir_grenade", "i_ir_grenade"]) : { - [localize "STR_ACE_Attach_IrGrenade_Detached"] call EFUNC(common,displayTextStructured); - }; -case (toLower _itemName in ["chemlight_blue", "chemlight_green", "chemlight_red", "chemlight_yellow"]) : { - [localize "STR_ACE_Attach_Chemlight_Detached"] call EFUNC(common,displayTextStructured); - }; +_itemDisplayName = getText (configFile >> "CfgWeapons" >> _itemName >> "displayName"); +if (_itemDisplayName == "") then { + _itemDisplayName = getText (configFile >> "CfgMagazines" >> _itemName >> "displayName"); }; + +[format [localize "STR_ACE_Attach_Item_Detached", _itemDisplayName]] call EFUNC(common,displayTextStructured); diff --git a/addons/attach/stringtable.xml b/addons/attach/stringtable.xml index 34e8883537..caa020ffb4 100644 --- a/addons/attach/stringtable.xml +++ b/addons/attach/stringtable.xml @@ -38,78 +38,6 @@ Tárgy lecsatolása Отсоединить - - IR Strobe Attached - IR-Stroboskop befestigt - Marcador IR acoplado - Przyczepiono stroboskop IR - Strobe IR attaché - IR Značkovač Připnutý - Marcador IV Acoplado - Strobo IR attaccata - Infravörös jeladó hozzácsatolva - ИК строб присоединён - - - IR Strobe Detached - IR-Stroboskop entfernt - Marcador IR quitado - Odczepiono stroboskop IR - Strobe IR détaché - IR Značkovač Odepnutý - Marcador IV Separado - Strobo IR staccata - Infravörös jeladó lecsatolva - ИК строб отсоединён - - - IR Grenade Attached - IR-Granate befestigt - Granada IR acoplada - Przyczepiono granat IR - Grenade IR attachée - IR Granát Připnutý - Granada IV Acoplada - Granata IR attaccata - Infravörös gránát hozzácsatolva - ИК граната присоединена - - - IR Grenade Detached - IR-Granate entfernt - Granada IR quitada - Odczepiono granat IR - Grenade IR détachée - IR Granát Odepnutý - Granada IV Separada - Granata IR staccata - Infravörös gránát lecsatolva - ИК граната отсоединена - - - Chemlight Attached - Leuchtstab befestigt - Barra de luz acoplada - Przyczepiono światło chemiczne - Chemlight attaché - Chemické světlo Připnuto - Chemlight Acoplada - Chemlight attaccata - Chemlight hozzácsatolva - Химсвет присоединён - - - Chemlight Detached - Leuchtstab entfernt - Barra de luz quitada - Odczepiono światło chemiczne - Chemlight détaché - Chemické světlo Odepnuto - Chemlight Separada - Chemlight staccata - Chemlight hozzácsatolva - Химсвет отсоединён - No inventory space Kein Platz im Inventar @@ -175,5 +103,29 @@ Присоединить Ошибка Error al acoplar + + %1 Attached + %1 befestigt + %1 acoplada + Przyczepiono %1 + %1 attachée + %1 Připnutý + %1 Acoplada + %1 attaccata + %1 hozzácsatolva + %1 присоединена + + + %1 Detached + %1 entfernt + %1 quitada + Odczepiono %1 + %1 détachée + %1 Odepnutý + %1 Separada + %1 staccata + %1 lecsatolva + %1 отсоединена +