v0.7.7 Build 53

Introduced a new XM8 Apps
Introduced a new version of the VG App, compatible with the new system.
This commit is contained in:
Bjanski 2016-07-03 20:11:58 +02:00
parent b3d84d2b70
commit e72a9bbba3
39 changed files with 500 additions and 585 deletions

View File

@ -35,7 +35,7 @@ _vehList = _flag getVariable ["ExAdVGVeh", []];
} }
}forEach _vehList; }forEach _vehList;
if(!_proceed)exitWith{[_requestFrom, "notificationRequest", ["Whoops", [STR_ExAd_VG_NOTI_NOT_AVAILABLE]]] call ExileServer_system_network_send_to}; if(!_proceed)exitWith{[_owner, "toastRequest", ["ErrorTitleAndText", ["ExAd - Virtual Garage", STR_ExAd_VG_NOTI_NOT_AVAILABLE]]] call ExileServer_system_network_send_to};
_flag setVariable ["ExAdVGVeh", _vehList, true]; _flag setVariable ["ExAdVGVeh", _vehList, true];

View File

@ -24,7 +24,7 @@ _flag = objectFromNetId _flagNetId;
_owner = owner _objVeh; _owner = owner _objVeh;
_player = {if(owner _x == _owner)exitWith{_x}}forEach playableUnits; _player = {if(owner _x == _owner)exitWith{_x}}forEach playableUnits;
if!(_objVeh getVariable ["ExileIsPersistent", false])exitWith{[_owner, "notificationRequest", ["Whoops", [STR_ExAd_VG_NOTI_NOT_PERSISTENT]]] call ExileServer_system_network_send_to; false}; if!(_objVeh getVariable ["ExileIsPersistent", false])exitWith{[_owner, "toastRequest", ["ErrorTitleAndText", ["ExAd - Virtual Garage", STR_ExAd_VG_NOTI_NOT_PERSISTENT]]] call ExileServer_system_network_send_to;false};
if!(_objVeh setOwner 2)exitWith{format["Get out of the vehicle before storing it."] remoteExec ["hint", _owner]; false}; if!(_objVeh setOwner 2)exitWith{format["Get out of the vehicle before storing it."] remoteExec ["hint", _owner]; false};

View File

@ -26,4 +26,5 @@ class ExAd
//#include "Hacking\CfgFunctions.cpp" //#include "Hacking\CfgFunctions.cpp"
//#include "Grinding\CfgFunctions.cpp" //#include "Grinding\CfgFunctions.cpp"
//#include "HaloParachute\CfgFunctions.cpp" //#include "HaloParachute\CfgFunctions.cpp"
//#include "XM8\CfgFunctions.cpp"
}; };

View File

@ -16,11 +16,11 @@
limitations under the License. limitations under the License.
*/ */
ExAd_GRINDING_PROGRESS_INTERVALL = 60; //SCALAR - Grinding, interval time measured in seconds. ExAd_GRINDING_PROGRESS_INTERVALL = 5; //SCALAR - Grinding, interval time measured in seconds.
ExAd_GRINDING_PROGRESS = 30; //SCALAR - Damage each finished interval will take from the code lock. ExAd_GRINDING_PROGRESS = 30; //SCALAR - Damage each finished interval will take from the code lock.
ExAd_GRINDING_OBJECT_MAX = 900; //SCALAR - Code lock sustainability. ExAd_GRINDING_OBJECT_MAX = 300; //SCALAR - Code lock sustainability.
ExAd_GRINDING_PROGRESSBAR_POS = "Mid"; //SCALAR/STRING - You can use values between 0.3-2 or using "LOW"|"MID"|"HIGH" ExAd_GRINDING_PROGRESSBAR_POS = "Mid"; //SCALAR/STRING - You can use values between 0.3-2 or using "LOW"|"MID"|"HIGH"

View File

@ -23,6 +23,7 @@ class VirtualGarage
class allowedVGVeh {}; class allowedVGVeh {};
class allowVGStore {}; class allowVGStore {};
class fillVGList {}; class fillVGList {};
class loadVGContent {};
class loadVGDetailView {}; class loadVGDetailView {};
class onBtnClickVG {}; class onBtnClickVG {};
class postInitVG {file = "ExAdClient\VirtualGarage\postInit.sqf"; postInit = 1;}; class postInitVG {file = "ExAdClient\VirtualGarage\postInit.sqf"; postInit = 1;};

View File

