mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Added ACE Attach posibility to add more types of attachable items
This commit is contained in:
parent
357fd1969b
commit
049edd1483
@ -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";
|
||||
};
|
||||
};
|
||||
|
@ -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";
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -38,78 +38,6 @@
|
||||
<Hungarian>Tárgy lecsatolása</Hungarian>
|
||||
<Russian>Отсоединить</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Attach_IrStrobe_Attached">
|
||||
<English>IR Strobe Attached</English>
|
||||
<German>IR-Stroboskop befestigt</German>
|
||||
<Spanish>Marcador IR acoplado</Spanish>
|
||||
<Polish>Przyczepiono stroboskop IR</Polish>
|
||||
<French>Strobe IR attaché</French>
|
||||
<Czech>IR Značkovač Připnutý</Czech>
|
||||
<Portuguese>Marcador IV Acoplado</Portuguese>
|
||||
<Italian>Strobo IR attaccata</Italian>
|
||||
<Hungarian>Infravörös jeladó hozzácsatolva</Hungarian>
|
||||
<Russian>ИК строб присоединён</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Attach_IrStrobe_Detached">
|
||||
<English>IR Strobe Detached</English>
|
||||
<German>IR-Stroboskop entfernt</German>
|
||||
<Spanish>Marcador IR quitado</Spanish>
|
||||
<Polish>Odczepiono stroboskop IR</Polish>
|
||||
<French>Strobe IR détaché</French>
|
||||
<Czech>IR Značkovač Odepnutý</Czech>
|
||||
<Portuguese>Marcador IV Separado</Portuguese>
|
||||
<Italian>Strobo IR staccata</Italian>
|
||||
<Hungarian>Infravörös jeladó lecsatolva</Hungarian>
|
||||
<Russian>ИК строб отсоединён</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Attach_IrGrenade_Attached">
|
||||
<English>IR Grenade Attached</English>
|
||||
<German>IR-Granate befestigt</German>
|
||||
<Spanish>Granada IR acoplada</Spanish>
|
||||
<Polish>Przyczepiono granat IR</Polish>
|
||||
<French>Grenade IR attachée</French>
|
||||
<Czech>IR Granát Připnutý</Czech>
|
||||
<Portuguese>Granada IV Acoplada</Portuguese>
|
||||
<Italian>Granata IR attaccata</Italian>
|
||||
<Hungarian>Infravörös gránát hozzácsatolva</Hungarian>
|
||||
<Russian>ИК граната присоединена</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Attach_IrGrenade_Detached">
|
||||
<English>IR Grenade Detached</English>
|
||||
<German>IR-Granate entfernt</German>
|
||||
<Spanish>Granada IR quitada</Spanish>
|
||||
<Polish>Odczepiono granat IR</Polish>
|
||||
<French>Grenade IR détachée</French>
|
||||
<Czech>IR Granát Odepnutý</Czech>
|
||||
<Portuguese>Granada IV Separada</Portuguese>
|
||||
<Italian>Granata IR staccata</Italian>
|
||||
<Hungarian>Infravörös gránát lecsatolva</Hungarian>
|
||||
<Russian>ИК граната отсоединена</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Attach_Chemlight_Attached">
|
||||
<English>Chemlight Attached</English>
|
||||
<German>Leuchtstab befestigt</German>
|
||||
<Spanish>Barra de luz acoplada</Spanish>
|
||||
<Polish>Przyczepiono światło chemiczne</Polish>
|
||||
<French>Chemlight attaché</French>
|
||||
<Czech>Chemické světlo Připnuto</Czech>
|
||||
<Portuguese>Chemlight Acoplada</Portuguese>
|
||||
<Italian>Chemlight attaccata</Italian>
|
||||
<Hungarian>Chemlight hozzácsatolva</Hungarian>
|
||||
<Russian>Химсвет присоединён</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Attach_Chemlight_Detached">
|
||||
<English>Chemlight Detached</English>
|
||||
<German>Leuchtstab entfernt</German>
|
||||
<Spanish>Barra de luz quitada</Spanish>
|
||||
<Polish>Odczepiono światło chemiczne</Polish>
|
||||
<French>Chemlight détaché</French>
|
||||
<Czech>Chemické světlo Odepnuto</Czech>
|
||||
<Portuguese>Chemlight Separada</Portuguese>
|
||||
<Italian>Chemlight staccata</Italian>
|
||||
<Hungarian>Chemlight hozzácsatolva</Hungarian>
|
||||
<Russian>Химсвет отсоединён</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Attach_Inventory_Full">
|
||||
<English>No inventory space</English>
|
||||
<German>Kein Platz im Inventar</German>
|
||||
@ -175,5 +103,29 @@
|
||||
<Russian>Присоединить Ошибка</Russian>
|
||||
<Spanish>Error al acoplar</Spanish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Attach_Item_Attached">
|
||||
<English>%1 Attached</English>
|
||||
<German>%1 befestigt</German>
|
||||
<Spanish>%1 acoplada</Spanish>
|
||||
<Polish>Przyczepiono %1</Polish>
|
||||
<French>%1 attachée</French>
|
||||
<Czech>%1 Připnutý</Czech>
|
||||
<Portuguese>%1 Acoplada</Portuguese>
|
||||
<Italian>%1 attaccata</Italian>
|
||||
<Hungarian>%1 hozzácsatolva</Hungarian>
|
||||
<Russian>%1 присоединена</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Attach_Item_Detached">
|
||||
<English>%1 Detached</English>
|
||||
<German>%1 entfernt</German>
|
||||
<Spanish>%1 quitada</Spanish>
|
||||
<Polish>Odczepiono %1</Polish>
|
||||
<French>%1 détachée</French>
|
||||
<Czech>%1 Odepnutý</Czech>
|
||||
<Portuguese>%1 Separada</Portuguese>
|
||||
<Italian>%1 staccata</Italian>
|
||||
<Hungarian>%1 lecsatolva</Hungarian>
|
||||
<Russian>%1 отсоединена</Russian>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
||||
|
Loading…
Reference in New Issue
Block a user