From 3896765c15d40cd4947f5b9f9604880663519fa8 Mon Sep 17 00:00:00 2001 From: Bjanski Date: Sat, 30 Jul 2016 10:35:55 +0200 Subject: [PATCH] optimize --- BattlEye/scripts.txt | 2 +- .../XM8/Apps/DeployVehicle/INSTALL.md | 168 +++++++++--------- .../ExAdClient/XM8/Functions/fn_addApps.sqf | 8 +- 3 files changed, 89 insertions(+), 89 deletions(-) diff --git a/BattlEye/scripts.txt b/BattlEye/scripts.txt index 292439c..4a9c69c 100644 --- a/BattlEye/scripts.txt +++ b/BattlEye/scripts.txt @@ -1,4 +1,4 @@ -eventHandler !="ExAd_ACTION_PARACHUTE_DETACH = (findDisplay 46) displayAddEventHandler ["KeyDown",{" +eventHandler !="ExAd_ACTION_PARACHUTE_DETACH = (findDisplay 46) displayAddEventHandler [\"KeyDown\",{" compile !="call compile format[\"_messageParameters call ExAd_fnc_%1;\",_messageName]" !="call compile format['%1 = if(isLocalized \"%1\")then{localize \"%1\"}else{\"%3" createVehicle !="_parachuteObject = createVehicle [\"Steerable_Parachute_F\", getPosATL player, [], 0, \"CAN_COLLIDE\"]" addAction !="ExAd_ACTION_PARACHUTE = player addaction [format" diff --git a/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/DeployVehicle/INSTALL.md b/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/DeployVehicle/INSTALL.md index 1ebe993..248683c 100644 --- a/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/DeployVehicle/INSTALL.md +++ b/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/DeployVehicle/INSTALL.md @@ -1,84 +1,84 @@ -#Installation Instructions - -* Move "DeployVehicle" into your "mpmissions\Exile.Tanoa\ExAdClient\XM8\Apps\" folder. -* Navigate and open "mpmissions\Exile.Tanoa\config.cpp" insert the classes "PackDeployedVehicle" into appropriate parent classes. -```cpp -class CfgInteractionMenus -{ - class Car - { - targetType = 2; - target = "Car"; - - class Actions - { - class PackDeployedVehicle: ExileAbstractAction - { - title = "Pack Vehicle"; - condition = "call ExAd_XM8_DV_fnc_canPack"; - action = "call ExAd_XM8_DV_fnc_pack"; - }; - }; - }; - class Bikes - { - targetType = 2; - target = "Bicycle"; - - class Actions - { - class PackDeployedVehicle: ExileAbstractAction - { - title = "Pack Bike"; - condition = "call ExAd_XM8_DV_fnc_canPack"; - action = "call ExAd_XM8_DV_fnc_pack"; - }; - }; - }; -}; -``` - -* Move over and pack exad_dv into "@ExileServer\addons\" -* Add deploy classes into CfgXM8 in "mpmissions\Exile.Tanoa\config.cpp" and add them to the extraApps array; E.g. -```cpp -class CfgXM8 -{ - extraApps[] = {"ExAd_Bike","ExAd_Quad"}; - - class ExAd_Bike - { - title = "Deploy Bike"; - config = "ExadClient\XM8\Apps\DeployVehicle\config.sqf"; - bambiState = 0; - vehicleClass = "Exile_Bike_MountainBike"; - recipe[] = {{"Exile_Item_ExtensionCord",-1}}; - packable = 1; - autoCleanUp = 1; - quickFunction = "['ExAd_Bike'] call ExAd_XM8_DV_fnc_spawnVehicle"; - }; - class ExAd_Quad - { - title = "Deploy Quad"; - bambiState = 0; - vehicleClass = "Exile_Bike_QuadBike_Fia"; - recipe[] = {{"Exile_Item_ExtensionCord",1}}; - packable = 1; - quickFunction = "['ExAd_Quad'] call ExAd_XM8_DV_fnc_spawnVehicle"; - }; -}; - -``` -## How to use -Each class added to the CfgXM8 will represent a vehicle possible to deploy and add commit a "More" button to it. -One of the deploy classes needs to include the config script so all needed functions will be prepared and read to memory. - -### Options -* title = "Deploy Bike"; -- Button title -* bambiState = 0; -- Bambistate required || 1 = True / 0 = False -* vehicleClass = "Exile_Bike_MountainBike"; -- CfgVehicles class name of desired vehicle -* recipe[] = { - {"Exile_Item_ExtensionCord",-1} - }; -- items needed to craft vehicle, first class name then amount (-1 means required but will not be taken from inventory) -* packable = 1; -- Deployed vehicle can be pack again || 1 = True / 0 = False -* autoCleanUp = 1; -- Server monitize crafted vehicles and despawn if idle to long. || 1 = True / 0 = False -* quickFunction = "['ExAd_Bike'] call ExAd_XM8_DV_fnc_spawnVehicle"; -- Function that is binded to the button if slide is not neccessary. +#Installation Instructions + +* Move "DeployVehicle" into your "mpmissions\Exile.Tanoa\ExAdClient\XM8\Apps\" folder. +* Navigate and open "mpmissions\Exile.Tanoa\config.cpp" insert the classes "PackDeployedVehicle" into appropriate parent classes. +```cpp +class CfgInteractionMenus +{ + class Car + { + targetType = 2; + target = "Car"; + + class Actions + { + class PackDeployedVehicle: ExileAbstractAction + { + title = "Pack Vehicle"; + condition = "call ExAd_XM8_DV_fnc_canPack"; + action = "call ExAd_XM8_DV_fnc_pack"; + }; + }; + }; + class Bikes + { + targetType = 2; + target = "Bicycle"; + + class Actions + { + class PackDeployedVehicle: ExileAbstractAction + { + title = "Pack Bike"; + condition = "call ExAd_XM8_DV_fnc_canPack"; + action = "call ExAd_XM8_DV_fnc_pack"; + }; + }; + }; +}; +``` + +* Move over and pack exad_dv into "@ExileServer\addons\" +* Add deploy classes into CfgXM8 in "mpmissions\Exile.Tanoa\config.cpp" and add them to the extraApps array; E.g. +```cpp +class CfgXM8 +{ + extraApps[] = {"ExAd_Bike","ExAd_Quad"}; + + class ExAd_Bike + { + title = "Deploy Bike"; + config = "ExadClient\XM8\Apps\DeployVehicle\config.sqf"; + bambiState = 0; + vehicleClass = "Exile_Bike_MountainBike"; + recipe[] = {{"Exile_Item_ExtensionCord",-1}}; + packable = 1; + autoCleanUp = 1; + quickFunction = "['ExAd_Bike'] call ExAd_XM8_DV_fnc_spawnVehicle"; + }; + class ExAd_Quad + { + title = "Deploy Quad"; + bambiState = 0; + vehicleClass = "Exile_Bike_QuadBike_Fia"; + recipe[] = {{"Exile_Item_ExtensionCord",1}}; + packable = 1; + quickFunction = "['ExAd_Quad'] call ExAd_XM8_DV_fnc_spawnVehicle"; + }; +}; + +``` +## How to use +Each class added to the CfgXM8 will represent a vehicle possible to deploy and add commit a "More" button to it. +One of the deploy classes needs to include the config script so all needed functions will be prepared and read to memory. + +### Options +* title = "Deploy Bike"; -- Button title +* bambiState = 0; -- Bambistate required || 1 = True / 0 = False +* vehicleClass = "Exile_Bike_MountainBike"; -- CfgVehicles class name of desired vehicle +* recipe[] = { + {"Exile_Item_ExtensionCord",-1} + }; -- items needed to craft vehicle, first class name then amount (-1 means required but will not be taken from inventory) +* packable = 1; -- Deployed vehicle can be pack again || 1 = True / 0 = False +* autoCleanUp = 1; -- Server monitize crafted vehicles and despawn if idle to long. || 1 = True / 0 = False +* quickFunction = "['ExAd_Bike'] call ExAd_XM8_DV_fnc_spawnVehicle"; -- Function that is binded to the button if slide is not neccessary. diff --git a/mpmissions/Exile.Altis/ExAdClient/XM8/Functions/fn_addApps.sqf b/mpmissions/Exile.Altis/ExAdClient/XM8/Functions/fn_addApps.sqf index cfe81c6..ff1dfe4 100644 --- a/mpmissions/Exile.Altis/ExAdClient/XM8/Functions/fn_addApps.sqf +++ b/mpmissions/Exile.Altis/ExAdClient/XM8/Functions/fn_addApps.sqf @@ -42,13 +42,13 @@ while {_title != ""} do _display = uiNameSpace getVariable ["RscExileXM8", displayNull]; _pW = 0.025; _pH = 0.04; +_slide = ctrlParentControlsGroup (_display displayCtrl _count2); { - private["_ctrl","_pos","_logo"]; - _ctrl = (_display displayCtrl _count2); + private["_ctrl","_pos","_logo","_function"]; + _ctrl = _display displayCtrl _count2; _pos = ctrlPosition _ctrl; - _slide = ctrlParentControlsGroup _ctrl; - + _logo = if(isText(missionConfigFile >> "CfgXM8" >> _x >> "logo"))then{getText(missionConfigFile >> "CfgXM8" >> _x >> "logo")}else{"ExAdClient\Core\Img\logo.paa"}; [_display,_slide,([_x,format["AppIcon%1",_count2]] call ExAd_fnc_getNextIDC),[(_pos select 0) + 1.5 * _pW, (_pos select 1) + 0.625 * _pH, 3 * _pW, 3 * _pH],_logo,[1,1,1,1],false,true,""] call ExAd_fnc_createPicture;