diff --git a/ArmA_3/A3_EPOCH_virtualGarage/A3_EPOCH_virtualGarage.7z b/ArmA_3/A3_EPOCH_virtualGarage/A3_EPOCH_virtualGarage.7z deleted file mode 100644 index 83c4b85..0000000 Binary files a/ArmA_3/A3_EPOCH_virtualGarage/A3_EPOCH_virtualGarage.7z and /dev/null differ diff --git a/ArmA_3/A3_EPOCH_virtualGarage/README.md b/ArmA_3/A3_EPOCH_virtualGarage/README.md index e610c4d..02bccce 100644 --- a/ArmA_3/A3_EPOCH_virtualGarage/README.md +++ b/ArmA_3/A3_EPOCH_virtualGarage/README.md @@ -5,13 +5,54 @@ This script/menu gives any EPOCH player the ability to have a "cloud-storage" ve The amount of garage slots can be changed by the admin that installs this script onto his/her server.
All vehicles inside the garage are saved to the database (Redis) and are persistent IF inside the garage.
Which means that when the player takes it out and does not put it back before the server restarts; it will be gone.
- +
+
+#### Whats New? +
+**Server Side**
+[REMOVED] PublicVariable Event Handler
+[REMOVED] Spawn loop for generating keys for each
+[ADDED] 3 new functions to handle the removed PVEH(ReadFrom/WriteTo/TrashFrom)
+[ADDED] 2 new functions to spit out client vgs key and client garage on join
+[ADDED] Debug config option to log every use/request
+
+**Client Side**
+[FIXED] Global.hpp missing and caused hosts issues getting the script setup and running
+[ADDED] Ships are now searched for and listed for storage in the garage
+[FIXED] System searched for "Air", but listed only "Helicopters" (now planes and VTOL will show up).
+[ADDED] Scroll Wheel config option to disable/enable
+[ADDED] Dyna Menu self interaction
+[ADDED] Jammer requirement config option along with max distance from jammer entry
+[ADDED] Scroll Wheel will follow Jammer Requirements and Max Distance if enabled
+[ADDED] Dyna Menu will follow Jammer Requirements and Max Distance if enabled
+[ADDED] Debug config option to log each client vgs event
+[ADDED] New Function to handle the receipt of data from VGS server
+[FIXED] Refreshing of VGS GUI on Move IN and Move OUT was not refreshing both sides properly.
+
+**Configs**
+// Settings here
+debug = 0; // 1 = ON // 0 = OFF
+range = 25; // Vehicles within this range of player can be moved into garage
+useScrollWheel = 1; // Scroll Wheel VGS Menu
+requireJammer = 0; // 1 = ON // 0 = OFF
+maxDistanceFromJammer = 300; // meters, only applies if requireJammer = 1
+
+
#### Installation -**clientSide:** move the folder called `scarCODE` into the root of your mission file. Then open your description.ext and merge the content of the description.ext provided with this repository. Make sure you do not have `class cfgFunctions {` twice nor `tag="SC";` twice.
-**serverSide:** move the folder called `a3_epoch_virtualGarage` into your server's `@epochhive\addons` folder. When done with configuration, you can pack the contents of `a3_epoch_virtualGarage` into a pbo named exactly the same.
- +**clientSide:**
+move the folder called `scarCODE` into the root of your mission file.
+Then open your description.ext and merge the content of the description.ext provided with this repository.
+Then open your epoch_configs\configs\cfgRemoteExec.hpp and merge the content of the cfgRemoteExec.hpp provided with this repository.
+Then open your epoch_configs\configs\cfgActionMenu_self.hpp and merge the content of the cfgActionMenu_self.hpp provided with this repository.
+Then open your epoch_configs\configs\cfgFunctions.hpp and merge the content of the cfgFunctions.hpp provided with this repository.
+Make sure you do not have `tag="SC";` twice.
+
+**serverSide:**
+move the folder called `a3_epoch_virtualGarage` into your server's `@epochhive\addons` folder.
+When done with configuration, you can pack the contents of `a3_epoch_virtualGarage` into a pbo named exactly the same.
+
#### Configuration **clientSide:** open `config_VGS.hpp` located in `scarCODE\VGS` and edit its settings to your likings
-**serverSide:** open `config.cpp` located in `@epochhive\addons` and edit its setting to your likings
+**serverSide:** open `config.cpp` located in `@epochhive\addons\a3_epoch_virtualGarage` and edit its setting to your likings