@ -0,0 +1,44 @@
/*
fn_loadVGContent.sqf
Copyright 2016 Jan Babor
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
private ["_display","_error","_slides","_flag","_allowedVeh","_storedVeh","_strTxtVehCntColor","_strTxtVehCnt"];
_display = uiNameSpace getVariable ["RscExileXM8", displayNull];
if (isNull _display) exitWith {_error = "Error loading XM8 VG app, display is null"; systemChat _error; diag_log _error;};
_slides = _display displayCtrl 4007;
if (isNull _slides) exitWith {_error = "Error loading XM8 VG app, slides control is null"; systemChat _error; diag_log _error;};
_flag = if(typeName ExAdCurFlagNetId == "STRING")then{objectFromNetId ExAdCurFlagNetId}else{ExAdCurFlagNetId};
_allowedVeh = _flag call ExAd_fnc_allowedVGVeh;
_storedVeh = count (_flag getVariable ["ExAdVGVeh", []]);
_strTxtVehCntColor = if(_allowedVeh > _storedVeh)then{"#FFFFFF"}else{"#B22400"};
_strTxtVehCnt = [_display,"ExAd_VG","SubTitle1Cnt"] call ExAd_fnc_getAppCtrl;
_strTxtVehCnt ctrlSetStructuredText parseText format ["<t size='1' align='right' color='%1'>%2/%3</t>",_strTxtVehCntColor,_storedVeh,_allowedVeh];
[(objectFromNetId ExAdCurFlagNetId) getVariable ["ExAdVGVeh", []],ctrlIDC ([_display,"ExAd_VG","StoreVehList"] call ExAd_fnc_getAppCtrl)] call ExAd_fnc_fillVGList;
for "_i" from 0 to 3 do {
_index = lbAdd[ctrlIDC ([_display,"ExAd_VG","StoreVehList"] call ExAd_fnc_getAppCtrl),""];
};
[[_flag, ExAd_VG_ALLOWED_VEH_TYPE,_flag getVariable ["ExileTerritorySize", 50]] call ExAd_fnc_getNearByLocalVeh,ctrlIDC ([_display,"ExAd_VG","NearVehicleList"] call ExAd_fnc_getAppCtrl)] call ExAd_fnc_fillVGList;
([_display,"ExAd_VG","InfoCB"] call ExAd_fnc_getAppCtrl) cbSetChecked ((profileNamespace getVariable["ExAd_StreamFriendlyUI",0]) == 1);
true

View File

@ -30,7 +30,7 @@ _data = lbData [_idc, lbCurSel _idc];
diag_log str _data; diag_log str _data;
if(count _data == 0)then{ if(count _data == 0)then{
['Whoops', ["You have to choose a vehicle in the proper list!!"]] call ExileClient_gui_notification_event_addNotification; ["ErrorTitleAndText", ["ExAd - Virtual Garage", "You have to choose a vehicle in the proper list!!"]] call ExileClient_gui_toaster_addTemplateToast;
}else{ }else{
[_fnc, [_data, ExAdCurFlagNetId, netId player]] call ExAd_fnc_serverDispatch; [_fnc, [_data, ExAdCurFlagNetId, netId player]] call ExAd_fnc_serverDispatch;
closeDialog 0; closeDialog 0;

View File

@ -0,0 +1,4 @@
if (ExileClientXM8CurrentSlide == "ExAd_VG") then {
ExileClientXM8CurrentSlide = "apps";
};
ExAdCurFlagNetId = nil;

View File

@ -0,0 +1,78 @@
/*
fn_createExtraApps.sqf
Copyright 2016 Jan Babor
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
params["_display","_slide","_idc"];
_pW = 0.025;
_pH = 0.04;
_leftCol = 1;
_leftColW = 12.8;
_rightCol = _leftCol + _leftColW + 2;
_rightColW = _leftColW + 3;
_margin = 0.2;
[_display,_slide,(["ExAd_VG","backButton"] call ExAd_fnc_getNextIDC),[27.6 * _pW, 17.7 * _pH, 6 * _pW, 1 * _pH],'["extraApps", 1] call ExileClient_gui_xm8_slide;',STR_ExAd_VG_APP_BTN_BACK] call ExAd_fnc_createButton;
/*Stored Vehicle Details*/
[_display,_slide,(["ExAd_VG","InfoTitle"] call ExAd_fnc_getNextIDC),[_rightCol * _pW, 2.75 * _pH, _rightColW * _pW, 1 * _pH],STR_ExAd_VG_APP_TTL_DETAILS,"PuristaMedium",1.2,"#ffffff","left",1] call ExAd_fnc_createStructuredText;
[_display,_slide,(["ExAd_VG","InfoBgBox"] call ExAd_fnc_getNextIDC),[_rightCol * _pW, 4 * _pH, _rightColW * _pW, 13.5 * _pH]] call ExAd_fnc_createBackgroundGUI;
_idcInfoPic = ["ExAd_VG","InfoPic"] call ExAd_fnc_getNextIDC;
[_display,_slide,_idcInfoPic,[(_rightCol + 9) * _pW, 4 * _pH, 6.75 * _pW, 5.5 * _pH],"",[1,1,1,1],false,true,""] call ExAd_fnc_createPicture;
_idcInfoStr = ["ExAd_VG","InfoVehStr"] call ExAd_fnc_getNextIDC;
[_display,_slide,_idcInfoStr,[(_rightCol + _margin) * _pW, (4 + _margin) * _pH, (_rightColW - 2 * _margin) * _pW, (13.5 - 2 * _margin) * _pH],"","PuristaMedium",0.75,"#ffffff","left",1] call ExAd_fnc_createStructuredText;
[_display,_slide,(["ExAd_VG","InfoCBStr"] call ExAd_fnc_getNextIDC),[(_rightCol + _margin + 0.4) * _pW, (16.5 - _margin + 0.25 ) * _pH, (_rightColW - 2 * _margin) * _pW, (13.5 - 2 * _margin) * _pH],STR_ExAd_VG_APP_CB_SECRET,"PuristaMedium",0.65,"#ffffff","left",1] call ExAd_fnc_createStructuredText;
[_display,_slide,(["ExAd_VG","InfoCB"] call ExAd_fnc_getNextIDC),[(_rightCol + _margin) * _pW, (16.5 - _margin + 0.2) * _pH, 0.75 * _pW, 0.75 * _pH],'profileNamespace setVariable["ExAd_StreamFriendlyUI",_this select 1]',"Toogle - Stream friendly UI"] call ExAd_fnc_createCheckBox;
/*Stored Vehicles*/
[_display,_slide,(["ExAd_VG","SubTitle1"] call ExAd_fnc_getNextIDC),[_leftCol * _pW, 2.75 * _pH, _leftColW * _pW, 1 * _pH],STR_ExAd_VG_APP_TTL_STORED,"PuristaMedium",1.2,"#ffffff","left",1] call ExAd_fnc_createStructuredText;
[_display,_slide,(["ExAd_VG","SubTitle1Cnt"] call ExAd_fnc_getNextIDC),[_leftCol * _pW, 3 * _pH, _leftColW * _pW, 1 * _pH],"","PuristaMedium",1,"#ffffff","right",1] call ExAd_fnc_createStructuredText;
_idcStoredVehList = ["ExAd_VG","StoreVehList"] call ExAd_fnc_getNextIDC;
[_display,_slide,_idcStoredVehList,[_leftCol * _pW, 4 * _pH, _leftColW * _pW, 5 * _pH],format["[_this select 0,%1,%2] call XM8_VG_elChanged",_idcInfoPic,_idcInfoStr],""] call ExAd_fnc_createList;
[_display,_slide,(["ExAd_VG","fetchButton"] call ExAd_fnc_getNextIDC),[_leftCol*_pW, 9*_pH, _leftColW*_pW, 1*_pH],format["disableUserInput true;['VGLoad', %1] call ExAd_fnc_onBtnClickVG",_idcStoredVehList],STR_ExAd_VG_APP_BTN_FETCH,""] call ExAd_fnc_createButton;
/*Nearby vehicles*/
[_display,_slide,(["ExAd_VG","SubTitle2"] call ExAd_fnc_getNextIDC),[_leftCol * _pW, 10.25 * _pH, _leftColW * _pW, 1 * _pH],STR_ExAd_VG_APP_TTL_NEAR,"PuristaMedium",1.2,"#ffffff","left",1] call ExAd_fnc_createStructuredText;
_idcNearVehList = ["ExAd_VG","NearVehicleList"] call ExAd_fnc_getNextIDC;
[_display,_slide,_idcNearVehList,[_leftCol * _pW, 11.5 * _pH, _leftColW * _pW, 5 * _pH],"",""] call ExAd_fnc_createList;
[_display,_slide,(["ExAd_VG","storeButton"] call ExAd_fnc_getNextIDC),[_leftCol * _pW, 16.5 * _pH, _leftColW * _pW, 1 * _pH],format["if(call ExAd_fnc_allowVGStore)then{disableUserInput true;['VGStore', %1] call ExAd_fnc_onBtnClickVG}else{['ErrorTitleAndText', ['ExAd - Virtual Garage', '%2']] call ExileClient_gui_toaster_addTemplateToast}",_idcNearVehList,STR_ExAd_VG_NOTI_FULL],STR_ExAd_VG_APP_BTN_STORE,""] call ExAd_fnc_createButton;
XM8_VG_elChanged = {
params ["_listCtrl","_picCtrl","_strCtrl","_ref","_data","_pic"];
_ref = _listCtrl lbData (lbCurSel _listCtrl);
_data = {if(str (_x select 0) == _ref)exitWith{_x}}forEach ((objectFromNetId ExAdCurFlagNetId) getVariable["ExAdVGVeh",[]]);
if(!isNil "_data")then{
_pic = getText(configFile >> "CfgVehicles" >> (_data select 1) >> "picture");
ctrlSetText [_picCtrl, _pic];
["requestVGDetailInfo", [_ref, ExAdCurFlagNetId, (profileNamespace getVariable["ExAd_StreamFriendlyUI",0]), netId player, _strCtrl]] call ExAd_fnc_serverDispatch;
}else{
ctrlSetText [_picCtrl, ""];
["",_strCtrl] call ExAd_fnc_loadVGDetailView;
}
};
true

View File

