Merge pull request #58 from Bjanski/Dev

Dev
This commit is contained in:
Jan Babor 2016-07-30 10:41:38 +02:00 committed by GitHub
commit f60fe7f5e8
6 changed files with 106 additions and 89 deletions

View File

@ -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" 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\"]" createVehicle !="_parachuteObject = createVehicle [\"Steerable_Parachute_F\", getPosATL player, [], 0, \"CAN_COLLIDE\"]"
addAction !="ExAd_ACTION_PARACHUTE = player addaction [format" addAction !="ExAd_ACTION_PARACHUTE = player addaction [format"

View File

@ -1,6 +1,13 @@
#<img src="logo.png" alt="ExAd" width="200" /> #<img src="logo.png" alt="ExAd" width="200" />
# Changelog: # Changelog:
## 1607330 11:00 . v0.7.11
### Fixed
* Modified fn_addApps. (XM8)
### Added
* New App function , fn_createCombo (XM8)
## 160726 17:15 . v0.7.10 ## 160726 17:15 . v0.7.10
### Fixed ### Fixed
* Apply custom functions to "More" app buttons. (XM8) * Apply custom functions to "More" app buttons. (XM8)

View File

@ -1,84 +1,84 @@
#Installation Instructions #Installation Instructions
* Move "DeployVehicle" into your "mpmissions\Exile.Tanoa\ExAdClient\XM8\Apps\" folder. * 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. * Navigate and open "mpmissions\Exile.Tanoa\config.cpp" insert the classes "PackDeployedVehicle" into appropriate parent classes.
```cpp ```cpp
class CfgInteractionMenus class CfgInteractionMenus
{ {
class Car class Car
{ {
targetType = 2; targetType = 2;
target = "Car"; target = "Car";
class Actions class Actions
{ {
class PackDeployedVehicle: ExileAbstractAction class PackDeployedVehicle: ExileAbstractAction
{ {
title = "Pack Vehicle"; title = "Pack Vehicle";
condition = "call ExAd_XM8_DV_fnc_canPack"; condition = "call ExAd_XM8_DV_fnc_canPack";
action = "call ExAd_XM8_DV_fnc_pack"; action = "call ExAd_XM8_DV_fnc_pack";
}; };
}; };
}; };
class Bikes class Bikes
{ {
targetType = 2; targetType = 2;
target = "Bicycle"; target = "Bicycle";
class Actions class Actions
{ {
class PackDeployedVehicle: ExileAbstractAction class PackDeployedVehicle: ExileAbstractAction
{ {
title = "Pack Bike"; title = "Pack Bike";
condition = "call ExAd_XM8_DV_fnc_canPack"; condition = "call ExAd_XM8_DV_fnc_canPack";
action = "call ExAd_XM8_DV_fnc_pack"; action = "call ExAd_XM8_DV_fnc_pack";
}; };
}; };
}; };
}; };
``` ```
* Move over and pack exad_dv into "@ExileServer\addons\" * 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. * Add deploy classes into CfgXM8 in "mpmissions\Exile.Tanoa\config.cpp" and add them to the extraApps array; E.g.
```cpp ```cpp
class CfgXM8 class CfgXM8
{ {
extraApps[] = {"ExAd_Bike","ExAd_Quad"}; extraApps[] = {"ExAd_Bike","ExAd_Quad"};
class ExAd_Bike class ExAd_Bike
{ {
title = "Deploy Bike"; title = "Deploy Bike";
config = "ExadClient\XM8\Apps\DeployVehicle\config.sqf"; config = "ExadClient\XM8\Apps\DeployVehicle\config.sqf";
bambiState = 0; bambiState = 0;
vehicleClass = "Exile_Bike_MountainBike"; vehicleClass = "Exile_Bike_MountainBike";
recipe[] = {{"Exile_Item_ExtensionCord",-1}}; recipe[] = {{"Exile_Item_ExtensionCord",-1}};
packable = 1; packable = 1;
autoCleanUp = 1; autoCleanUp = 1;
quickFunction = "['ExAd_Bike'] call ExAd_XM8_DV_fnc_spawnVehicle"; quickFunction = "['ExAd_Bike'] call ExAd_XM8_DV_fnc_spawnVehicle";
}; };
class ExAd_Quad class ExAd_Quad
{ {
title = "Deploy Quad"; title = "Deploy Quad";
bambiState = 0; bambiState = 0;
vehicleClass = "Exile_Bike_QuadBike_Fia"; vehicleClass = "Exile_Bike_QuadBike_Fia";
recipe[] = {{"Exile_Item_ExtensionCord",1}}; recipe[] = {{"Exile_Item_ExtensionCord",1}};
packable = 1; packable = 1;
quickFunction = "['ExAd_Quad'] call ExAd_XM8_DV_fnc_spawnVehicle"; quickFunction = "['ExAd_Quad'] call ExAd_XM8_DV_fnc_spawnVehicle";
}; };
}; };
``` ```
## How to use ## How to use
Each class added to the CfgXM8 will represent a vehicle possible to deploy and add commit a "More" button to it. 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. One of the deploy classes needs to include the config script so all needed functions will be prepared and read to memory.
### Options ### Options
* title = "Deploy Bike"; -- Button title * title = "Deploy Bike"; -- Button title
* bambiState = 0; -- Bambistate required || 1 = True / 0 = False * bambiState = 0; -- Bambistate required || 1 = True / 0 = False
* vehicleClass = "Exile_Bike_MountainBike"; -- CfgVehicles class name of desired vehicle * vehicleClass = "Exile_Bike_MountainBike"; -- CfgVehicles class name of desired vehicle
* recipe[] = { * recipe[] = {
{"Exile_Item_ExtensionCord",-1} {"Exile_Item_ExtensionCord",-1}
}; -- items needed to craft vehicle, first class name then amount (-1 means required but will not be taken from inventory) }; -- 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 * 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 * 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. * quickFunction = "['ExAd_Bike'] call ExAd_XM8_DV_fnc_spawnVehicle"; -- Function that is binded to the button if slide is not neccessary.

View File

@ -23,6 +23,7 @@ file = "ExAdClient\XM8\Functions";
class createBackgroundGUI {}; class createBackgroundGUI {};
class createButton {}; class createButton {};
class createCheckBox {}; class createCheckBox {};
class createCombo {};
class createCtrlGrp {}; class createCtrlGrp {};
class createEdit {}; class createEdit {};
class createExtraApps {}; class createExtraApps {};

View File

@ -42,13 +42,13 @@ while {_title != ""} do
_display = uiNameSpace getVariable ["RscExileXM8", displayNull]; _display = uiNameSpace getVariable ["RscExileXM8", displayNull];
_pW = 0.025; _pH = 0.04; _pW = 0.025; _pH = 0.04;
_slide = ctrlParentControlsGroup (_display displayCtrl _count2);
{ {
private["_ctrl","_pos","_logo"]; private["_ctrl","_pos","_logo","_function"];
_ctrl = (_display displayCtrl _count2); _ctrl = _display displayCtrl _count2;
_pos = ctrlPosition _ctrl; _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"}; _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; [_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;

View File

@ -0,0 +1,9 @@
params ["_display","_parent","_idc","_position","_actionOnSelChanged","_tooltip","_ctrl"];
_ctrl = _display ctrlCreate ["RscCombo",_idc,_parent];
_ctrl ctrlSetPosition _position;
_ctrl ctrlSetEventHandler ["LBSelChanged",_actionOnSelChanged];
_ctrl ctrlSetTooltip _tooltip;
_ctrl ctrlCommit 0;
_ctrl