*Want to help me out with making more stuff in the future? You can donate here: (PayPal) http://scarcode.com/donate/* diff --git a/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/config_VGS.hpp b/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/config_VGS.hpp index 9f60c5a..1b4ddd5 100644 --- a/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/config_VGS.hpp +++ b/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/config_VGS.hpp @@ -8,5 +8,9 @@ class cfgVGSclient { // Settings here + debug = 1; // 1 = ON // 0 = OFF range = 25; // Vehicles within this range of player can be moved into garage + useScrollWheel = 1; // Scroll Wheel VGS Menu + requireJammer = 0; // 1 = ON // 0 = OFF + maxDistanceFromJammer = 300; // meters, only applies if requireJammer = 1 }; diff --git a/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/functions_VGS/fn_dynaMenuCondition.sqf b/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/functions_VGS/fn_dynaMenuCondition.sqf new file mode 100644 index 0000000..fc0f0c9 --- /dev/null +++ b/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/functions_VGS/fn_dynaMenuCondition.sqf @@ -0,0 +1,38 @@ +/* + Author: DirtySanchez from DonkeyPunch.INFO + + Description: + Condition file for allowing DynaMenu or addAction + + Returns: + BOOLEAN +*/ +private["_nearestJammer", "_jammer", "_maxDist"]; +_result = false; +_nearestJammer = objNull; +_jammer = "requireJammer" call SC_fnc_vgsGetClientSetting; +if(_jammer isEqualTo 1)then +{ + _maxDist = "maxDistanceFromJammer" call SC_fnc_vgsGetClientSetting; + _jammer = nearestObjects[player, ["PlotPole_EPOCH"], _maxDist]; + if !(_jammer isEqualTo []) then + { + { + if (alive _x && (_x distance player) <= _maxDist) exitWith{ + _nearestJammer = _x; + }; + } foreach _jammer; + if !(isNull _nearestJammer) then + { + if((_nearestJammer getVariable["BUILD_OWNER", "-1"]) in[getPlayerUID player, Epoch_my_GroupUID])then + { + _result = true; + }; + }; + }; +}; +if(_jammer isEqualTo 0)then +{ + _result = true; +}; +_result \ No newline at end of file diff --git a/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/functions_VGS/fn_vgsInitClient.sqf b/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/functions_VGS/fn_vgsInitClient.sqf index 45dc67c..02f3deb 100644 --- a/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/functions_VGS/fn_vgsInitClient.sqf +++ b/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/functions_VGS/fn_vgsInitClient.sqf @@ -1,8 +1,10 @@ /* Author: IT07 - + + Contributor: DirtySanchez from DonkeyPunch.INFO + Description: - init file for Virtual Garage System menu + Client init file for Virtual Garage System menu */ if not hasInterface exitWith {}; @@ -15,14 +17,29 @@ if not hasInterface exitWith {}; ["[EPOCH VGS] ERROR! fn_initClientVGS called when display 46 AND EPOCH_loadingScreenDone are not(isNull/isNil)"] call BIS_fnc_errorMsg }; }; + waitUntil { uiSleep 2; (not(isNull(findDisplay 46)) AND not(isNil"EPOCH_loadingScreenDone")) }; - _aa = player addAction ["VGS",{createDialog'SC_vgsDiag';}, "", -1, false, true]; - "DynamicBlur" ppEffectEnable true; - waitUntil { uiSleep 0.5; not isNil"EPOCH_vgsMyKey" }; - if not(EPOCH_vgsMyKey isEqualTo "") then + + EPOCH_vgsMyKey = ""; + [player, Epoch_personalToken] remoteExec ["VGS_fnc_vgsRequestKey",2]; + + _debug = "debug" call SC_fnc_vgsGetClientSetting; + if(_debug isEqualTo 1) then {diag_log format["[EPOCH VGS]: ClientInit requesting key = %1", EPOCH_vgsMyKey]}; + + _addAction = "useScrollWheel" call SC_fnc_vgsGetClientSetting; + if(_addAction isEqualTo 1)then { - EPOCH_vgsPV = ["Request",[player,EPOCH_vgsMyKey]]; - publicVariableServer "EPOCH_vgsPV"; - EPOCH_vgsPV = nil; + _aa = player addAction ["VGS",{createDialog'SC_vgsDiag';}, "", -1, false, true,"","call SC_fnc_dynaMenuCondition",("maxDistanceFromJammer" call SC_fnc_vgsGetClientSetting)]; + if(_debug isEqualTo 1) then {diag_log format["[EPOCH VGS]: ClientInit added action = %1", _aa]}; }; + + waitUntil { uiSleep 0.5; not(EPOCH_vgsMyKey isEqualTo "") }; + if(_debug isEqualTo 1) then {diag_log format["[EPOCH VGS]: ClientInit received key = %1", EPOCH_vgsMyKey]}; + + EPOCH_vgsMyGarage = []; + [player, EPOCH_vgsMyKey] remoteExec ["VGS_fnc_vgsRequestGarage",2]; + if(_debug isEqualTo 1) then {diag_log format["[EPOCH VGS]: ClientInit requesting garage = %1", EPOCH_vgsMyGarage]}; + + waitUntil { uiSleep 0.5; not(EPOCH_vgsMyGarage isEqualTo []) }; + if(_debug isEqualTo 1) then {diag_log format["[EPOCH VGS]: ClientInit received garage = %1", EPOCH_vgsMyGarage]}; }; diff --git a/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/functions_VGS/fn_vgsMoveIn.sqf b/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/functions_VGS/fn_vgsMoveIn.sqf index 1d3cdca..237f205 100644 --- a/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/functions_VGS/fn_vgsMoveIn.sqf +++ b/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/functions_VGS/fn_vgsMoveIn.sqf @@ -1,5 +1,7 @@ /* Author: IT07 + + Contributor: DirtySanchez from DonkeyPunch.INFO Description: moves given selected vehicle INTO the virtual garage @@ -27,7 +29,7 @@ if not isNil"_dsp" then _ctrlFeedback ctrlSetText "Selected vehicle check #1 complete."; _ctrlFeedback ctrlSetText "Building check complete."; _range = "range" call SC_fnc_vgsGetClientSetting; - _vehs = (position player) nearEntities [['Air','Car','MotorCycle','Tank'], _range]; + _vehs = (position player) nearEntities [['Air','Car','MotorCycle','Tank','Ship'], _range]; if (_index < (count _vehs)) then { _ctrlFeedback ctrlSetText "Selected vehicle check #2 complete."; @@ -115,26 +117,9 @@ if not isNil"_dsp" then if (typeName EPOCH_vgsMyKey isEqualTo "STRING") then { _ctrlFeedback ctrlSetText "Key has correct typeName."; - EPOCH_vgsPV = ["Write",[_slot, _veh, player, EPOCH_vgsMyKey]]; - publicVariableServer "EPOCH_vgsPV"; - EPOCH_vgsPV = nil; + [_slot, _veh, player, EPOCH_vgsMyKey] remoteExec ["VGS_fnc_vgsWriteToGarage",2]; _ctrlFeedback ctrlSetText "Requesting data from server..."; - _changed = [_vehs, "EPOCH_vgsMyGarage"] call SC_fnc_vgsWaitForChange; - if _changed then - { - _ctrlFeedback ctrlSetText "Reloading outside vehicles..."; - _refreshed = ["Outside"] call SC_fnc_vgsRefresh; - if _refreshed then - { - _ctrlFeedback ctrlSetText "Reloading garage vehicles..."; - _refreshed = ["Inside"] call SC_fnc_vgsRefresh; - if _refreshed then - { - _lbInsideGarage ctrlEnable true; - _ctrlFeedback ctrlSetText "Loading done."; - }; - }; - }; + _lbInsideGarage ctrlEnable true; }; }; }; diff --git a/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/functions_VGS/fn_vgsMoveOut.sqf b/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/functions_VGS/fn_vgsMoveOut.sqf index 7b0d969..741e68d 100644 --- a/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/functions_VGS/fn_vgsMoveOut.sqf +++ b/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/functions_VGS/fn_vgsMoveOut.sqf @@ -1,6 +1,8 @@ /* Author: IT07 + Contributor: DirtySanchez from DonkeyPunch.INFO + Description: moves given selected vehicle OUT of the virtual garage @@ -40,25 +42,8 @@ if not isNil"_dsp" then if (typeName EPOCH_vgsMyKey isEqualTo "STRING") then { _ctrlFeedback ctrlSetText "Key has correct typeName."; - EPOCH_vgsPV = ["Read",[_slot, player, EPOCH_vgsMyKey]]; - publicVariableServer "EPOCH_vgsPV"; - EPOCH_vgsPV = nil; + [_slot, player, EPOCH_vgsMyKey] remoteExec ["VGS_fnc_vgsReadFromGarage",2]; _ctrlFeedback ctrlSetText "Requesting data from server..."; - _changed = [_vehs, "EPOCH_vgsMyGarage"] call SC_fnc_vgsWaitForChange; - if _changed then - { - _ctrlFeedback ctrlSetText "Server data received!"; - _refreshed = ["Inside"] call SC_fnc_vgsRefresh; - if _refreshed then - { - _ctrlFeedback ctrlSetText "Garage vehicles reloaded."; - _refreshed = ["Outside"] call SC_fnc_vgsRefresh; - if _refreshed then - { - _ctrlFeedback ctrlSetText "Loading done."; - }; - }; - }; }; }; }; diff --git a/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/functions_VGS/fn_vgsRecvFromServer.sqf b/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/functions_VGS/fn_vgsRecvFromServer.sqf new file mode 100644 index 0000000..7fd9d53 --- /dev/null +++ b/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/functions_VGS/fn_vgsRecvFromServer.sqf @@ -0,0 +1,36 @@ +/* + Author: DirtySanchez from DonkeyPunch.INFO + + Description: + Handles data from the VGS Server +*/ +private[]; +params [ "_type", "_data" ]; + +diag_log str([_type, _data]); + +switch _type do { + case "Key" : {EPOCH_vgsMyKey = _data}; + case "Garage" : {EPOCH_vgsMyGarage = _data}; +}; + +disableSerialization; +_dsp = uiNamespace getVariable "VGSdisplay"; +if not isNil"_dsp" then +{ + if not isNull _dsp then + { + _ctrlFeedback = _dsp displayCtrl 1002; + _ctrlFeedback ctrlSetText "Reloading garage vehicles..."; + _inside = ["Inside"] call SC_fnc_vgsRefresh; + if _inside then + { + _ctrlFeedback ctrlSetText "Reloading outside vehicles..."; + _outside = ["Outside"] call SC_fnc_vgsRefresh; + if _outside then + { + _ctrlFeedback ctrlSetText "Loading done."; + }; + }; + }; +}; \ No newline at end of file diff --git a/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/functions_VGS/fn_vgsRefresh.sqf b/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/functions_VGS/fn_vgsRefresh.sqf index 744d407..4ba4442 100644 --- a/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/functions_VGS/fn_vgsRefresh.sqf +++ b/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/functions_VGS/fn_vgsRefresh.sqf @@ -33,7 +33,7 @@ if not isNil"_dsp" then _ctrlNoVehs = _dsp displayCtrl 1006; _ctrlFeedBack = _dsp displayCtrl 1002; _range = "range" call SC_fnc_vgsGetClientSetting; - _vehs = (position player) nearEntities [['Air','Car','MotorCycle','Tank'], _range]; + _vehs = (position player) nearEntities [['Air','Car','MotorCycle','Tank','Ship'], _range]; if (count _vehs > 0) then { private ["_remVeh"]; @@ -92,11 +92,15 @@ if not isNil"_dsp" then { _add = true }; - case (_x isKindOf "Helicopter"): + case (_x isKindOf "Air"): { _add = true }; case (_x isKindOf "MotorCycle"): + { + _add = true + }; + case (_x isKindOf "Ship"): { _add = true }; diff --git a/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/functions_VGS/fn_vgsTrash.sqf b/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/functions_VGS/fn_vgsTrash.sqf index 5cedd12..5d3f4d7 100644 --- a/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/functions_VGS/fn_vgsTrash.sqf +++ b/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/functions_VGS/fn_vgsTrash.sqf @@ -42,14 +42,11 @@ if not isNil"_dsp" then if (typeName EPOCH_vgsMyKey isEqualTo "STRING") then { _ctrlFeedback ctrlSetText "Key has correct typeName."; - EPOCH_vgsPV = ["Trash",[_curSel, player, EPOCH_vgsMyKey]]; - publicVariableServer "EPOCH_vgsPV"; - EPOCH_vgsPV = nil; + [_curSel, player, EPOCH_vgsMyKey] remoteExec ["VGS_fnc_vgsTrashFromGarage",2]; _ctrlFeedback ctrlSetText "Requesting data from server..."; _changed = [_vehs, "EPOCH_vgsMyGarage"] call SC_fnc_vgsWaitForChange; if _changed then { - _reload = ["Inside"] call SC_fnc_vgsRefresh; _ctrlFeedback ctrlSetText "Vehicle deleted."; }; }; diff --git a/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/global.hpp b/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/global.hpp new file mode 100644 index 0000000..4f693e9 --- /dev/null +++ b/ArmA_3/A3_EPOCH_virtualGarage/clientSide/Epoch.MapName/scarCODE/VGS/global.hpp @@ -0,0 +1,1547 @@ +/////////////////////////////////////////////////////////////////////////// +/// Styles +/////////////////////////////////////////////////////////////////////////// + +// Control types +#define CT_STATIC 0 +#define CT_BUTTON 1 +#define CT_EDIT 2 +#define CT_SLIDER 3 +#define CT_COMBO 4 +#define CT_LISTBOX 5 +#define CT_TOOLBOX 6 +#define CT_CHECKBOXES 7 +#define CT_PROGRESS 8 +#define CT_HTML 9 +#define CT_STATIC_SKEW 10 +#define CT_ACTIVETEXT 11 +#define CT_TREE 12 +#define CT_STRUCTURED_TEXT 13 +#define CT_CONTEXT_MENU 14 +#define CT_CONTROLS_GROUP 15 +#define CT_SHORTCUTBUTTON 16 +#define CT_XKEYDESC 40 +#define CT_XBUTTON 41 +#define CT_XLISTBOX 42 +#define CT_XSLIDER 43 +#define CT_XCOMBO 44 +#define CT_ANIMATED_TEXTURE 45 +#define CT_OBJECT 80 +#define CT_OBJECT_ZOOM 81 +#define CT_OBJECT_CONTAINER 82 +#define CT_OBJECT_CONT_ANIM 83 +#define CT_LINEBREAK 98 +#define CT_USER 99 +#define CT_MAP 100 +#define CT_MAP_MAIN 101 +#define CT_LISTNBOX 102 +#define CT_CHECKBOX 77 + +// Static styles +#define ST_POS 0x0F +#define ST_HPOS 0x03 +#define ST_VPOS 0x0C +#define ST_LEFT 0x00 +#define ST_RIGHT 0x01 +#define ST_CENTER 0x02 +#define ST_DOWN 0x04 +#define ST_UP 0x08 +#define ST_VCENTER 0x0C + +#define ST_TYPE 0xF0 +#define ST_SINGLE 0x00 +#define ST_MULTI 0x10 +#define ST_TITLE_BAR 0x20 +#define ST_PICTURE 0x30 +#define ST_FRAME 0x40 +#define ST_BACKGROUND 0x50 +#define ST_GROUP_BOX 0x60 +#define ST_GROUP_BOX2 0x70 +#define ST_HUD_BACKGROUND 0x80 +#define ST_TILE_PICTURE 0x90 +#define ST_WITH_RECT 0xA0 +#define ST_LINE 0xB0 + +#define ST_SHADOW 0x100 +#define ST_NO_RECT 0x200 +#define ST_KEEP_ASPECT_RATIO 0x800 + +#define ST_TITLE ST_TITLE_BAR + ST_CENTER + +// Slider styles +#define SL_DIR 0x400 +#define SL_VERT 0 +#define SL_HORZ 0x400 + +#define SL_TEXTURES 0x10 + +// progress bar +#define ST_VERTICAL 0x01 +#define ST_HORIZONTAL 0 + +// Listbox styles +#define LB_TEXTURES 0x10 +#define LB_MULTI 0x20 + +// Tree styles +#define TR_SHOWROOT 1 +#define TR_AUTOCOLLAPSE 2 + +// MessageBox styles +#define MB_BUTTON_OK 1 +#define MB_BUTTON_CANCEL 2 +#define MB_BUTTON_USER 4 + +// GUI GRID +#define GUI_GRID_X (0) +#define GUI_GRID_Y (0) +#define GUI_GRID_W (0.025) +#define GUI_GRID_H (0.04) +#define GUI_GRID_WAbs (1) +#define GUI_GRID_HAbs (1) + +/////////////////////////////////////////////////////////////////////////// +/// Base Classes +/////////////////////////////////////////////////////////////////////////// + +class RscText +{ + deletable = 0; + fade = 0; + access = 0; + type = 0; + idc = -1; + colorBackground[] = + { + 0, + 0, + 0, + 0 + }; + colorText[] = + { + 1, + 1, + 1, + 1 + }; + text = ""; + fixedWidth = 0; + x = 0; + y = 0; + h = 0.037; + w = 0.3; + style = 0; + shadow = 1; + colorShadow[] = + { + 0, + 0, + 0, + 0.5 + }; + font = "PuristaMedium"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + linespacing = 1; + tooltipColorText[] = + { + 1, + 1, + 1, + 1 + }; + tooltipColorBox[] = + { + 1, + 1, + 1, + 1 + }; + tooltipColorShade[] = + { + 0, + 0, + 0, + 0.65 + }; +}; +class RscStructuredText +{ + deletable = 0; + fade = 0; + access = 0; + type = 13; + idc = -1; + style = 0; + colorText[] = + { + 1, + 1, + 1, + 1 + }; + class Attributes + { + font = "PuristaMedium"; + color = "#ffffff"; + align = "left"; + shadow = 1; + }; + x = 0; + y = 0; + h = 0.035; + w = 0.1; + text = ""; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + shadow = 1; +}; +class RscPicture +{ + deletable = 0; + fade = 0; + access = 0; + type = 0; + idc = -1; + style = 48; + colorBackground[] = + { + 0, + 0, + 0, + 0 + }; + colorText[] = + { + 1, + 1, + 1, + 1 + }; + font = "TahomaB"; + sizeEx = 0; + lineSpacing = 0; + text = ""; + fixedWidth = 0; + shadow = 0; + x = 0; + y = 0; + w = 0.2; + h = 0.15; + tooltipColorText[] = + { + 1, + 1, + 1, + 1 + }; + tooltipColorBox[] = + { + 1, + 1, + 1, + 1 + }; + tooltipColorShade[] = + { + 0, + 0, + 0, + 0.65 + }; +}; +class RscEdit +{ + deletable = 0; + fade = 0; + access = 1; + type = 2; + x = 0; + y = 0; + h = 0.04; + w = 0.2; + colorBackground[] = + { + 0, + 0, + 0, + 1 + }; + colorText[] = + { + 0.95, + 0.95, + 0.95, + 1 + }; + colorDisabled[] = + { + 1, + 1, + 1, + 0.25 + }; + colorSelection[] = + { + "(profilenamespace getvariable ['GUI_BCG_RGB_R',0.77])", + "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.51])", + "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.08])", + 1 + }; + autocomplete = ""; + text = ""; + size = 0.2; + style = "0x00 + 0x40"; + font = "PuristaMedium"; + shadow = 2; + sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + canModify = 1; + tooltipColorText[] = + { + 1, + 1, + 1, + 1 + }; + tooltipColorBox[] = + { + 1, + 1, + 1, + 1 + }; + tooltipColorShade[] = + { + 0, + 0, + 0, + 0.65 + }; +}; +class RscCombo +{ + deletable = 0; + fade = 0; + access = 0; + type = 4; + colorSelect[] = + { + 0, + 0, + 0, + 1 + }; + colorText[] = + { + 1, + 1, + 1, + 1 + }; + colorBackground[] = + { + 0, + 0, + 0, + 1 + }; + colorScrollbar[] = + { + 1, + 0, + 0, + 1 + }; + colorPicture[] = + { + 1, + 1, + 1, + 1 + }; + colorPictureSelected[] = + { + 1, + 1, + 1, + 1 + }; + colorPictureDisabled[] = + { + 1, + 1, + 1, + 0.25 + }; + colorPictureRight[] = + { + 1, + 1, + 1, + 1 + }; + colorPictureRightSelected[] = + { + 1, + 1, + 1, + 1 + }; + colorPictureRightDisabled[] = + { + 1, + 1, + 1, + 0.25 + }; + tooltipColorText[] = + { + 1, + 1, + 1, + 1 + }; + tooltipColorBox[] = + { + 1, + 1, + 1, + 1 + }; + tooltipColorShade[] = + { + 0, + 0, + 0, + 0.65 + }; + soundSelect[] = + { + "\A3\ui_f\data\sound\RscCombo\soundSelect", + 0.1, + 1 + }; + soundExpand[] = + { + "\A3\ui_f\data\sound\RscCombo\soundExpand", + 0.1, + 1 + }; + soundCollapse[] = + { + "\A3\ui_f\data\sound\RscCombo\soundCollapse", + 0.1, + 1 + }; + maxHistoryDelay = 1; + class ComboScrollBar + { + color[] = {1, 1, 1, 1}; + colorBackground[] = {0, 0, 0, 0.3}; + width = 0.021; + autoScrollEnabled = 0; + + colorActive[] = {1, 1, 1, 1}; + colorDisabled[] = {1, 1, 1, 0.3}; + thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; + arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; + arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; + border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; + }; + style = "0x10 + 0x200"; + font = "PuristaMedium"; + sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + shadow = 0; + x = 0; + y = 0; + w = 0.12; + h = 0.035; + colorSelectBackground[] = + { + 1, + 1, + 1, + 0.8 + }; + arrowEmpty = "\A3\ui_f\data\GUI\RscCommon\rsccombo\arrow_combo_ca.paa"; + arrowFull = "\A3\ui_f\data\GUI\RscCommon\rsccombo\arrow_combo_active_ca.paa"; + wholeHeight = 0.45; + colorActive[] = + { + 1, + 0, + 0, + 1 + }; + colorDisabled[] = + { + 1, + 1, + 1, + 0.25 + }; +}; +class RscListBox +{ + deletable = 0; + fade = 0; + access = 0; + type = 5; + rowHeight = 0; + colorText[] = + { + 1, + 1, + 1, + 1 + }; + colorDisabled[] = + { + 1, + 1, + 1, + 0.25 + }; + colorScrollbar[] = + { + 0, + 0, + 0, + 0 + }; + colorSelect[] = + { + 0, + 0, + 0, + 1 + }; + colorSelect2[] = + { + 0, + 0, + 0, + 1 + }; + colorSelectBackground[] = + { + 0.95, + 0.95, + 0.95, + 1 + }; + colorSelectBackground2[] = + { + 1, + 1, + 1, + 0.5 + }; + colorBackground[] = + { + -1, + -1, + -1, + -1 + }; + soundSelect[] = + { + "\A3\ui_f\data\sound\RscListbox\soundSelect", + 0.09, + 1 + }; + autoScrollSpeed = -1; + autoScrollDelay = 5; + autoScrollRewind = 0; + arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)"; + arrowFull = "#(argb,8,8,3)color(1,1,1,1)"; + colorPicture[] = + { + 1, + 1, + 1, + 1 + }; + colorPictureSelected[] = + { + 1, + 1, + 1, + 1 + }; + colorPictureDisabled[] = + { + 1, + 1, + 1, + 0.25 + }; + colorPictureRight[] = + { + 1, + 1, + 1, + 1 + }; + colorPictureRightSelected[] = + { + 1, + 1, + 1, + 1 + }; + colorPictureRightDisabled[] = + { + 1, + 1, + 1, + 0.25 + }; + tooltipColorText[] = + { + 1, + 1, + 1, + 1 + }; + tooltipColorBox[] = + { + 1, + 1, + 1, + 1 + }; + tooltipColorShade[] = + { + 0, + 0, + 0, + 0.65 + }; + class ListScrollBar //ListScrollBar is class name required for Arma 3 + { + color[] = {1, 1, 1, 1}; + colorBackground[] = {0, 0, 0, 0.3}; + width = 0.021; + autoScrollEnabled = 0; + colorActive[] = {1, 1, 1, 1}; + colorDisabled[] = {1, 1, 1, 0.3}; + thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; + arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; + arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; + border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; + }; + x = 0; + y = 0; + w = 0.3; + h = 0.3; + style = 16; + font = "PuristaMedium"; + sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + shadow = 0; + colorShadow[] = + { + 0, + 0, + 0, + 0.5 + }; + period = 1.2; + maxHistoryDelay = 1; +}; +class RscButton +{ + deletable = 0; + fade = 0; + access = 0; + type = 1; + text = ""; + colorText[] = + { + 1, + 1, + 1, + 1 + }; + colorDisabled[] = + { + 1, + 1, + 1, + 0.25 + }; + colorBackground[] = + { + 0, + 0, + 0, + 0.5 + }; + colorBackgroundDisabled[] = + { + 0, + 0, + 0, + 0.5 + }; + colorBackgroundActive[] = + { + 0, + 0, + 0, + 1 + }; + colorFocused[] = + { + 0, + 0, + 0, + 1 + }; + colorShadow[] = + { + 0, + 0, + 0, + 0 + }; + colorBorder[] = + { + 0, + 0, + 0, + 1 + }; + soundEnter[] = + { + "\A3\ui_f\data\sound\RscButton\soundEnter", + 0.09, + 1 + }; + soundPush[] = + { + "\A3\ui_f\data\sound\RscButton\soundPush", + 0.09, + 1 + }; + soundClick[] = + { + "\A3\ui_f\data\sound\RscButton\soundClick", + 0.09, + 1 + }; + soundEscape[] = + { + "\A3\ui_f\data\sound\RscButton\soundEscape", + 0.09, + 1 + }; + style = 2; + x = 0; + y = 0; + w = 0.095589; + h = 0.039216; + shadow = 2; + font = "PuristaMedium"; + sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + offsetX = 0; + offsetY = 0; + offsetPressedX = 0; + offsetPressedY = 0; + borderSize = 0; +}; +class RscShortcutButton +{ + deletable = 0; + fade = 0; + type = 16; + x = 0.1; + y = 0.1; + class HitZone + { + left = 0; + top = 0; + right = 0; + bottom = 0; + }; + class ShortcutPos + { + left = 0; + top = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 20) - (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2"; + w = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1) * (3/4)"; + h = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + }; + class TextPos + { + left = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1) * (3/4)"; + top = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 20) - (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2"; + right = 0.005; + bottom = 0; + }; + shortcuts[] = + { + }; + textureNoShortcut = "#(argb,8,8,3)color(0,0,0,0)"; + color[] = + { + 1, + 1, + 1, + 1 + }; + colorFocused[] = + { + 1, + 1, + 1, + 1 + }; + color2[] = + { + 0.95, + 0.95, + 0.95, + 1 + }; + colorDisabled[] = + { + 1, + 1, + 1, + 0.25 + }; + colorBackground[] = + { + "(profilenamespace getvariable ['GUI_BCG_RGB_R',0.77])", + "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.51])", + "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.08])", + 1 + }; + colorBackgroundFocused[] = + { + "(profilenamespace getvariable ['GUI_BCG_RGB_R',0.77])", + "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.51])", + "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.08])", + 1 + }; + colorBackground2[] = + { + 1, + 1, + 1, + 1 + }; + soundEnter[] = + { + "\A3\ui_f\data\sound\RscButton\soundEnter", + 0.09, + 1 + }; + soundPush[] = + { + "\A3\ui_f\data\sound\RscButton\soundPush", + 0.09, + 1 + }; + soundClick[] = + { + "\A3\ui_f\data\sound\RscButton\soundClick", + 0.09, + 1 + }; + soundEscape[] = + { + "\A3\ui_f\data\sound\RscButton\soundEscape", + 0.09, + 1 + }; + class Attributes + { + font = "PuristaMedium"; + color = "#E5E5E5"; + align = "left"; + shadow = "true"; + }; + idc = -1; + style = 0; + default = 0; + shadow = 1; + w = 0.183825; + h = "((((safezoneW / safezoneH) min 1.2) / 1.2) / 20)"; + textSecondary = ""; + colorSecondary[] = + { + 1, + 1, + 1, + 1 + }; + colorFocusedSecondary[] = + { + 1, + 1, + 1, + 1 + }; + color2Secondary[] = + { + 0.95, + 0.95, + 0.95, + 1 + }; + colorDisabledSecondary[] = + { + 1, + 1, + 1, + 0.25 + }; + sizeExSecondary = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + fontSecondary = "PuristaMedium"; + animTextureDefault = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\normal_ca.paa"; + animTextureNormal = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\normal_ca.paa"; + animTextureDisabled = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\normal_ca.paa"; + animTextureOver = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\over_ca.paa"; + animTextureFocused = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\focus_ca.paa"; + animTexturePressed = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\down_ca.paa"; + periodFocus = 1.2; + periodOver = 0.8; + period = 0.4; + font = "PuristaMedium"; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + text = ""; + action = ""; + class AttributesImage + { + font = "PuristaMedium"; + color = "#E5E5E5"; + align = "left"; + }; +}; +class RscShortcutButtonMain +{ + idc = -1; + style = 0; + default = 0; + w = 0.313726; + h = 0.104575; + color[] = + { + 1, + 1, + 1, + 1 + }; + colorDisabled[] = + { + 1, + 1, + 1, + 0.25 + }; + class HitZone + { + left = 0; + top = 0; + right = 0; + bottom = 0; + }; + class ShortcutPos + { + left = 0.0145; + top = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 20) - (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.2)) / 2"; + w = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.2) * (3/4)"; + h = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.2)"; + }; + class TextPos + { + left = "(((safezoneW / safezoneH) min 1.2) / 32) * 1.5"; + top = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 20)*2 - (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.2)) / 2"; + right = 0.005; + bottom = 0; + }; + animTextureNormal = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButtonMain\normal_ca.paa"; + animTextureDisabled = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButtonMain\disabled_ca.paa"; + animTextureOver = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButtonMain\over_ca.paa"; + animTextureFocused = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButtonMain\focus_ca.paa"; + animTexturePressed = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButtonMain\down_ca.paa"; + animTextureDefault = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButtonMain\normal_ca.paa"; + period = 0.5; + font = "PuristaMedium"; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.2)"; + sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.2)"; + text = ""; + action = ""; + class Attributes + { + font = "PuristaMedium"; + color = "#E5E5E5"; + align = "left"; + shadow = "false"; + }; + class AttributesImage + { + font = "PuristaMedium"; + color = "#E5E5E5"; + align = "false"; + }; +}; +class RscFrame +{ + type = 0; + idc = -1; + style = 64; + shadow = 2; + colorBackground[] = + { + 0, + 0, + 0, + 0 + }; + colorText[] = + { + 1, + 1, + 1, + 1 + }; + font = "PuristaMedium"; + sizeEx = 0.02; + text = ""; +}; +class RscSlider +{ + deletable = 0; + fade = 0; + access = 0; + type = 3; + style = 1024; + w = 0.3; + color[] = + { + 1, + 1, + 1, + 0.8 + }; + colorActive[] = + { + 1, + 1, + 1, + 1 + }; + shadow = 0; + h = 0.025; +}; +class IGUIBack +{ + type = 0; + idc = 124; + style = 128; + text = ""; + colorText[] = + { + 0, + 0, + 0, + 0 + }; + font = "PuristaMedium"; + sizeEx = 0; + shadow = 0; + x = 0.1; + y = 0.1; + w = 0.1; + h = 0.1; + colorbackground[] = + { + -1,-1,-1,-1 + //"(profilenamespace getvariable ['IGUI_BCG_RGB_R',0])", + //"(profilenamespace getvariable ['IGUI_BCG_RGB_G',1])", + //"(profilenamespace getvariable ['IGUI_BCG_RGB_B',1])", + //"(profilenamespace getvariable ['IGUI_BCG_RGB_A',0.8])" + }; +}; +class RscCheckBox +{ + idc = -1; + type = 77; + style = 0; + checked = 0; + x = "0.375 * safezoneW + safezoneX"; + y = "0.36 * safezoneH + safezoneY"; + w = "0.025 * safezoneW"; + h = "0.04 * safezoneH"; + color[] = + { + 1, + 1, + 1, + 0.7 + }; + colorFocused[] = + { + 1, + 1, + 1, + 1 + }; + colorHover[] = + { + 1, + 1, + 1, + 1 + }; + colorPressed[] = + { + 1, + 1, + 1, + 1 + }; + colorDisabled[] = + { + 1, + 1, + 1, + 0.2 + }; + colorBackground[] = + { + 0, + 0, + 0, + 0 + }; + colorBackgroundFocused[] = + { + 0, + 0, + 0, + 0 + }; + colorBackgroundHover[] = + { + 0, + 0, + 0, + 0 + }; + colorBackgroundPressed[] = + { + 0, + 0, + 0, + 0 + }; + colorBackgroundDisabled[] = + { + 0, + 0, + 0, + 0 + }; + textureChecked = "A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_checked_ca.paa"; + textureUnchecked = "A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_unchecked_ca.paa"; + textureFocusedChecked = "A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_checked_ca.paa"; + textureFocusedUnchecked = "A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_unchecked_ca.paa"; + textureHoverChecked = "A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_checked_ca.paa"; + textureHoverUnchecked = "A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_unchecked_ca.paa"; + texturePressedChecked = "A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_checked_ca.paa"; + texturePressedUnchecked = "A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_unchecked_ca.paa"; + textureDisabledChecked = "A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_checked_ca.paa"; + textureDisabledUnchecked = "A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_unchecked_ca.paa"; + tooltipColorText[] = + { + 1, + 1, + 1, + 1 + }; + tooltipColorBox[] = + { + 1, + 1, + 1, + 1 + }; + tooltipColorShade[] = + { + 0, + 0, + 0, + 0.65 + }; + soundEnter[] = + { + "", + 0.1, + 1 + }; + soundPush[] = + { + "", + 0.1, + 1 + }; + soundClick[] = + { + "", + 0.1, + 1 + }; + soundEscape[] = + { + "", + 0.1, + 1 + }; +}; +class RscTextCheckBox +{ + idc = -1; + type = 7; + style = 0; + x = "0.375 * safezoneW + safezoneX"; + y = "0.36 * safezoneH + safezoneY"; + w = "0.025 * safezoneW"; + h = "0.04 * safezoneH"; + colorText[] = + { + 1, + 0, + 0, + 1 + }; + color[] = + { + 0, + 0, + 0, + 0 + }; + colorBackground[] = + { + 0, + 0, + 1, + 1 + }; + colorTextSelect[] = + { + 0, + 0.8, + 0, + 1 + }; + colorSelectedBg[] = + { + "(profilenamespace getvariable ['GUI_BCG_RGB_R',0.77])", + "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.51])", + "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.08])", + 1 + }; + colorSelect[] = + { + 0, + 0, + 0, + 1 + }; + colorTextDisable[] = + { + 0.4, + 0.4, + 0.4, + 1 + }; + colorDisable[] = + { + 0.4, + 0.4, + 0.4, + 1 + }; + tooltipColorText[] = + { + 1, + 1, + 1, + 1 + }; + tooltipColorBox[] = + { + 1, + 1, + 1, + 1 + }; + tooltipColorShade[] = + { + 0, + 0, + 0, + 0.65 + }; + font = "PuristaMedium"; + sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; + rows = 1; + columns = 1; + strings[] = + { + "UNCHECKED" + }; + checked_strings[] = + { + "CHECKED" + }; +}; +class RscButtonMenu +{ + idc = -1; + type = 16; + style = "0x02 + 0xC0"; + default = 0; + shadow = 0; + x = 0; + y = 0; + w = 0.095589; + h = 0.039216; + animTextureNormal = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDisabled = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; + animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; + colorBackground[] = + { + 0, + 0, + 0, + 0.8 + }; + colorBackgroundFocused[] = + { + 1, + 1, + 1, + 1 + }; + colorBackground2[] = + { + 0.75, + 0.75, + 0.75, + 1 + }; + color[] = + { + 1, + 1, + 1, + 1 + }; + colorFocused[] = + { + 0, + 0, + 0, + 1 + }; + color2[] = + { + 0, + 0, + 0, + 1 + }; + colorText[] = + { + 1, + 1, + 1, + 1 + }; + colorDisabled[] = + { + 1, + 1, + 1, + 0.25 + }; + textSecondary = ""; + colorSecondary[] = + { + 1, + 1, + 1, + 1 + }; + colorFocusedSecondary[] = + { + 0, + 0, + 0, + 1 + }; + color2Secondary[] = + { + 0, + 0, + 0, + 1 + }; + colorDisabledSecondary[] = + { + 1, + 1, + 1, + 0.25 + }; + sizeExSecondary = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + fontSecondary = "PuristaLight"; + period = 1.2; + periodFocus = 1.2; + periodOver = 1.2; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + tooltipColorText[] = + { + 1, + 1, + 1, + 1 + }; + tooltipColorBox[] = + { + 1, + 1, + 1, + 1 + }; + tooltipColorShade[] = + { + 0, + 0, + 0, + 0.65 + }; + class TextPos + { + left = "0.25 * (((safezoneW / safezoneH) min 1.2) / 40)"; + top = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) - (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2"; + right = 0.005; + bottom = 0; + }; + class Attributes + { + font = "PuristaLight"; + color = "#E5E5E5"; + align = "left"; + shadow = "false"; + }; + class ShortcutPos + { + left = "(6.25 * (((safezoneW / safezoneH) min 1.2) / 40)) - 0.0225 - 0.005"; + top = 0.005; + w = 0.0225; + h = 0.03; + }; + soundEnter[] = + { + "\A3\ui_f\data\sound\RscButtonMenu\soundEnter", + 0.09, + 1 + }; + soundPush[] = + { + "\A3\ui_f\data\sound\RscButtonMenu\soundPush", + 0.09, + 1 + }; + soundClick[] = + { + "\A3\ui_f\data\sound\RscButtonMenu\soundClick", + 0.09, + 1 + }; + soundEscape[] = + { + "\A3\ui_f\data\sound\RscButtonMenu\soundEscape", + 0.09, + 1 + }; +}; +class RscButtonMenuOK +{ + idc = 1; + shortcuts[] = + { + "0x00050000 + 0", + 28, + 57, + 156 + }; + default = 1; + text = "OK"; + soundPush[] = + { + "\A3\ui_f\data\sound\RscButtonMenuOK\soundPush", + 0.09, + 1 + }; +}; +class RscButtonMenuCancel +{ + idc = 2; + shortcuts[] = + { + "0x00050000 + 1" + }; + text = "Cancel"; +}; +class RscControlsGroup +{ + deletable = 0; + fade = 0; + class VScrollbar + { + color[] = {1, 1, 1, 1}; + colorBackground[] = {0, 0, 0, 0.3}; + width = 0.021; + autoScrollEnabled = 0; + + colorActive[] = {1, 1, 1, 1}; + colorDisabled[] = {1, 1, 1, 0.3}; + thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; + arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; + arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; + border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; + }; + class HScrollbar + { + color[] = + { + 1, + 1, + 1, + 1 + }; + height = 0.028; + }; + class Controls + { + }; + type = 15; + idc = -1; + x = 0; + y = 0; + w = 1; + h = 1; + shadow = 0; + style = 16; +}; diff --git a/ArmA_3/A3_EPOCH_virtualGarage/clientSide/cfgActionMenu_self.hpp b/ArmA_3/A3_EPOCH_virtualGarage/clientSide/cfgActionMenu_self.hpp new file mode 100644 index 0000000..adba762 --- /dev/null +++ b/ArmA_3/A3_EPOCH_virtualGarage/clientSide/cfgActionMenu_self.hpp @@ -0,0 +1,9 @@ +// Add this to the end of epoch_config/Configs/CfgActionMenu/CfgActionMenu_self.hpp + +class VirtualGarage +{ + condition = "call SC_fnc_dynaMenuCondition"; + action = "createDialog 'SC_vgsDiag'"; + icon = "a3\ui_f\data\GUI\Rsc\RscDisplayArsenal\spaceGarage_ca.paa"; + tooltip = "Virtual Garage"; +}; \ No newline at end of file diff --git a/ArmA_3/A3_EPOCH_virtualGarage/clientSide/cfgFunctions.hpp b/ArmA_3/A3_EPOCH_virtualGarage/clientSide/cfgFunctions.hpp new file mode 100644 index 0000000..5e6b6d3 --- /dev/null +++ b/ArmA_3/A3_EPOCH_virtualGarage/clientSide/cfgFunctions.hpp @@ -0,0 +1,25 @@ +// Add this to epoch_config/Configs/CfgFunctions.hpp +// within the class CfgFunctions +/* +class cfgFunctions +{ +*/ + /////// scarCODE functions /////// + class scarCODE + { + tag = "SC"; + class VirtualGarageSystem + { + file = "scarCODE\VGS\functions_VGS"; + class vgsGetClientSetting {}; + class vgsOnLoad {}; + class vgsRefresh {}; + class vgsMoveOut {}; + class vgsMoveIn {}; + class vgsTrash {}; + class vgsWaitForChange {}; + class vgsRecvFromServer {}; + class dynaMenuCondition {}; + class vgsInitClient { postInit = 1; }; + }; + }; \ No newline at end of file diff --git a/ArmA_3/A3_EPOCH_virtualGarage/clientSide/cfgRemoteExec.hpp b/ArmA_3/A3_EPOCH_virtualGarage/clientSide/cfgRemoteExec.hpp new file mode 100644 index 0000000..d1eaaff --- /dev/null +++ b/ArmA_3/A3_EPOCH_virtualGarage/clientSide/cfgRemoteExec.hpp @@ -0,0 +1,35 @@ +// Add this to epoch_config/Configs/CfgRemoteExec.hpp +// within the class Functions +/* +class CfgRemoteExec +{ + class Functions + { + mode = 1; + jip = 0; +*/ + class VGS_fnc_vgsWriteToGarage + { + allowedTargets = 2; + jip = 0; + }; + class VGS_fnc_vgsReadFromGarage + { + allowedTargets = 2; + jip = 0; + }; + class VGS_fnc_vgsTrashFromGarage + { + allowedTargets = 2; + jip = 0; + }; + class VGS_fnc_vgsRequestGarage + { + allowedTargets = 2; + jip = 0; + }; + class VGS_fnc_vgsRequestKey + { + allowedTargets = 2; + jip = 0; + }; \ No newline at end of file diff --git a/ArmA_3/A3_EPOCH_virtualGarage/clientSide/description.ext b/ArmA_3/A3_EPOCH_virtualGarage/clientSide/description.ext index 5a66152..8b2fb16 100644 --- a/ArmA_3/A3_EPOCH_virtualGarage/clientSide/description.ext +++ b/ArmA_3/A3_EPOCH_virtualGarage/clientSide/description.ext @@ -1,22 +1,2 @@ -#include "scarCODE\VGS\main_VGS.hpp" - -class cfgFunctions -{ - /////// scarCODE functions /////// - class scarCODE - { - tag = "SC"; - class VirtualGarageSystem - { - file = "scarCODE\VGS\functions_VGS"; - class vgsGetClientSetting {}; - class vgsOnLoad {}; - class vgsRefresh {}; - class vgsMoveOut {}; - class vgsMoveIn {}; - class vgsTrash {}; - class vgsWaitForChange {}; - class vgsInitClient { postInit = 1; }; - }; - }; -}; \ No newline at end of file +#include "scarCODE\VGS\global.hpp" +#include "scarCODE\VGS\main_VGS.hpp" \ No newline at end of file diff --git a/ArmA_3/A3_EPOCH_virtualGarage/serverSide/a3_epoch_virtualGarage/config.cpp b/ArmA_3/A3_EPOCH_virtualGarage/serverSide/a3_epoch_virtualGarage/config.cpp index 06b0fb9..359c4bf 100644 --- a/ArmA_3/A3_EPOCH_virtualGarage/serverSide/a3_epoch_virtualGarage/config.cpp +++ b/ArmA_3/A3_EPOCH_virtualGarage/serverSide/a3_epoch_virtualGarage/config.cpp @@ -7,8 +7,10 @@ class cfgVGS { + debug = 1; // 0 = OFF maxGarageSlots = 7; // Self-explenatory, right? vehBlacklist[] = {"O_Truck_Big_cock_F"}; // Put classnames of disallowed vehicles in here + expiresVirtualGarage = 604800; // time is in seconds }; class CfgPatches @@ -34,6 +36,11 @@ class cfgFunctions file = "\a3_epoch_virtualGarage\functions_VGS"; class vgsGetServerSetting {}; class vgsGenKey {}; + class vgsWriteToGarage {}; + class vgsReadFromGarage {}; + class vgsTrashFromGarage {}; + class vgsRequestGarage {}; + class vgsRequestKey {}; class vgsInitServer { postInit = 1; }; }; }; diff --git a/ArmA_3/A3_EPOCH_virtualGarage/serverSide/a3_epoch_virtualGarage/functions_VGS/fn_vgsInitServer.sqf b/ArmA_3/A3_EPOCH_virtualGarage/serverSide/a3_epoch_virtualGarage/functions_VGS/fn_vgsInitServer.sqf index 2adb50b..91a1fe0 100644 --- a/ArmA_3/A3_EPOCH_virtualGarage/serverSide/a3_epoch_virtualGarage/functions_VGS/fn_vgsInitServer.sqf +++ b/ArmA_3/A3_EPOCH_virtualGarage/serverSide/a3_epoch_virtualGarage/functions_VGS/fn_vgsInitServer.sqf @@ -1,6 +1,8 @@ /* Author: IT07 + Contributor: DirtySanchez from DonkeyPunch.INFO + Description: init for a3_epoch_garage */ @@ -9,461 +11,4 @@ diag_log "///////////////////////////////////////////"; diag_log format["[EPOCH VGS] Starting version %1", ([["cfgPatches","a3_epoch_virtualGarage"],["version"]] call VGS_fnc_vgsGetServerSetting) select 0]; diag_log "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"; -"EPOCH_vgsPV" addPublicVariableEventHandler -{ - _packet = [_this, 1, [], [[]]] call BIS_fnc_param; - if (count _packet > 1) then - { - if (count _packet < 3) then - { - _data = [_packet, 1, [],[[]]] call BIS_fnc_param; - if (count _data > 1) then - { - switch (_this select 1 select 0) do // Mode - { - case "Request": - { - if (count _data isEqualTo 2) then - { - Private ["_player","_exitLog"]; - _player = [_data, 0, objNull, [objNull]] call BIS_fnc_param; // Put sent value into var - if not isNull _player then - { - _key = [_data, 1, "", [""]] call BIS_fnc_param; - if ([_player, _key] in (uiNamespace getVariable "EPOCH_vgsKeys")) then - { - // Data is valid let's get the cars from db and send it to client - _playerUID = getPlayerUID _player; - _response = [format["EPOCH_vgsOwnedVehs_%1", _playerUID], _playerUID] call EPOCH_fnc_server_hiveGET; - if isNil"_response" then { _response = [1,[[],[]]] }; - _vehData = _response select 1; - if (_vehData isEqualTo []) then - { - _vehData = [[],[]]; - }; - if ((_response select 0) isEqualTo 1) then - { - if (typeName _vehData isEqualTo "ARRAY") then - { - _vehsFriendly = _vehData select 0; - _vehsRaw = _vehData select 1; - _slots = "maxGarageSlots" call VGS_fnc_vgsGetServerSetting; - if (count _vehsFriendly < _slots) then - { - if (count _vehsRaw < _slots) then - { - for "_s" from 1 to (_slots-(count _vehsFriendly)) do - { - _vehsFriendly pushBack []; - _vehsRaw pushBack []; - }; - }; - // Save changes to DB - [format["EPOCH_vgsOwnedVehs_%1", _playerUID], _playerUID, [_vehsFriendly, _vehsRaw]] call EPOCH_fnc_server_hiveSET; - }; - if (count _vehsFriendly > _slots) then - { - if (count _vehsRaw > _slots) then - { - for "_s" from 1 to ((count _vehsFriendly)-_slots) do - { - _vehsFriendly resize _slots; - _vehsRaw resize _slots; - }; - }; - // Save changes to DB - [format["EPOCH_vgsOwnedVehs_%1", _playerUID], _playerUID, [_vehsFriendly, _vehsRaw]] call EPOCH_fnc_server_hiveSET; - }; - if not(isNull _player) then - { - EPOCH_vgsMyGarage = _vehsFriendly; - (owner _player) publicVariableClient "EPOCH_vgsMyGarage"; - diag_log format["[EPOCH VGS] Client %1 requested his/her vehicles. Result: %2", name _player, EPOCH_vgsMyGarage]; - EPOCH_vgsMyGarage = nil; - } - } - } - } - } - } - }; - - case "Write": - { - if (count _data isEqualTo 4) then - { - _playerObj = [_data, 2, objNull, [objNull]] call BIS_fnc_param; - if not isNull _playerObj then - { - _key = [_data, 3, "", [""]] call BIS_fnc_param; - if ([_playerObj, _key] in (uiNamespace getVariable "EPOCH_vgsKeys")) then - { - private ["_vehs"]; - // Get the given slot selected - _slot = [_data, 0, -1, [0]] call BIS_fnc_param; - if (_slot > -1) then - { - _slots = "maxGarageSlots" call VGS_fnc_vgsGetServerSetting; - if (_slot < _slots) then - { - // Get the vehicle - _vehObj = [_data, 1, objNull, [objNull]] call BIS_fnc_param; - if not isNull _vehObj then - { - if not isPlayer _vehObj then - { - // do additional checks - if ((owner _vehObj) isEqualTo (owner _playerObj)) then - { - _blacklist = "vehBlacklist" call VGS_fnc_vgsGetServerSetting; - if not(typeOf _vehObj in _blacklist) then - { - _maxDist = "range" call SC_fnc_vgsGetClientSetting; - if (((position _playerObj) distance (position _vehObj)) < _maxDist) then - { - // Get the player - diag_log format["[EPOCH VGS] EPOCH_vgsWrite: _data = %1", _data]; - // Define player's UID - _playerUID = getPlayerUID _playerObj; - // Define the classname of _veh - _typeOf = typeOf _vehObj; - // Get the storage usage - _gear = [[],[],[],[]]; // 0: Weapons | 1: Mags | 2: Items | 3: Backpacks - { - (_gear select 1) pushBack [_x select 0, _x select 1]; - } forEach (magazinesAmmoCargo _vehObj); - _gear set [2, getItemCargo _vehObj]; - _itemCount = 0; - { - _itemCount = _itemCount + _x; - } forEach ((_gear select 2) select 1); - { - (_gear select 0) pushBack (_x select 0); - _silencer = _x select 1; - if not(_silencer isEqualTo "") then { (_gear select 2 select 0) pushBack _silencer; (_gear select 2 select 1) pushBack 1 }; - _light = _x select 2; - if not(_light isEqualTo "") then { (_gear select 2 select 0) pushBack _light; (_gear select 2 select 1) pushBack 1 }; - _scope = _x select 3; - if not(_scope isEqualTo "") then { (_gear select 2 select 0) pushBack _scope; (_gear select 2 select 1) pushBack 1 }; - if (count _x > 5) then - { - _mag = _x select 4; - if not(_mag isEqualTo "") then { (_gear select 1) pushBack [_mag select 0, _mag select 1] }; - _bipod = _x select 5; - if not(_bipod isEqualTo "") then - { - _found = (_gear select 2 select 0) find _bipod; - switch _found do - { - case -1: - { - (_gear select 2 select 0) pushBack _bipod; - (_gear select 2 select 1) pushBack 1; - }; - default - { - _count = (_gear select 2 select 1) select _found; - _count = _count + 1; - (_gear select 2 select 1) set [_found, _count]; - } - } - } - }; - if (count _x isEqualTo 5) then - { - _bipod = _x select 4; - if not(_bipod isEqualTo "") then - { - _found = (_gear select 2 select 0) find _bipod; - if (_found isEqualTo -1) then - { - (_gear select 2 select 0) pushBack _bipod; - (_gear select 2 select 1) pushBack 1 - }; - if (_found > -1) then - { - _count = (_gear select 2 select 1) select _found; - _count = _count + 1; - (_gear select 2 select 1) set [_found, _count] - } - } - } - } forEach (weaponsItemsCargo _vehObj); - _gear set [3, getBackpackCargo _vehObj]; - _packCount = 0; - { - _packCount = _packCount + _x; - } forEach ((_gear select 3) select 1); - _pos = getPosATL _vehObj; - _dir = getDir _vehObj; - // Get the fuel level of _veh - _fuel = fuel _vehObj; - // Get the hitPoint(s) damage of given vehicle - _hitPoints = [configFile >> "CfgVehicles" >> _typeOf >> "HitPoints",0] call BIS_fnc_returnChildren; - _damagedParts = []; - { - if (_vehObj getHitPointDamage (configName _x) > 0) then - { - _partDamage = _vehObj getHitPointDamage (configName _x); - _overallDamage = _overallDamage + _partDamage; - _damagedParts pushBack [configName _x, _partDamage]; - }; - } forEach _hitPoints; - // Get existing vehicles - _response = [format["EPOCH_vgsOwnedVehs_%1", _playerUID], _playerUID] call EPOCH_fnc_server_hiveGET; - if ((_response select 0) isEqualTo 1) then - { - if (typeName (_response select 1) isEqualTo "ARRAY") then - { - _vehsFriendly = _response select 1 select 0; - _vehsRaw = _response select 1 select 1; - if not(count _vehsFriendly isEqualTo 0) then - { // If there is already a vehicle, clear it - _vehsFriendly set [_slot, []]; - _vehsRaw set [_slot, []]; - }; - (_vehsFriendly select _slot) pushBack _typeOf; - { - (_vehsRaw select _slot) pushBack _x - } forEach [_typeOf, _gear, _fuel, _damagedParts, [_pos, _dir]]; - [format["EPOCH_vgsOwnedVehs_%1", _playerUID], _playerUID, [_vehsFriendly, _vehsRaw]] call EPOCH_fnc_server_hiveSET; - { - moveOut _x; - } forEach (crew _vehObj); - _vehObj setDamage 1; - deleteVehicle _vehObj; - if not(isNull _playerObj) then - { - EPOCH_vgsMyGarage = _vehsFriendly; - (owner _playerObj) publicVariableClient "EPOCH_vgsMyGarage"; - diag_log format["[EPOCH VGS] Client (%1) put his/her %2 in garage", name _playerObj, _typeOf]; - EPOCH_vgsMyGarage = nil; - } - } - } - } - } - } - } - } - } - } - } - } - } - }; - - case "Read": - { - if (count _data isEqualto 3) then - { - _playerObj = [_data, 1, objNull, [objNull]] call BIS_fnc_param; - if not isNull _playerObj then - { - _key = [_data, 2, "", [""]] call BIS_fnc_param; - if ([_playerObj, _key] in (uiNamespace getVariable "EPOCH_vgsKeys")) then - { - private ["_vehsFriendly","_vehsRaw"]; - _requested = [_data, 0, -1, [0]] call BIS_fnc_param; - if (_requested > -1) then - { - _playerUID = getPlayerUID _playerObj; - _response = [format["EPOCH_vgsOwnedVehs_%1", _playerUID], _playerUID] call EPOCH_fnc_server_hiveGET; - if ((_response select 0) isEqualTo 1) then - { - if (typeName (_response select 1) isEqualTo "ARRAY") then - { - _vehsFriendly = _response select 1 select 0; - _vehsRaw = _response select 1 select 1; - _maxSlots = "maxGarageSlots" call VGS_fnc_vgsGetServerSetting; - if (_requested < _maxSlots) then - { - _toSpawn = _vehsRaw select _requested; - if (count _toSpawn > 0) then - { - _vehsFriendly set [_requested, []]; // Remove the vehicle from garage slot - _vehsRaw set [_requested, []]; - [format["EPOCH_vgsOwnedVehs_%1", _playerUID], _playerUID, [_vehsFriendly, _vehsRaw]] call EPOCH_fnc_server_hiveSET; - _pos = _toSpawn select 4 select 0; - _veh = createVehicle [_toSpawn select 0, _pos, [], 0, "CAN_COLLIDE"]; - _veh setDir (_toSpawn select 4 select 1); - _veh call EPOCH_server_setVToken; - clearWeaponCargoGlobal _veh; - clearMagazineCargoGlobal _veh; - clearItemCargoGlobal _veh; - clearBackpackCargoGlobal _veh; - _hitPoints = _toSpawn select 3; - if (count _hitPoints > 0) then - { - { - _veh setHitPointDamage [_x select 0, _x select 1]; - } forEach _hitPoints; - }; - _fuel = _toSpawn select 2; - _veh setFuel _fuel; - _veh setVehicleLock "LOCKEDPLAYER"; - _gear = _toSpawn select 1; - _weapons = _gear select 0; - { - _veh addWeaponCargoGlobal [_x, 1]; - } forEach _weapons; - _mags = _gear select 1; - { - _veh addMagazineAmmoCargo [_x select 0, 1, _x select 1]; - } forEach _mags; - _items = _gear select 2; - { - _veh addItemCargoGlobal [_x, _items select 1 select _forEachIndex]; - } forEach (_items select 0); - _packs = _gear select 3; - { - _veh addBackpackCargoGlobal [_x, _packs select 1 select _forEachIndex]; - } forEach (_packs select 0); - if (_veh isKindOf "Car") then - { - _veh engineOn true; - }; - _veh setOwner (owner _playerObj); - // Refetch the vehicles from db and send it to Client - _response = [format["EPOCH_vgsOwnedVehs_%1", _playerUID], _playerUID] call EPOCH_fnc_server_hiveGET; - if ((_response select 0) isEqualTo 1) then - { - if (typeName (_response select 1) isEqualTo "ARRAY") then - { - if not(isNull _playerObj) then - { - EPOCH_vgsMyGarage = _response select 1 select 0; - (owner _playerObj) publicVariableClient "EPOCH_vgsMyGarage"; - diag_log format["[EPOCH VGS] Client %1 took his/her %2 from garage", name _playerObj, _toSpawn select 0]; - EPOCH_vgsMyGarage = nil; - } - } - } - } - } - } - } - } - } - } - } - }; - case "Trash": - { - if (count _data isEqualTo 3) then - { - _player = [_data, 1, objNull, [objNull]] call BIS_fnc_param; - if not isNull _player then - { - _key = [_data, 2, "", [""]] call BIS_fnc_param; - if ([_player, _key] in (uiNamespace getVariable "EPOCH_vgsKeys")) then - { - _slot = [_data, 0, -1, [0]] call BIS_fnc_param; - if (_slot > -1) then - { - _maxSlots = "maxGarageSlots" call VGS_fnc_vgsGetServerSetting; - if (_slot < _maxSlots) then - { - _playerUID = getPlayerUID _player; - _response = [format["EPOCH_vgsOwnedVehs_%1", _playerUID], _playerUID] call EPOCH_fnc_server_hiveGET; - if ((_response select 0) isEqualTo 1) then - { - if (typeName (_response select 1) isEqualTo "ARRAY") then - { - _vehsFriendly = _response select 1 select 0; - _vehsFriendly set [_slot, []]; - _vehsRaw = _response select 1 select 1; - _vehsRaw set [_slot, []]; - [format["EPOCH_vgsOwnedVehs_%1", _playerUID], _playerUID, [_vehsFriendly, _vehsRaw]] call EPOCH_fnc_server_hiveSET; - if not(isNull _player) then - { - EPOCH_vgsMyGarage = _vehsFriendly; - (owner _player) publicVariableClient "EPOCH_vgsMyGarage"; - EPOCH_vgsMyGarage = nil; - } - } - } - } - } - } - } - } - }; - default {}; - } - } - } - } -}; - -[] spawn -{ // My cute little secure and unbreakable key generator/sender :) - _givenTo = []; - uiNamespace setVariable ["EPOCH_vgsKeys", []]; - while {true} do - { - if not(count _givenTo isEqualTo 0) then - { // If _givenTo array isn't empty, loop through it to see if there are any non-existent units in it - private ["_rem"]; - _rem = []; - { - if isNull _x then - { - _rem pushBack _x; - }; - if not isNull _x then - { - if (side _x isEqualTo civilian) then - { - _rem pushBack _x; - }; - }; - } forEach _givenTo; - if not(count _rem isEqualTo 0) then - { - { - _index = _givenTo find _x; - _givenTo deleteAt _index; - } forEach _rem; - } - }; - - if not(count playableUnits isEqualTo 0) then - { - _keys = uiNamespace getVariable "EPOCH_vgsKeys"; - //check the variable - if not isNil"_keys" then - { - if (typeName _keys isEqualTo "ARRAY") then - { - { - if not(_x in _givenTo) then - { - if (isPlayer _x) then - { - if not(side _x isEqualTo civilian) then - { - _key = call VGS_fnc_vgsGenKey; - _keys pushBack [_x, _key]; - EPOCH_vgsMyKey = _key; - (owner _x) publicVariableClient "EPOCH_vgsMyKey"; - EPOCH_vgsMyKey = nil; - _givenTo pushBack _x; - }; - } - } - } forEach playableUnits; - }; - if not(typeName _keys isEqualTo "ARRAY") then - { - uiNamespace setVariable ["EPOCH_vgsKeys", []]; - }; - }; - if isNil"_keys" then - { - uiNamespace setVariable ["EPOCH_vgsKeys", []]; - } - }; - uiSleep 3; - } -}; +uiNamespace setVariable ["EPOCH_vgsKeys", []]; diff --git a/ArmA_3/A3_EPOCH_virtualGarage/serverSide/a3_epoch_virtualGarage/functions_VGS/fn_vgsReadFromGarage.sqf b/ArmA_3/A3_EPOCH_virtualGarage/serverSide/a3_epoch_virtualGarage/functions_VGS/fn_vgsReadFromGarage.sqf new file mode 100644 index 0000000..bf61233 --- /dev/null +++ b/ArmA_3/A3_EPOCH_virtualGarage/serverSide/a3_epoch_virtualGarage/functions_VGS/fn_vgsReadFromGarage.sqf @@ -0,0 +1,156 @@ +/* + Author: IT07 + + Contributor: DirtySanchez from DonkeyPunch.INFO + + Description: + Read from client Garage + + Returns: + remoteExecCall to client garage contents +*/ + +private["_slots", "_debug", "_playerUID", "_response", "_vehsFriendly", "_vehsRaw", "_toSpawn", "_veh", "_safePOS", "_allHitpoints", "_actualHitpoints", "_dmg", "_response2"]; +params [ + ["_slot", -1, [0]], + ["_playerObj", objNull, [objNull]], + ["_playerKey", "", [""]] +]; +// debug start message +_debug = "debug" call SC_fnc_vgsGetClientSetting; +if (_debug isEqualTo 1) then {diag_log format["[EPOCH VGS]: ReadFromGarage _data = %1", [_slot, _playerObj, _playerKey]]}; + +if isNull _playerObj exitWith {diag_log format["[EPOCH VGS]: ReadFromGarage Player isNull - data:%1", _playerObj]}; + +if !([_playerObj, _playerKey] in (uiNamespace getVariable "EPOCH_vgsKeys"))exitWith{diag_log format["[EPOCH VGS]: ReadFromGarage Bad Player and Key - data:%1", [_playerObj, _playerKey]]}; + +if (_slot isEqualTo -1) exitWith {diag_log format["[EPOCH VGS]: ReadFromGarage Error - slot number is -1 - data:%1", _slot]}; + +_slots = "maxGarageSlots" call VGS_fnc_vgsGetServerSetting; +if !(_slot < _slots) exitWith {diag_log format["[EPOCH VGS]: ReadFromGarage Error - slot not less than max slots - data:%1", [_slot, _slots]]}; + +_playerUID = getPlayerUID _playerObj; +_response = ["VirtualGarage", _playerUID] call EPOCH_fnc_server_hiveGETRANGE; +if((_response select 1) isEqualTo []) exitWith {diag_log format["[EPOCH VGS]: WriteToGarage Client DB entry error - data:%1m", _response]}; +if ((_response select 0) isEqualTo 1) then +{ + if (typeName (_response select 1) isEqualTo "ARRAY") then + { + _vehsFriendly = _response select 1 select 0; + _vehsRaw = _response select 1 select 1; + _toSpawn = _vehsRaw select _slot; + _toSpawn params ["_vehClass","_position","_damage","_hitPoints","_fuel","_gear","_ammo","_texture","_baseClass"]; + _position params [ + ["_pos", [ [0,0,0],[0,0,0] ] ], + ["_vectorDir", [0,0,0]], + ["_vectorUp", [0,0,0]] + ]; + if (count _toSpawn > 0) then + { + _vehsFriendly set [_slot, []]; // Remove the vehicle from garage slot + _vehsRaw set [_slot, []]; + _expiresVG = "expiresVirtualGarage" call VGS_fnc_vgsGetServerSetting; + _return = ["VirtualGarage", _playerUID, _expiresVG, [_vehsFriendly, _vehsRaw]] call EPOCH_fnc_server_hiveSETEX; + _veh = createVehicle [_vehClass, _pos select 0, [], 0, "CAN_COLLIDE"]; + //if(_veh isKindOf 'SHIP')then{ + // _safePOS = [_pos select 0,1,80,10,1,20,1] call BIS_fnc_findSafePos; + //}; + _veh allowDamage false; + _veh setvectorDirAndUp [_vectorDir,_vectorUp]; + _veh call EPOCH_server_setVToken; + _veh setFuel _fuel; + _veh setVehicleLock "LOCKEDPLAYER"; + clearWeaponCargoGlobal _veh; + clearMagazineCargoGlobal _veh; + clearItemCargoGlobal _veh; + clearBackpackCargoGlobal _veh; + [_veh,_gear] call EPOCH_server_CargoFill; + _veh setOwner (owner _playerObj); + + // apply persistent textures + _cfgEpochVehicles = 'CfgEpochVehicles' call EPOCH_returnConfig; + _availableColorsConfig = (_cfgEpochVehicles >> _vehClass >> "availableColors"); + if (isArray(_availableColorsConfig)) then { + _colors = getArray(_availableColorsConfig); + _textureSelectionIndex = (_cfgEpochVehicles >> _vehClass >> "textureSelectionIndex"); + _selections = if (isArray(_textureSelectionIndex)) then { getArray(_textureSelectionIndex) } else { [0] }; + _count = (count _colors) - 1; + { + _textures = _colors select 0; + if (_count >= _forEachIndex) then { + _textures = _colors select _forEachIndex; + }; + _veh setObjectTextureGlobal [_x, _textures select _texture]; + } forEach _selections; + _veh setVariable ["VEHICLE_TEXTURE", _texture]; + }; + + if !(_baseClass isequalto "") then { + _veh setvariable ["VEHICLE_BASECLASS",_baseClass]; + }; + _serverSettingsConfig = configFile >> "CfgEpochServer"; + _disableVehicleTIE = [_serverSettingsConfig, "disableVehicleTIE", true] call EPOCH_fnc_returnConfigEntry; + // disable thermal imaging equipment + if (_disableVehicleTIE) then { + _veh disableTIEquipment true; + }; + _removeweapons = [_serverSettingsConfig, "removevehweapons", []] call EPOCH_fnc_returnConfigEntry; + if !(_removeweapons isequalto []) then { + { + _veh removeWeaponGlobal _x; + } foreach _removeweapons; + }; + _removemagazinesturret = [_serverSettingsConfig, "removevehmagazinesturret", []] call EPOCH_fnc_returnConfigEntry; + if !(_removemagazinesturret isequalto []) then { + { + _veh removeMagazinesTurret _x; + } foreach _removemagazinesturret; + }; + // remove and add back magazines + if !(_ammo isequalto []) then { + if ((_ammo select 0) isequaltype true) then { + { + _veh removeMagazinesTurret [_x select 0, _x select 1]; + } foreach magazinesAllTurrets _veh; + { + if ((_x select 2) > 0) then { + _veh addMagazineTurret [_x select 0,_x select 1,_x select 2]; + }; + } foreach (_ammo select 1); + } + else + { + {_veh removeMagazineGlobal _x}count (magazines _veh); + {_veh addMagazine _x}count _ammo; + }; + }; + + _veh allowDamage true; + _allHitpoints = getAllHitPointsDamage _veh; + if !(_allHitpoints isEqualTo []) then{ + _actualHitpoints = _allHitpoints select 0; + if ((count _actualHitpoints) == (count _hitpoints)) then{ + { + _dmg = _hitpoints param [_forEachIndex,0]; + _veh setHitIndex [_forEachIndex, _dmg]; + } forEach _actualHitpoints; + }; + }; + + // Refetch the vehicles from db and send it to Client + _response2 = ["VirtualGarage", _playerUID] call EPOCH_fnc_server_hiveGETRANGE; + if ((_response2 select 0) isEqualTo 1) then + { + if (typeName (_response2 select 1) isEqualTo "ARRAY") then + { + if not(isNull _playerObj) then + { + ["Garage", _response2 select 1 select 0] remoteExecCall ["SC_fnc_vgsRecvFromServer",owner _playerObj]; + // debug end message + if (_debug isEqualTo 1) then {diag_log format["[EPOCH VGS] Client %1 took his/her %2 from garage", name _playerObj, _toSpawn select 0]}; + }; + }; + }; + }; + }; +}; \ No newline at end of file diff --git a/ArmA_3/A3_EPOCH_virtualGarage/serverSide/a3_epoch_virtualGarage/functions_VGS/fn_vgsRequestGarage.sqf b/ArmA_3/A3_EPOCH_virtualGarage/serverSide/a3_epoch_virtualGarage/functions_VGS/fn_vgsRequestGarage.sqf new file mode 100644 index 0000000..17656a8 --- /dev/null +++ b/ArmA_3/A3_EPOCH_virtualGarage/serverSide/a3_epoch_virtualGarage/functions_VGS/fn_vgsRequestGarage.sqf @@ -0,0 +1,74 @@ +/* + Author: IT07 + + Contributor: DirtySanchez from DonkeyPunch.INFO + + Description: + Request Client Garage + + Returns: + remoteExecCall to client garage contents +*/ +private["_debug", "_playerUID", "_response", "_vehData", "_vehsFriendly", "_vehsRaw", "_slots"]; +params [ + ["_playerObj", objNull, [objNull]], + ["_playerKey", "", [""]] +]; +// debug start message +_debug = "debug" call VGS_fnc_vgsGetServerSetting; +if (_debug isEqualTo 1) then {diag_log format["[EPOCH VGS]: RequestGarage _data = %1", [_playerObj, _playerKey]]}; + +if isNull _playerObj exitWith {diag_log format["[EPOCH VGS]: RequestGarage Player isNull - data:%1", _playerObj]}; + +if !([_playerObj, _playerKey] in (uiNamespace getVariable "EPOCH_vgsKeys"))exitWith{diag_log format["[EPOCH VGS]: RequestGarage Bad Player and Key - data:%1", [_playerObj, _playerKey]]}; + +// Data is valid let's get the cars from db and send it to client +_playerUID = getPlayerUID _playerObj; +_response = ["VirtualGarage", _playerUID] call EPOCH_fnc_server_hiveGETRANGE; +_expiresVG = "expiresVirtualGarage" call VGS_fnc_vgsGetServerSetting; +if isNil"_response" then { _response = [1,[[],[]]] }; +_vehData = _response select 1; +if(_vehData isEqualTo []) then{ + _vehData = [[],[]]; +}; +if ((_response select 0) isEqualTo 1) then +{ + if (typeName _vehData isEqualTo "ARRAY") then + { + _vehsFriendly = _vehData select 0; + _vehsRaw = _vehData select 1; + _slots = "maxGarageSlots" call VGS_fnc_vgsGetServerSetting; + if (count _vehsFriendly < _slots) then + { + if (count _vehsRaw < _slots) then + { + for "_s" from 1 to (_slots-(count _vehsFriendly)) do + { + _vehsFriendly pushBack []; + _vehsRaw pushBack []; + }; + }; + // Save changes to DB + _return = ["VirtualGarage", _playerUID, _expiresVG, [_vehsFriendly, _vehsRaw]] call EPOCH_fnc_server_hiveSETEX; + }; + if (count _vehsFriendly > _slots) then + { + if (count _vehsRaw > _slots) then + { + for "_s" from 1 to ((count _vehsFriendly)-_slots) do + { + _vehsFriendly resize _slots; + _vehsRaw resize _slots; + }; + }; + // Save changes to DB + _return = ["VirtualGarage", _playerUID, _expiresVG, [_vehsFriendly, _vehsRaw]] call EPOCH_fnc_server_hiveSETEX; + }; + if not(isNull _playerObj) then + { + ["Garage", _vehsFriendly] remoteExecCall ["SC_fnc_vgsRecvFromServer",owner _playerObj]; + // debug end message + if (_debug isEqualTo 1) then {diag_log format["[EPOCH VGS] Client %1 requested his/her vehicles. Result: %2", name _playerObj, _vehsFriendly]}; + }; + }; +}; \ No newline at end of file diff --git a/ArmA_3/A3_EPOCH_virtualGarage/serverSide/a3_epoch_virtualGarage/functions_VGS/fn_vgsRequestKey.sqf b/ArmA_3/A3_EPOCH_virtualGarage/serverSide/a3_epoch_virtualGarage/functions_VGS/fn_vgsRequestKey.sqf new file mode 100644 index 0000000..9de2024 --- /dev/null +++ b/ArmA_3/A3_EPOCH_virtualGarage/serverSide/a3_epoch_virtualGarage/functions_VGS/fn_vgsRequestKey.sqf @@ -0,0 +1,65 @@ +/* + Author: IT07 + + Contributor: DirtySanchez from DonkeyPunch.INFO + + Description: + Request Client Key + + Returns: + remoteExecCall to client key info +*/ +params [ + ["_playerObj",objNull,[objNull]], + ["_token","",[""]] +]; + +// debug start message +_debug = "debug" call VGS_fnc_vgsGetServerSetting; +if (_debug isEqualTo 1) then {diag_log format["[EPOCH VGS]: RequestKey _data = %1", [_playerObj, _token]]}; + +if isNull _playerObj exitWith {diag_log format["[EPOCH VGS]: RequestKey Player isNull - data:%1", _playerObj]}; + +if !([_playerObj,_token] call EPOCH_server_getPToken) exitWith {diag_log format["[EPOCH VGS]: RequestKey Bad Token - data:%1", _token]}; + +// Get and check uiNamespace keys array +_keys = uiNamespace getVariable "EPOCH_vgsKeys"; +if (isNil "_keys") then { uiNamespace setVariable ["EPOCH_vgsKeys", []] }; + +// Check for player in keys array +{ + if (_playerObj isEqualTo (_x select 0)) then + { + _keys = _keys - [_x]; + if (_debug isEqualTo 1) then {diag_log format["[EPOCH VGS]: RequestKey removing old player key - data:%1", _x]}; + }; +}forEach _keys; + +// Get and send new key +_key = call VGS_fnc_vgsGenKey; +_keys pushBack [_playerObj, _key]; +["Key", _key] remoteExecCall ["SC_fnc_vgsRecvFromServer",owner _playerObj]; +uiNamespace setVariable ["EPOCH_vgsKeys", _keys]; + +// debug end message +if (_debug isEqualTo 1) then {diag_log format["[EPOCH VGS] Client %1 requested his/her vgsKey. Result: %2", name _playerObj, _key]}; + +// clean up null and dead clients from keys array +_keys = uiNamespace getVariable "EPOCH_vgsKeys"; +{ + _k = (_x select 0); + if isNull _k then + { + _keys = _keys - [_x]; + if (_debug isEqualTo 1) then {diag_log format["[EPOCH VGS]: RequestKey removing null player key - data:%1", _x]}; + }; + if not isNull _k then + { + if (side _k isEqualTo civilian) then + { + _keys = _keys - [_x]; + if (_debug isEqualTo 1) then {diag_log format["[EPOCH VGS]: RequestKey removing dead player key - data:%1", _x]}; + }; + }; +}forEach _keys; +uiNamespace setVariable ["EPOCH_vgsKeys", _keys]; \ No newline at end of file diff --git a/ArmA_3/A3_EPOCH_virtualGarage/serverSide/a3_epoch_virtualGarage/functions_VGS/fn_vgsTrashFromGarage.sqf b/ArmA_3/A3_EPOCH_virtualGarage/serverSide/a3_epoch_virtualGarage/functions_VGS/fn_vgsTrashFromGarage.sqf new file mode 100644 index 0000000..a33cfe7 --- /dev/null +++ b/ArmA_3/A3_EPOCH_virtualGarage/serverSide/a3_epoch_virtualGarage/functions_VGS/fn_vgsTrashFromGarage.sqf @@ -0,0 +1,48 @@ +/* + Author: IT07 + + Contributor: DirtySanchez from DonkeyPunch.INFO + + Description: + Trash(Delete) Vehicle from client Garage + + Returns: + remoteExecCall to client updated garage contents +*/ +params [ + ["_slot", -1, [0]], + ["_playerObj", objNull, [objNull]], + ["_playerKey", "", [""]] +]; +// debug start message +_debug = "debug" call SC_fnc_vgsGetClientSetting; +if (_debug isEqualTo 1) then {diag_log format["[EPOCH VGS]: TrashFromGarage _data = %1", [_slot, _playerObj, _playerKey]]}; + +if isNull _playerObj exitWith {diag_log format["[EPOCH VGS]: TrashFromGarage Player isNull - data:%1", _playerObj]}; + +if !([_playerObj, _playerKey] in (uiNamespace getVariable "EPOCH_vgsKeys"))exitWith{diag_log format["[EPOCH VGS]: TrashFromGarage Bad Player and Key - data:%1", [_playerObj, _playerKey]]}; + +if (_slot isEqualTo -1) exitWith {diag_log format["[EPOCH VGS]: TrashFromGarage Error - slot number is -1 - data:%1", _slot]}; + +_slots = "maxGarageSlots" call VGS_fnc_vgsGetServerSetting; +if !(_slot < _slots) exitWith {diag_log format["[EPOCH VGS]: TrashFromGarage Error - slot not less than max slots - data:%1", [_slot, _slots]]}; + +_playerUID = getPlayerUID _playerObj; +_response = [format["EPOCH_vgsOwnedVehs_%1", _playerUID], _playerUID] call EPOCH_fnc_server_hiveGET; +if ((_response select 0) isEqualTo 1) then +{ + if (typeName (_response select 1) isEqualTo "ARRAY") then + { + _vehsFriendly = _response select 1 select 0; + _vehsFriendly set [_slot, []]; + _vehsRaw = _response select 1 select 1; + _vehsRaw set [_slot, []]; + [format["EPOCH_vgsOwnedVehs_%1", _playerUID], _playerUID, [_vehsFriendly, _vehsRaw]] call EPOCH_fnc_server_hiveSET; + if not(isNull _playerObj) then + { + ["Garage", _vehsFriendly] remoteExecCall ["SC_fnc_vgsRecvFromServer",owner _playerObj]; + // debug end message + if (_debug isEqualTo 1) then {diag_log format["[EPOCH VGS] Client %1 trashed slot %2 from garage", name _playerObj, _slot]}; + }; + }; +}; \ No newline at end of file diff --git a/ArmA_3/A3_EPOCH_virtualGarage/serverSide/a3_epoch_virtualGarage/functions_VGS/fn_vgsWriteToGarage.sqf b/ArmA_3/A3_EPOCH_virtualGarage/serverSide/a3_epoch_virtualGarage/functions_VGS/fn_vgsWriteToGarage.sqf new file mode 100644 index 0000000..c670c89 --- /dev/null +++ b/ArmA_3/A3_EPOCH_virtualGarage/serverSide/a3_epoch_virtualGarage/functions_VGS/fn_vgsWriteToGarage.sqf @@ -0,0 +1,89 @@ +/* + Author: IT07 + + Contributor: DirtySanchez from DonkeyPunch.INFO + + Description: + Write Vehicle to client Garage + + Returns: + remoteExecCall to client updated garage contents +*/ +params [ + ["_slot", -1, [0]], + ["_vehObj", objNull, [objNull]], + ["_playerObj", objNull, [objNull]], + ["_playerKey", "", [""]] +]; +// debug start message +_debug = "debug" call SC_fnc_vgsGetClientSetting; +if (_debug isEqualTo 1) then {diag_log format["[EPOCH VGS]: WriteToGarage _data = %1", [_slot, _vehObj, _playerObj, _playerKey]]}; + +if isNull _playerObj exitWith {diag_log format["[EPOCH VGS]: WriteToGarage Player isNull - data:%1", _playerObj]}; + +if !([_playerObj, _playerKey] in (uiNamespace getVariable "EPOCH_vgsKeys"))exitWith{diag_log format["[EPOCH VGS]: WriteToGarage Bad Player and Key - data:%1", [_playerObj, _playerKey]]}; + +if (_slot isEqualTo -1) exitWith {diag_log format["[EPOCH VGS]: WriteToGarage Error - slot number is -1 - data:%1", _slot]}; + +_slots = "maxGarageSlots" call VGS_fnc_vgsGetServerSetting; +if !(_slot < _slots) exitWith {diag_log format["[EPOCH VGS]: WriteToGarage Error - slot not less than max slots - data:%1", [_slot, _slots]]}; + +if isNull _vehObj exitWith {diag_log format["[EPOCH VGS]: WriteToGarage Vehicle isNull - data:%1", _vehObj]}; + +if isPlayer _vehObj exitWith {diag_log format["[EPOCH VGS]: WriteToGarage Vehicle isPlayer - data:%1", _vehObj]}; + +if !((owner _vehObj) isEqualTo (owner _playerObj)) exitWith {diag_log format["[EPOCH VGS]: WriteToGarage Player not Vehicle Owner - data:%1", _vehObj]}; + +_blacklist = "vehBlacklist" call VGS_fnc_vgsGetServerSetting; +if (typeOf _vehObj in _blacklist) exitWith {diag_log format["[EPOCH VGS]: WriteToGarage Vehicle is BlackListed - data:%1", _vehObj]}; + +_maxDist = "range" call SC_fnc_vgsGetClientSetting; +if !(((position _playerObj) distance (position _vehObj)) < _maxDist) exitWith {diag_log format["[EPOCH VGS]: WriteToGarage Vehicle is too far > data:%1m", _maxDist]}; + +// Define player's UID +_playerUID = getPlayerUID _playerObj; +// Define the classname of _veh +_typeOf = typeOf _vehObj; +// Get the storage usage +_inventory = _vehObj call EPOCH_server_CargoSave; + +_pos = getPosATL _vehObj; +_dir = getDir _vehObj; +// Get the fuel level of _veh +_fuel = fuel _vehObj; +// Get the hitPoint(s) damage of given vehicle +_hitpoints = (getAllHitPointsDamage _vehObj) param [2,[]]; + +// Get existing vehicles +_response = ["VirtualGarage", _playerUID] call EPOCH_fnc_server_hiveGETRANGE; +if((_response select 1) isEqualTo []) exitWith {diag_log format["[EPOCH VGS]: WriteToGarage Client DB entry error - data:%1m", _response]}; +if ((_response select 0) isEqualTo 1) then +{ + if (typeName (_response select 1) isEqualTo "ARRAY") then + { + _vehsFriendly = _response select 1 select 0; + _vehsRaw = _response select 1 select 1; + if not(count _vehsFriendly isEqualTo 0) then + { // If there is already a vehicle, clear it + _vehsFriendly set [_slot, []]; + _vehsRaw set [_slot, []]; + }; + (_vehsFriendly select _slot) pushBack _typeOf; + { + (_vehsRaw select _slot) pushBack _x + } forEach [_typeOf, [(getposATL _vehObj call EPOCH_precisionPos),vectordir _vehObj,vectorup _vehObj], damage _vehObj, _hitpoints, _fuel, _inventory, [true,magazinesAllTurrets _vehObj], _vehObj getVariable ["VEHICLE_TEXTURE",0], _vehObj getVariable ["VEHICLE_BASECLASS",""]]; + _expiresVG = "expiresVirtualGarage" call VGS_fnc_vgsGetServerSetting; + _return = ["VirtualGarage", _playerUID, _expiresVG, [_vehsFriendly, _vehsRaw]] call EPOCH_fnc_server_hiveSETEX; + { + moveOut _x; + } forEach (crew _vehObj); + [_vehObj, format["VGSMoveIn_%1",_playerUID]] call EPOCH_server_save_killedVehicle; + deleteVehicle _vehObj; + if not(isNull _playerObj) then + { + ["Garage", _vehsFriendly] remoteExecCall ["SC_fnc_vgsRecvFromServer",owner _playerObj]; + // debug end message + if (_debug isEqualTo 1) then {diag_log format["[EPOCH VGS]: WriteToGarage Client (%1) put his/her %2 in garage", name _playerObj, _typeOf]}; + }; + }; +}; \ No newline at end of file