@ -1,10 +1,3 @@
/*
function: XM8_VG_checkNearByFlags
file: XM8_VG\scripts\XM8_VG_checkNearByFlags.sqf
XM8 VG By Jan Babor
Part of the ExAd Virtual Garage script
*/
private ["_flags","_flag"]; private ["_flags","_flag"];
_flags = nearestObjects [player,["Exile_Construction_Flag_Static"],150]; _flags = nearestObjects [player,["Exile_Construction_Flag_Static"],150];
@ -21,8 +14,7 @@ try
if((([_flag, getPlayerUID player] call ExileClient_util_territory_getAccessLevel) select 0) >= ExAd_VG_ACCESS_LEVEL)then{ if((([_flag, getPlayerUID player] call ExileClient_util_territory_getAccessLevel) select 0) >= ExAd_VG_ACCESS_LEVEL)then{
ExAdCurFlagNetId = netId _flag; ExAdCurFlagNetId = netId _flag;
["mainVGSlide", 0] call ExileClient_gui_xm8_slide; call ExAd_fnc_loadVGContent;
call XM8_VG_loadContent;
} }
else else
{ {
@ -31,6 +23,6 @@ try
} }
catch catch
{ {
["Whoops", [_exception]] call ExileClient_gui_notification_event_addNotification; ["ErrorTitleAndText", ["ExAd - Virtual Garage", _exception]] call ExileClient_gui_toaster_addTemplateToast;
["sideApps", 1] call ExileClient_gui_xm8_slide ["extraApps", 1] call ExileClient_gui_xm8_slide
} }

View File

@ -0,0 +1,34 @@
/*
CfgFunctions.cpp
Copyright 2016 Jan Babor
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
class XM8_Apps
{
file = "ExAdClient\XM8\Functions";
class addApps {};
class createBackgroundGUI {};
class createButton {};
class createCheckBox {};
class createExtraApps {};
class createFrame {};
class createList {};
class createPicture {};
class createStructuredText {};
class getAppCtrl {};
class getNextIDC {};
class postInitXM8 {file = "ExAdClient\XM8\postInit.sqf"; postInit = 1;};
};

View File

@ -0,0 +1,79 @@
/**
* ExileClient_gui_xm8_show
*
* Exile Mod
* www.exilemod.com
* © 2015 Exile Mod Team
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
*/
private["_display","_control","_slideControlID","_slideName","_slideTitle","_slideControl","_titleControl","_toSlideOpenFunction"];
disableSerialization;
createDialog "RscExileXM8";
ExileClientXM8IsVisible = true;
_display = uiNameSpace getVariable ["RscExileXM8", displayNull];
if (ExileClientXM8IsPowerOn) then
{
_control = _display displayCtrl 4002;
_control ctrlSetFade 1;
_control ctrlCommit 0;
}
else
{
{
_control = _display displayCtrl _x;
_control ctrlSetFade 1;
_control ctrlCommit 0;
}
forEach
[
4002,
4003,
4004,
4005,
4007,
4001,
4010,
4030,
4020
];
};
true call ExileClient_gui_postProcessing_toggleDialogBackgroundBlur;
if (ExileClientXM8CurrentSlide isEqualTo "party") then
{
if (ExileClientPartyID isEqualTo -1) then
{
ExileClientXM8CurrentSlide = "apps";
};
};
call ExAd_fnc_createExtraApps;
{
_slideControlID = getNumber (_x >> "controlID");
_slideName = configName _x;
_slideTitle = getText (_x >> "title");
_slideControl = _display displayCtrl _slideControlID;
if (_slideName isEqualTo ExileClientXM8CurrentSlide) then
{
_titleControl = _display displayCtrl 4004;
_titleControl ctrlSetStructuredText (parseText (format ["<t align='center' font='RobotoMedium'>%1</t>", _slideTitle]));
_slideControl ctrlSetPosition [(0 * 0.05), (0 * 0.05)];
_slideControl ctrlCommit 0;
_slideControl ctrlShow true;
_toSlideOpenFunction = missionNamespace getVariable [format ["ExileClient_gui_xm8_slide_%1_onOpen", _slideName], ""];
if !(_toSlideOpenFunction isEqualTo "") then
{
call _toSlideOpenFunction;
};
}
else
{
_slideControl ctrlShow false;
};
}
forEach (("true" configClasses (configFile >> "CfgXM8")) + ("true" configClasses (missionConfigFile >> "CfgXM8")));
ExileXM8ThreadHandle = [10, ExileClient_gui_xm8_thread_update, [], true] call ExileClient_system_thread_addtask;
call ExileClient_gui_xm8_thread_update;

View File

@ -9,30 +9,25 @@
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
*/ */
// XM8 apps Imporeved by vitaly'mind'chizhikov private["_toSlideName","_direction","_display","_toSlideControlID","_toSlideControl","_toSlideTitle","_titleControl","_toSlideOpenFunction","_fromSlideControlID","_fromSlideControl","_fromSlideCloseFunction"];
// Based on idea XM8 apps by Shix. see http://www.exilemod.com/topic/9040-xm8-apps/?page=1
// Original function from Exile 0.9.6
private["_try","_toSlideName","_direction","_display","_toSlideControlID","_toSlideControl","_toSlideTitle","_titleControl","_toSlideOpenFunction","_fromSlideControlID","_fromSlideControl","_fromSlideCloseFunction"];
disableSerialization; disableSerialization;
_toSlideName = _this select 0; _toSlideName = _this select 0;
_direction = _this select 1; _direction = _this select 1;
_display = displayNull;
if !(ExileClientXM8CurrentSlide isEqualTo _toSlideName) then if !(ExileClientXM8CurrentSlide isEqualTo _toSlideName) then
{ {
_display = uiNameSpace getVariable ["RscExileXM8", displayNull]; _display = uiNameSpace getVariable ["RscExileXM8", displayNull];
_toSlideControlID = getNumber (configFile >> "CfgXM8" >> _toSlideName >> "controlID");
//Lets try read MissionConfig, maybe we have custom slide
_try = (missionConfigFile >> "CfgXM8" >> _toSlideName >> "controlID") call BIS_fnc_getCfgData;
if (!isNil "_try") then {_toSlideControlID = _try};
//Manipulate the source of config data
_src = if(isClass(configFile >> "CfgXM8" >> _toSlideName))then{configFile}else{missionConfigFile};
_toSlideControlID = getNumber (_src >> "CfgXM8" >> _toSlideName >> "controlID");
_toSlideControl = _display displayCtrl _toSlideControlID; _toSlideControl = _display displayCtrl _toSlideControlID;
_toSlideTitle = getText (configFile >> "CfgXM8" >> _toSlideName >> "title");
//Lets try read MissionConfig, maybe we have custom slide //Add extra apps
_try = (missionConfigFile >> "CfgXM8" >> _toSlideName >> "title") call BIS_fnc_getCfgData; if(_toSlideName == "extraApps")then{
if (!isNil "_try") then {_toSlideTitle = _try}; call ExAd_fnc_addApps;
};
_toSlideTitle = getText (_src >> "CfgXM8" >> _toSlideName >> "title");
_titleControl = _display displayCtrl 4004; _titleControl = _display displayCtrl 4004;
_titleControl ctrlSetStructuredText (parseText (format ["<t align='center' font='RobotoMedium'>%1</t>", _toSlideTitle])); _titleControl ctrlSetStructuredText (parseText (format ["<t align='center' font='RobotoMedium'>%1</t>", _toSlideTitle]));
@ -41,11 +36,10 @@ if !(ExileClientXM8CurrentSlide isEqualTo _toSlideName) then
{ {
call _toSlideOpenFunction; call _toSlideOpenFunction;
}; };
_fromSlideControlID = getNumber (configFile >> "CfgXM8" >> ExileClientXM8CurrentSlide >> "controlID");
//Lets try read MissionConfig, maybe we have custom slide //Manipulating the source of config data
_try = (missionConfigFile >> "CfgXM8" >> ExileClientXM8CurrentSlide >> "controlID") call BIS_fnc_getCfgData; _src2 = if(isClass(configFile >> "CfgXM8" >> ExileClientXM8CurrentSlide))then{configFile}else{missionConfigFile};
if (!isNil "_try") then {_fromSlideControlID = _try}; _fromSlideControlID = getNumber(_src2 >> "CfgXM8" >> ExileClientXM8CurrentSlide >> "controlID");
_fromSlideControl = _display displayCtrl _fromSlideControlID; _fromSlideControl = _display displayCtrl _fromSlideControlID;
_fromSlideCloseFunction = missionNamespace getVariable [format ["ExileClient_gui_xm8_slide_%1_onClose", ExileClientXM8CurrentSlide], ""]; _fromSlideCloseFunction = missionNamespace getVariable [format ["ExileClient_gui_xm8_slide_%1_onClose", ExileClientXM8CurrentSlide], ""];
@ -75,13 +69,3 @@ if !(ExileClientXM8CurrentSlide isEqualTo _toSlideName) then
}; };
ExileClientXM8CurrentSlide = _toSlideName; ExileClientXM8CurrentSlide = _toSlideName;
}; };
//Lets hide old territory button, as we already made new one early on in ExileClient_gui_xm8_show.
//Why we make new? Because if button is re-possition it will render picture (textureNoShortcut) incorrectly.
private ["_sliders","_appSlide","_oldTerritoryBut"];
_sliders = _display displayCtrl 4007;
_appSlide = _sliders controlsGroupCtrl 4040;
_oldTerritoryBut = _appSlide controlsGroupCtrl 1113;
_oldTerritoryBut ctrlShow false;
_oldTerritoryBut ctrlSetFade 0;
_oldTerritoryBut ctrlCommit 0;

View File

@ -0,0 +1,54 @@
/*
fn_addApps.sqf
Copyright 2016 Jan Babor
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
private["_apps","_count","_title","_display"];
_apps = getArray(missionConfigFile >> "CfgXM8" >> "extraApps");
if(count _apps == 0)exitWith{false};
_count = 10;
_count2 = 5000;
_title = "ExAd";
while {_title != ""} do
{
_count = _count + 1;
_count2 = _count2 + 1;
_count = if(_count > 15)then{
if(_count > 25)then{
if(_count < 31)then{31}else{_count}
}else{
if(_count < 21)then{21}else{_count}
}
}else{
_count
};
_title = getText(configFile >> "RscExileXM8" >> "Controls" >> "Slides" >> "Controls" >>"SlideExtraApps" >> "Controls" >> format["App%1", _count] >> "text");
};
_display = uiNameSpace getVariable ["RscExileXM8", displayNull];
{
private["_ctrl"];
_ctrl = (_display displayCtrl _count2);
_ctrl ctrlSetText getText(missionConfigFile >> "CfgXM8" >> _x >> "title");
_ctrl ctrlSetEventHandler ["ButtonClick", format["['%1', 0] call ExileClient_gui_xm8_slide",_x]];
_count2 = _count2 + 1;
}forEach _apps;
true

View File

@ -0,0 +1,8 @@
params ["_display","_parent","_idc","_position","_ctrl"];
_ctrl = _display ctrlCreate ["RscBackgroundGUI", _idc, _parent];
_ctrl ctrlSetPosition _position;
_ctrl ctrlCommit 0;
_ctrl ctrlSetBackgroundColor [0,0,0,0.5];
_ctrl

View File

@ -0,0 +1,10 @@
params ["_display","_parent","_idc","_position",["_action",""],["_text",""],["_tooltip",""],"_ctrl"];
_ctrl = _display ctrlCreate ["RscButtonMenu",_idc,_parent];
_ctrl ctrlSetPosition _position;
_ctrl ctrlSetText _text;
_ctrl ctrlSetEventHandler ["ButtonClick",_action];
_ctrl ctrlSetTooltip _tooltip;
_ctrl ctrlCommit 0;
_ctrl

View File

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

View File

@ -0,0 +1,34 @@
/*
fn_createExtraApps.sqf
Copyright 2016 Jan Babor
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
private["_apps","_display"];
_apps = getArray(missionConfigFile >> "CfgXM8" >> "extraApps");
_display = uiNameSpace getVariable ["RscExileXM8", displayNull];
{
call compile format["ExAd_XM8_MAP_%1 = [];",_x];
if(isClass(missionConfigFile >> "CfgXM8" >> _x))then{
_idc = getNumber(missionConfigFile >> "CfgXM8" >> _x >> "controlID");
_slide = _display ctrlCreate ["RscExileXM8Slide",_idc, _display displayCtrl 4007];
[_display, _slide, _idc]call compile preprocessFileLineNumbers getText(missionConfigFile >> "CfgXM8" >> _x >> "onLoad");
_slide ctrlShow false;
}
}forEach _apps;
true

View File

@ -0,0 +1,8 @@
params ["_display","_parent","_idc","_position","_ctrl"];
_ctrl = _display ctrlCreate ["RscFrame", _idc, _parent];
_ctrl ctrlSetPosition _position;
_ctrl ctrlEnable false;
_ctrl ctrlCommit 0;
_ctrl

View File

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

View File

@ -0,0 +1,11 @@
params ["_display","_parent","_idc","_position","_picture","_color","_enable","_keepAspect","_tooltip","_ctrl"];
_ctrl = _display ctrlCreate [(if (_keepAspect) then {"RscPictureKeepAspect"} else {"RscPicture"}), _idc, _parent];
_ctrl ctrlSetPosition _position;
_ctrl ctrlSetText _picture;
_ctrl ctrlSetTextColor _color;
_ctrl ctrlEnable _enable;
_ctrl ctrlSetTooltip _tooltip;
_ctrl ctrlCommit 0;
_ctrl

View File

@ -0,0 +1,9 @@
params ["_display","_parent","_idc","_position","_text","_font","_size","_color","_align","_shadow","_ctrl"];
_ctrl = _display ctrlCreate ["RscStructuredText", _idc, _parent];
_ctrl ctrlSetPosition _position;
_ctrl ctrlSetStructuredText (parseText format ["<t shadow='%6' font='%5' align='%4' size='%2' color='%3'>%1</t>", _text,_size,_color, _align,_font,_shadow]);
_ctrl ctrlEnable false;
_ctrl ctrlCommit 0;
_ctrl

View File

@ -0,0 +1,11 @@
params ["_display","_slide","_key","_map","_index",["_ctrl", controlNull]];
_map = call compile format["ExAd_XM8_MAP_%1",_slide];
_index = _map find _key;
if (_index != -1) then {
_idc = ((getNumber (missionConfigFile >> "CfgXM8" >> _slide >> "controlID")) + _index);
_ctrl = _display displayCtrl _idc;
};
_ctrl

View File

@ -0,0 +1,6 @@
params ["_slide","_key","_baseIDC","_map"];
_baseIDC = getNumber (missionConfigFile >> "CfgXM8" >> _slide >> "controlID");
_map = call compile format["ExAd_XM8_MAP_%1",_slide];
(_baseIDC + (_map pushBack _key))

View File

@ -0,0 +1,17 @@
/*
customize.sqf
Copyright 2016 Jan Babor
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

View File

@ -0,0 +1,32 @@
/*
postInit.sqf
Copyright 2016 Jan Babor
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
_path = "ExAdClient\XM8\customize.sqf";
call compile preprocessFileLineNumbers _path;
{
if(isText(missionConfigFile >> "CfgXM8" >> _x >> "onOpen"))then{
_code = compileFinal (preprocessFileLineNumbers getText(missionConfigFile >> "CfgXM8" >> _x >> "onOpen"));
missionNamespace setVariable [format["ExileClient_gui_xm8_slide_%1_onOpen",_x], _code];
};
if(isText(missionConfigFile >> "CfgXM8" >> _x >> "onClose"))then{
_code = compileFinal (preprocessFileLineNumbers getText(missionConfigFile >> "CfgXM8" >> _x >> "onClose"));
missionNamespace setVariable [format["ExileClient_gui_xm8_slide_%1_onClose",_x], _code];
};
}forEach (getArray(missionConfigFile >> "CfgXM8" >> "extraApps"));

View File

@ -1,13 +0,0 @@
/*
Improved XM8 apps by vitaly'mind'chizhikov
Official forum thread:
Original idea by Shix.
*/
XM8_apps_app1 = [
"ExAd Virtual Garage",
"XM8_apps\apps\XM8_VG\Icons\apps_icon.paa",
{call XM8_VG_checkNearByFlags},
TRUE,
"XM8_apps\apps\XM8_VG\scripts\XM8_VG_init.sqf"
];

View File

@ -1,14 +0,0 @@
class CfgXM8 {
//This slide use IDCs from 104140 to 104156
class sideApps {
controlID = 104140;
title = "XM8 Apps";
onLoadScript = "";
};
//This slide use IDCs from 352500 to
class mainVGSlide {
controlID = 352500;
title = "Virtual Garage";
onLoadScript = "XM8_apps\apps\XM8_VG\scripts\XM8_VG_mainVGSlide_onLoad.sqf";
};
};

View File

@ -1,23 +0,0 @@
/*
XM8 VG app by Jan Babor
file: XM8_emptyApp\XM8_emptyApp_config.sqf
function: no function
This is configuration file for VG app.
*/
XM8_VG_elChanged = {
params ["_listCtrl","_picCtrl","_strCtrl","_ref","_data","_pic"];
_ref = _listCtrl lbData (lbCurSel _listCtrl);
_data = {if(str (_x select 0) == _ref)exitWith{_x}}forEach ((objectFromNetId ExAdCurFlagNetId) getVariable["ExAdVGVeh",[]]);
if(!isNil "_data")then{
_pic = getText(configFile >> "CfgVehicles" >> (_data select 1) >> "picture");
ctrlSetText [_picCtrl, _pic];
["requestVGDetailInfo", [_ref, ExAdCurFlagNetId, (profileNamespace getVariable["ExAd_StreamFriendlyUI",0]), netId player, _strCtrl]] call ExAd_fnc_serverDispatch;
}else{
ctrlSetText [_picCtrl, ""];
["",_strCtrl] call ExAd_fnc_loadVGDetailView;
}
};

View File

@ -1,27 +0,0 @@
/*
XM8 VG app by Jan Babor
file: XM8_VG\scripts\XM8_VG_init.sqf
This script will be executed once, when player login. It is executed straight from initLocalPlayer.sqf.
This is best place to compile functions, define global variables and read gonfiguration files used in app.
*/
params ["_pathToAppFolder"];
XM8_VG_mainVGSlideIDCmap = [];
{
if (isNil _x) then {
private ["_code"];
_code = compileFinal (preprocessFileLineNumbers (format (["%1scripts\%2.sqf",_pathToAppFolder,_x])));
if (isNil "_code") then {_code = compileFinal ""};
missionNamespace setVariable [_x, _code];
};
} forEach [
"XM8_VG_mainVGSlide_onLoad",
"XM8_VG_checkNearByFlags",
"XM8_VG_loadContent"
];
call compile preProcessFileLineNumbers format ["%1XM8_VG_config.sqf",_pathToAppFolder];

View File

@ -1,46 +0,0 @@
/*
function: XM8_VG_loadContent
file: XM8_VG\scripts\XM8_VG_loadContent.sqf
XM8 VG by Jan Babor
Part of the ExAd Virtual Garage script
*/
private ["_display","_error","_slides","_getControl","_flag","_allowedVeh","_storedVeh","_strTxtVehCntColor","_strTxtVehCnt"];
_display = uiNameSpace getVariable ["RscExileXM8", displayNull];
if (isNull _display) exitWith {_error = "Error loading XM8 VG app, display is null"; systemChat _error; diag_log _error;};
_slides = _display displayCtrl 4007;
if (isNull _slides) exitWith {_error = "Error loading XM8 VG app, slides control is null"; systemChat _error; diag_log _error;};
_getControl = {
params ["_key"];
private ["_ctrl","_idc","_index","_slideClassName"];
_ctrl = controlNull;
_slideClassName = "mainVGSlide"; //Classname of your slide
_map = XM8_VG_mainVGSlideIDCmap; //Variable name of IDC map of slide
_index = _map find _key;
if (_index != -1) then {
_idc = ((getNumber (missionConfigFile >> "CfgXM8" >> _slideClassName >> "controlID")) + _index);
_ctrl = _display displayCtrl _idc;
};
_ctrl;
};
_flag = if(typeName ExAdCurFlagNetId == "STRING")then{objectFromNetId ExAdCurFlagNetId}else{ExAdCurFlagNetId};
_allowedVeh = _flag call ExAd_fnc_allowedVGVeh;
_storedVeh = count (_flag getVariable ["ExAdVGVeh", []]);
_strTxtVehCntColor = if(_allowedVeh > _storedVeh)then{"#FFFFFF"}else{"#B22400"};
_strTxtVehCnt = "SubTitle1Cnt" call _getControl;
_strTxtVehCnt ctrlSetStructuredText parseText format ["<t size='1' align='right' color='%1'>%2/%3</t>",_strTxtVehCntColor,_storedVeh,_allowedVeh];
[(objectFromNetId ExAdCurFlagNetId) getVariable ["ExAdVGVeh", []],ctrlIDC ("StoreVehList" call _getControl)] call ExAd_fnc_fillVGList;
for "_i" from 0 to 3 do {
_index = lbAdd[ctrlIDC ("StoreVehList" call _getControl),""];
};
[[_flag, ExAd_VG_ALLOWED_VEH_TYPE,_flag getVariable ["ExileTerritorySize", 50]] call ExAd_fnc_getNearByLocalVeh,ctrlIDC ("NearVehicleList" call _getControl)] call ExAd_fnc_fillVGList;
("InfoCB" call _getControl) cbSetChecked ((profileNamespace getVariable["ExAd_StreamFriendlyUI",0]) == 1);

View File

@ -1,157 +0,0 @@
/*
XM8 VG app by Jan Babor
Virtual Garage app that works with the ExAd Virtual Garage plugin.
file: XM8_emptyApp\scripts\XM8_VG_mainVGSlide_onLoad.sqf
function: XM8_VG_mainVGSlide_onLoad
*/
private ["_makeButton","_makeBackground","_makeStructuredText","_makePicture","_makeList","_getNextIDC","_pW","_pH","_display","_slides","_unloadScript","_error","_thisSlide"];
_makeButton = {
params ["_parent","_idc","_position","_action","_text","_tooltip"];
private ["_ctrl"];
_ctrl = _display ctrlCreate ["RscButtonMenu",_idc,_parent];
_ctrl ctrlSetPosition _position;
_ctrl ctrlSetText _text;
_ctrl ctrlSetEventHandler ["ButtonClick",_action];
_ctrl ctrlSetTooltip _tooltip;
_ctrl ctrlCommit 0;
_ctrl;
};
_makeBackgroundGUI = {
params ["_parent","_idc","_position"];
private ["_ctrl"];
_ctrl = _display ctrlCreate ["RscBackgroundGUI", _idc, _parent];
_ctrl ctrlSetPosition _position;
_ctrl ctrlCommit 0;
_ctrl ctrlSetBackgroundColor [0,0,0,0.5];
_ctrl;
};
_makeFrame = {
params ["_parent","_idc","_position"];
private ["_ctrl"];
_ctrl = _display ctrlCreate ["RscFrame", _idc, _parent];
_ctrl ctrlSetPosition _position;
_ctrl ctrlEnable false;
_ctrl ctrlCommit 0;
_ctrl;
};
_makeStructuredText = {
params ["_parent","_idc","_position","_text","_font","_size","_color","_align","_shadow"];
private ["_ctrl"];
_ctrl = _display ctrlCreate ["RscStructuredText", _idc, _parent];
_ctrl ctrlSetPosition _position;
_ctrl ctrlSetStructuredText (parseText format ["<t shadow='%6' font='%5' align='%4' size='%2' color='%3'>%1</t>", _text,_size,_color, _align,_font,_shadow]);
_ctrl ctrlEnable false;
_ctrl ctrlCommit 0;
_ctrl;
};
_makePicture = {
params ["_parent","_idc","_position","_picture","_color","_enable","_keepAspect","_tooltip"];
private ["_ctrl"];
_ctrl = _display ctrlCreate [(if (_keepAspect) then {"RscPictureKeepAspect"} else {"RscPicture"}), _idc, _parent];
_ctrl ctrlSetPosition _position;
_ctrl ctrlSetText _picture;
_ctrl ctrlSetTextColor _color;
_ctrl ctrlEnable _enable;
_ctrl ctrlSetTooltip _tooltip;
_ctrl ctrlCommit 0;
_ctrl;
};
_makeList = {
params ["_parent","_idc","_position","_actionOnSelChanged","_tooltip"];
private ["_ctrl"];
_ctrl = _display ctrlCreate ["RscListBox",_idc,_parent];
_ctrl ctrlSetPosition _position;
_ctrl ctrlSetEventHandler ["LBSelChanged",_actionOnSelChanged];
_ctrl ctrlSetTooltip _tooltip;
_ctrl ctrlCommit 0;
_ctrl;
};
_makeCheckBox = {
params ["_parent","_idc","_position","_actionOnSelChanged","_tooltip"];
private ["_ctrl"];
_ctrl = _display ctrlCreate ["RscCheckBox",_idc,_parent];
_ctrl ctrlSetPosition _position;
_ctrl ctrlSetEventHandler ["CheckedChanged",_actionOnSelChanged];
_ctrl ctrlSetTooltip _tooltip;
_ctrl ctrlCommit 0;
_ctrl;
};
_getNextIDC = {
params ["_key"];
private ["_slideClassName","_baseIDC","_result","_map"];
_slideClassName = "mainVGSlide";
_map = XM8_VG_mainVGSlideIDCmap;
_baseIDC = getNumber (missionConfigFile >> "CfgXM8" >> _slideClassName >> "controlID");
_result = _baseIDC + (_map pushBack _key);
_result;
};
_pW = 0.025;
_pH = 0.04;
_leftCol = 1;
_leftColW = 12.8;
_rightCol = _leftCol + _leftColW + 2;
_rightColW = _leftColW + 3;
_margin = 0.2;
_display = uiNameSpace getVariable ["RscExileXM8", displayNull];
if (isNull _display) exitWith {_error = "Error loading XM8 VG app, display is null"; systemChat _error; diag_log _error;};
_slides = _display displayCtrl 4007;
if (isNull _slides) exitWith {_error = "Error loading XM8 VG app, slides control is null"; systemChat _error; diag_log _error;};
_unloadScript = '
if (ExileClientXM8CurrentSlide == "mainVGSlide") then {
ExileClientXM8CurrentSlide = "sideApps";
};
ExAdCurFlagNetId = nil;
';
_display displayAddEventHandler ["unload",_unloadScript];
XM8_VG_mainVGSlideIDCmap = [];
_thisSlide = _display ctrlCreate ["RscExileXM8Slide",("mainVGSlide" call _getNextIDC),_slides];
[_thisSlide,("backButton" call _getNextIDC),[27.6 * _pW, 17.7 * _pH, 6 * _pW, 1 * _pH],'["sideApps", 1] call ExileClient_gui_xm8_slide;',STR_ExAd_VG_APP_BTN_BACK,""] call _makeButton;
/*Stored Vehicle Details*/
[_thisSlide,("InfoTitle" call _getNextIDC),[_rightCol * _pW, 2.75 * _pH, _rightColW * _pW, 1 * _pH],STR_ExAd_VG_APP_TTL_DETAILS,"PuristaMedium",1.2,"#ffffff","left",1] call _makeStructuredText;
[_thisSlide,("InfoBgBox" call _getNextIDC),[_rightCol * _pW, 4 * _pH, _rightColW * _pW, 13.5 * _pH]] call _makeBackgroundGUI;
_idcInfoPic = "InfoPic" call _getNextIDC;
[_thisSlide,_idcInfoPic,[(_rightCol + 9) * _pW, 4 * _pH, 6.75 * _pW, 5.5 * _pH],"",[1,1,1,1],false,true,""] call _makePicture;
_idcInfoStr = "InfoVehStr" call _getNextIDC;
[_thisSlide,_idcInfoStr,[(_rightCol + _margin) * _pW, (4 + _margin) * _pH, (_rightColW - 2 * _margin) * _pW, (13.5 - 2 * _margin) * _pH],"","PuristaMedium",0.75,"#ffffff","left",1] call _makeStructuredText;
[_thisSlide,("InfoCBStr" call _getNextIDC),[(_rightCol + _margin + 0.4) * _pW, (16.5 - _margin + 0.25 ) * _pH, (_rightColW - 2 * _margin) * _pW, (13.5 - 2 * _margin) * _pH],STR_ExAd_VG_APP_CB_SECRET,"PuristaMedium",0.65,"#ffffff","left",1] call _makeStructuredText;
[_thisSlide,("InfoCB" call _getNextIDC),[(_rightCol + _margin) * _pW, (16.5 - _margin + 0.2) * _pH, 0.75 * _pW, 0.75 * _pH],'profileNamespace setVariable["ExAd_StreamFriendlyUI",_this select 1]',"Toogle - Stream friendly UI"] call _makeCheckBox;
/*Stored Vehicles*/
[_thisSlide,("SubTitle1" call _getNextIDC),[_leftCol * _pW, 2.75 * _pH, _leftColW * _pW, 1 * _pH],STR_ExAd_VG_APP_TTL_STORED,"PuristaMedium",1.2,"#ffffff","left",1] call _makeStructuredText;
[_thisSlide,("SubTitle1Cnt" call _getNextIDC),[_leftCol * _pW, 3 * _pH, _leftColW * _pW, 1 * _pH],"","PuristaMedium",1,"#ffffff","right",1] call _makeStructuredText;
_idcStoredVehList = "StoreVehList" call _getNextIDC;
[_thisSlide,_idcStoredVehList,[_leftCol * _pW, 4 * _pH, _leftColW * _pW, 5 * _pH],format["[_this select 0,%1,%2] call XM8_VG_elChanged",_idcInfoPic,_idcInfoStr],""] call _makeList;
[_thisSlide,("fetchButton" call _getNextIDC),[_leftCol*_pW, 9*_pH, _leftColW*_pW, 1*_pH],format["disableUserInput true;['VGLoad', %1] call ExAd_fnc_onBtnClickVG",_idcStoredVehList],STR_ExAd_VG_APP_BTN_FETCH,""] call _makeButton;
/*Nearby vehicles*/
[_thisSlide,("SubTitle2" call _getNextIDC),[_leftCol * _pW, 10.25 * _pH, _leftColW * _pW, 1 * _pH],STR_ExAd_VG_APP_TTL_NEAR,"PuristaMedium",1.2,"#ffffff","left",1] call _makeStructuredText;
_idcNearVehList = "NearVehicleList" call _getNextIDC;
[_thisSlide,_idcNearVehList,[_leftCol * _pW, 11.5 * _pH, _leftColW * _pW, 5 * _pH],"",""] call _makeList;
[_thisSlide,("storeButton" call _getNextIDC),[_leftCol * _pW, 16.5 * _pH, _leftColW * _pW, 1 * _pH],format["if(call ExAd_fnc_allowVGStore)then{disableUserInput true;['VGStore', %1] call ExAd_fnc_onBtnClickVG}else{['Whoops', ['%2']] call ExileClient_gui_notification_event_addNotification}",_idcNearVehList,STR_ExAd_VG_NOTI_FULL],STR_ExAd_VG_APP_BTN_STORE,""] call _makeButton;

View File

@ -1,175 +0,0 @@
/**
* ExileClient_gui_xm8_show
*
* Exile Mod
* www.exilemod.com
* © 2015 Exile Mod Team
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
*/
/*
XM8 apps Imporeved by vitaly'mind'chizhikov
Based on idea XM8 apps by Shix. see http://www.exilemod.com/topic/9040-xm8-apps/?page=1
Original function from Exile 0.9.6
*/
private["_display","_control","_slideControlID","_slideName","_slideTitle","_slideControl","_titleControl","_toSlideOpenFunction","_hideSideApps"];
disableSerialization;
createDialog "RscExileXM8";
ExileClientXM8IsVisible = true;
_display = uiNameSpace getVariable ["RscExileXM8", displayNull];
if (ExileClientXM8IsPowerOn) then {
_control = _display displayCtrl 4002;
_control ctrlSetFade 1;
_control ctrlCommit 0;
} else {
{
_control = _display displayCtrl _x;
_control ctrlSetFade 1;
_control ctrlCommit 0;
} forEach [4002,4003,4004,4005,4007,4001,4010,4030,4020];
};
true call ExileClient_gui_postProcessing_toggleDialogBackgroundBlur;
if (ExileClientXM8CurrentSlide isEqualTo "party") then {
if (ExileClientPartyID isEqualTo -1) then {
ExileClientXM8CurrentSlide = "apps";
};
};
private ["_sliders","_appSlide","_newTerritoryBut","_newTerritoryPic","_sideAppsBut","_sideAppsPic","_newSliderIDC","_newSlider","_buttonBack",
"_makeButtonCtrl","_pW","_pH"];
_pW = 0.025;
_pH = 0.04;
_sliders = _display displayCtrl 4007;
_appSlide = _sliders controlsGroupCtrl 4040;
//Lets create XM8_apps slide manually, as we are unable to change RscExileXM8 directly in config.
_newSliderIDC = getNumber (missionConfigFile >> "CfgXM8" >> "sideApps" >> "controlID");
_newSlider = _display ctrlCreate ["RscExileXM8Slide", _newSliderIDC, _sliders];
//Lets fill our slider with contents. First lets make go back button
_buttonBack = _display ctrlCreate ["RscButtonMenu",_newSliderIDC + 1,_newSlider];
_buttonBack ctrlSetPosition [27.6*_pW,17.7*_pH,6*_pW,1*_pH];
_buttonBack ctrlSetText "GO BACK";
_buttonBack ctrlSetEventHandler ["ButtonClick","['apps', 1] call ExileClient_gui_xm8_slide"];
_buttonBack ctrlCommit 0;
//We hide sideApps in order to be compatible with legacy apps.
_hideSideApps = '
disableSerialization;
_display = uiNameSpace getVariable ["RscExileXM8", displayNull];
_sliders = _display displayCtrl 4007;
_sideAppsIDC = getNumber (missionConfigFile >> "CfgXM8" >> "sideApps" >> "controlID");
_appSlide = _display displayCtrl _sideAppsIDC;
_appSlide ctrlShow false;
_appSlide ctrlCommit 0;
';
//We make app buttons with this function
_makeButtonCtrl = {
params ["_idc","_pos","_text","_script","_parent","_pic","_compatible"];
private ["_ctrl"];
_ctrl = _display ctrlCreate ["RscExileXM8AppButton1x1",_idc,_parent];
_ctrl ctrlSetPosition [_pos select 0,_pos select 1,6 * _pW, 4.8 * _pH];
_ctrl ctrlSetText _text;
if (!_compatible) then {
_ctrl ctrlSetEventHandler ["ButtonClick",_hideSideApps];
} else {
_ctrl ctrlSetEventHandler ["ButtonClick",""];
};
_ctrl ctrlAddEventHandler ["ButtonClick",format ["call %1",_script]];
_ctrl ctrlCommit 0;
_ctrl = _display ctrlCreate ["RscPictureKeepAspect",-1,_parent];
_ctrl ctrlSetText _pic;
_ctrl ctrlSetPosition [_pos select 0,(_pos select 1) + 0.01,6 * _pW, 2.8 * _pH];
_ctrl ctrlEnable false;
_ctrl ctrlCommit 0;
};
//Lets try to create 15 buttons, if some buttons in XM8_apps_config are commented, they will be scipped
for "_i" from 1 to 15 do {
private ["_pos", "_data"];
if (!isNil (format ["XM8_apps_app%1", _i])) then {
_data = call compile format ["XM8_apps_app%1", _i];
_pos = [0,0];
if (_i in [1,2,3,4,5]) then {
_pos set [0, (0.4 + ((_i-1) * 6.8)) * _pW];
_pos set [1, 2 * _pH];
};
if (_i in [6,7,8,9,10]) then {
_pos set [0, (0.4 + (((_i-1) - 5) * 6.8)) * _pW];
_pos set [1, 7.2 * _pH];
};
if (_i in [11,12,13,14,15]) then {
_pos set [0, (0.4 + (((_i-1) - 10) * 6.8)) * _pW];
_pos set [1, 12.4 * _pH];
};
[(_newSliderIDC + 1 + _i) ,_pos,(_data select 0),str(_data select 2),_newSlider,(_data select 1),(_data select 3)] call _makeButtonCtrl;
};
};
/*
We need some space to put XM8_apps button, for that lets cut territory button in half.
In fact we cant re-possition button as it will render picture (textureNoShortcut) incorrectly.
So lets make new 'territory' button, smaller then original one.
We will hide old button in ExileClient_gui_xm8_slide_apps_onOpen and ExileClient_gui_xm8_slide
*/
_newTerritoryBut = _display ctrlCreate ["RscExileXM8AppButton1x1",(_newSliderIDC + 15),_appSlide];
_newTerritoryBut ctrlSetPosition [(23.5 - 3) * _pW,(9.5 - 2) * _pH,6 * _pW, 5 * _pH];
_newTerritoryBut ctrlSetText getText (configFile >> "CfgXM8" >> "territory" >> "title");
_newTerritoryBut ctrlSetEventHandler ["ButtonClick","['territory', 0] call ExileClient_gui_xm8_slide"];
_newTerritoryBut ctrlCommit 0;
_newTerritoryPic = _display ctrlCreate ["RscPictureKeepAspect",(_newSliderIDC + 17),_appSlide];
_newTerritoryPic ctrlSetText "\exile_assets\texture\ui\xm8_app_territory_ca.paa";
_newTerritoryPic ctrlSetPosition [(25 - 3) * _pW,(10 - 2) * _pH,(6 * _pW) * 0.5, (5 * _pH) * 0.5];
_newTerritoryPic ctrlEnable false;
_newTerritoryPic ctrlCommit 0;
//Now lets make New button for XM8_apps inside app slider.
_sideAppsBut = _display ctrlCreate ["RscExileXM8AppButton1x1",(_newSliderIDC + 16),_appSlide];
_sideAppsBut ctrlSetPosition [(30 - 3) * _pW,(9.5 - 2) * _pH,6 * _pW, 5 * _pH];
_sideAppsBut ctrlSetText getText (missionConfigFile >> "CfgXM8" >> "sideApps" >> "title");
_sideAppsBut ctrlSetEventHandler ["ButtonClick","['sideApps', 0] call ExileClient_gui_xm8_slide"];
_sideAppsBut ctrlCommit 0;
_sideAppsPic = _display ctrlCreate ["RscPictureKeepAspect",(_newSliderIDC + 18),_appSlide];
_sideAppsPic ctrlSetText format ["%1%2",XM8_apps_folderPath, "XM8_apps\icons\apps_icon.paa"];
_sideAppsPic ctrlSetPosition [(31.5 - 3) * _pW,(10 - 2) * _pH,(6 * _pW) * 0.5, (5 * _pH) * 0.5];
_sideAppsPic ctrlEnable false;
_sideAppsPic ctrlCommit 0;
{
//We dont have configured slides, thus we create it via scripting. We do that by executing slide creating scripts.
_slideOnLoadScript = getText (_x >> "onLoadScript");
if (!isNil "_slideOnLoadScript") then {
call compile preprocessFileLineNumbers _slideOnLoadScript;
};
_slideControlID = getNumber (_x >> "controlID");
_slideName = configName _x;
_slideTitle = getText (_x >> "title");
_slideControl = _display displayCtrl _slideControlID;
if (_slideName isEqualTo ExileClientXM8CurrentSlide) then {
_titleControl = _display displayCtrl 4004;
_titleControl ctrlSetStructuredText (parseText (format ["<t align='center' font='RobotoMedium'>%1</t>", _slideTitle]));
_slideControl ctrlSetPosition [(0 * 0.05), (0 * 0.05)];
_slideControl ctrlCommit 0;
_slideControl ctrlShow true;
_toSlideOpenFunction = missionNamespace getVariable [format ["ExileClient_gui_xm8_slide_%1_onOpen", _slideName], ""];
if !(_toSlideOpenFunction isEqualTo "") then
{
call _toSlideOpenFunction;
};
} else {
_slideControl ctrlShow false;
};
} forEach (("true" configClasses (configFile >> "CfgXM8")) + ("true" configClasses (missionConfigFile >> "CfgXM8")));
/*
Lets read missionConfigFile as well, as we may have custom slides added.
forEach ("true" configClasses (configFile >> "CfgXM8")); //Original line
*/
ExileXM8ThreadHandle = [10, ExileClient_gui_xm8_thread_update, [], true] call ExileClient_system_thread_addtask;
call ExileClient_gui_xm8_thread_update;

View File

@ -1,47 +0,0 @@
/**
* ExileClient_gui_xm8_slide_apps_onOpen
*
* Exile Mod
* www.exilemod.com
* © 2015 Exile Mod Team
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
*/
// XM8 apps Imporeved by vitaly'mind'chizhikov
// Based on idea XM8 apps by Shix. see http://www.exilemod.com/topic/9040-xm8-apps/?page=1
// Original function from Exile 0.9.6
private["_display","_health","_popTabsValue","_popTabs","_respectValue","_respect"];
disableSerialization;
_display = uiNameSpace getVariable ["RscExileXM8", displayNull];
_health = _display displayCtrl 4057;
_health ctrlSetStructuredText parseText (format ["<t color='#00b2cd' font='OrbitronLight' size='1.6' valign='middle' align='center' shadow='0'><br/><br/><br/><t font='OrbitronMedium' size='3.5' color='#ffffff'>%1%2</t><br/>HEALTH</t>", round ((1 - damage player) * 100), "%"]);
_popTabsValue = ExileClientPlayerMoney;
if (_popTabsValue > 999) then
{
_popTabsValue = format ["%1k", floor (_popTabsValue / 1000)];
};
_popTabs = _display displayCtrl 4058;
_popTabs ctrlSetTooltip format["%1", ExileClientPlayerMoney];
_popTabs ctrlSetStructuredText parseText (format ["<t color='#00b2cd' font='OrbitronLight' size='1.6' valign='middle' align='center' shadow='0'><br/><br/><br/><t font='OrbitronMedium' size='3.5' color='#ffffff'>%1</t><br/>POP TABS</t>", _popTabsValue]);
_respectValue = ExileClientPlayerScore;
if (_respectValue > 999) then
{
_respectValue = format ["%1k", floor (_respectValue / 1000)];
};
_respect = _display displayCtrl 4059;
_respect ctrlSetTooltip format["%1", ExileClientPlayerScore];
_respect ctrlSetStructuredText parseText (format ["<t color='#00b2cd' font='OrbitronLight' size='1.6' valign='middle' align='center' shadow='0'><br/><br/><br/><t font='OrbitronMedium' size='3.5' color='#ffffff'>%1</t><br/>RESPECT</t>", _respectValue]);
//Lets hide old territory button, as we already made new one early on in ExileClient_gui_xm8_show.
//Why we make new? Because if button is re-possition it will render picture (textureNoShortcut) incorrectly.
private ["_sliders","_appSlide","_oldTerritoryBut"];
_sliders = _display displayCtrl 4007;
_appSlide = _sliders controlsGroupCtrl 4040;
_oldTerritoryBut = _appSlide controlsGroupCtrl 1113;
_oldTerritoryBut ctrlShow false;
_oldTerritoryBut ctrlSetFade 0;
_oldTerritoryBut ctrlCommit 0;

View File

@ -1,28 +0,0 @@
/*
Improved XM8 apps by vitaly'mind'chizhikov
Original idea by Shix.
*/
params ["_pathToFolder"];
//Setting path to app
XM8_apps_folderPath = _pathToFolder;
//Apply config
call compile preprocessFileLineNumbers format ["%1XM8_apps\XM8_apps_config.sqf",_pathToFolder];
//Run init scripts for those apps that made for Improved XM8 apps (not legacy apps)
for "_i" from 1 to 15 do {
private ["_pos", "_data"];
if (!isNil (format ["XM8_apps_app%1", _i])) then {
_data = call compile format ["XM8_apps_app%1", _i];
if (_data select 3) then {
_arr = (_data select 4) splitString "\";
_arr resize ((count _arr) - 2);
((_arr joinString "\") + "\") call compile preprocessFileLineNumbers (_data select 4);
} else {
};
};
};

View File

@ -1,6 +1,22 @@
class CfgXM8
{
extraApps[] = {"ExAd_VG"};
class ExAd_VG
{
title = "Virtual Garage";
controlID = 50000; //IDC:50000 -> 50014
onLoad = "ExAdClient\XM8\Apps\VG\onLoad.sqf";
onOpen = "ExAdClient\XM8\Apps\VG\onOpen.sqf";
onClose = "ExAdClient\XM8\Apps\VG\onClose.sqf";
};
};
class CfgExileCustomCode class CfgExileCustomCode
{ {
ExileServer_system_territory_database_load = "ExAdClient\VirtualGarage\CustomCode\ExileServer_system_territory_database_load.sqf"; ExileServer_system_territory_database_load = "ExAdClient\VirtualGarage\CustomCode\ExileServer_system_territory_database_load.sqf";
ExileClient_gui_xm8_slide = "ExAdClient\XM8\CustomCode\ExileClient_gui_xm8_slide.sqf";
ExileClient_gui_xm8_show = "ExAdClient\XM8\CustomCode\ExileClient_gui_xm8_show.sqf";
}; };
class CfgInteractionMenus class CfgInteractionMenus
@ -11,12 +27,6 @@ class CfgInteractionMenus
target = "Exile_Construction_Flag_Static"; target = "Exile_Construction_Flag_Static";
class Actions class Actions
{ {
class VG : ExileAbstractAction
{
title = "Virtual Garage";
condition = "(([_object, getPlayerUID player] call ExileClient_util_territory_getAccessLevel) select 0) >= ExAd_VG_ACCESS_LEVEL";
action = "[] spawn {[] call ExileClient_gui_xm8_show; UISleep 1; call XM8_VG_checkNearByFlags}";
};
class HackVG : ExileAbstractAction class HackVG : ExileAbstractAction
{ {
title = "Hack Virtual Garage"; title = "Hack Virtual Garage";