diff --git a/@ExileServer/addons/a3_infiSTAR_Exile/EXILE_AHAT_CONFIG.hpp b/@ExileServer/addons/a3_infiSTAR_Exile/EXILE_AHAT_CONFIG.hpp index 4fbcedd..8faf409 100644 --- a/@ExileServer/addons/a3_infiSTAR_Exile/EXILE_AHAT_CONFIG.hpp +++ b/@ExileServer/addons/a3_infiSTAR_Exile/EXILE_AHAT_CONFIG.hpp @@ -810,6 +810,7 @@ allowedIDDs[] = 5501,5502,5503,5504,5505,5506,5507, // BRAma Cookbook -1339,-1340, // custom infiSTAR dialogs (some editor & a private chat menu) 86000, // xsSpawn above the last number 46 + 999999, //modChecker /* main idd - never delete it */ 46 diff --git a/mpmissions/Exile.Altis.pbo b/mpmissions/Exile.Altis.pbo index bc92ca0..2e9a7f9 100644 Binary files a/mpmissions/Exile.Altis.pbo and b/mpmissions/Exile.Altis.pbo differ diff --git a/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/modchecker/modChecker.paa b/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/modchecker/modChecker.paa new file mode 100644 index 0000000..544a39d Binary files /dev/null and b/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/modchecker/modChecker.paa differ diff --git a/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/modchecker/onClose.sqf b/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/modchecker/onClose.sqf new file mode 100644 index 0000000..e69de29 diff --git a/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/modchecker/onLoad.sqf b/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/modchecker/onLoad.sqf new file mode 100644 index 0000000..a8213d0 --- /dev/null +++ b/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/modchecker/onLoad.sqf @@ -0,0 +1,35 @@ +/* + onLoad.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 = 0; +_leftColW = 12.8; +_rightCol = _leftCol + _leftColW + 2; +_rightColW = _leftColW + 3; +_margin = 0.2; + +_slideClass = "ExAd_ModChecker"; + +[_display,_slide,([_slideClass,"backButton"] call ExAd_fnc_getNextIDC),[27 * _pW, 17 * _pH, 6 * _pW, 1 * _pH],'["extraApps", 1] call ExileClient_gui_xm8_slide;',"Go Back"] call ExAd_fnc_createButton; + +_newParent = [_display,_slide,([_slideClass,"ctrlGrp"] call ExAd_fnc_getNextIDC),[_leftCol * _pW, 1 * _pH, (_leftColW + _rightCol + 6) * _pW, 16 * _pH]] call ExAd_fnc_createCtrlGrp; +[_display,_newParent,([_slideClass,"strTxt"] call ExAd_fnc_getNextIDC),[_leftCol * _pW, 1.5 * _pH, (_leftColW + _rightCol + 5) * _pW, 15 * _pH],"","PuristaMedium",1,"#ffffff","right",1] call ExAd_fnc_createStructuredText; + +true \ No newline at end of file diff --git a/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/modchecker/onOpen.sqf b/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/modchecker/onOpen.sqf new file mode 100644 index 0000000..6a4a35e --- /dev/null +++ b/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/modchecker/onOpen.sqf @@ -0,0 +1,54 @@ +// ********************************************************************************************************** +// * This project is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +// * https://creativecommons.org/licenses/by-sa/4.0/ +// ********************************************************************************************************** +// @file Name: xm8modChecker.sqf +// @file Author: jmayr2000 (from exilemod.com) + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// DO NOT TOUCH UNDER THIS LINE IF DON'T KNOW WHAT ARE YOU DOING +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +private["_display","_message","_strTxt","_pos"]; + +try +{ + _message = preprocessFileLineNumbers "ExAdClient\XM8\Apps\ModChecker\xm8modChecker.sqf"; + _message = _message select [(_message find "ExAdClient") + (count "ExAdClient\XM8\Apps\ModChecker\xm8modChecker.sqf") + 1]; + + if(count _message == 0)exitWith{ + throw "No server info provided"; + }; + +disableSerialization; +[ + "", + 0, + 0.2, + 10, + 0, + 0, + 8 +] spawn BIS_fnc_dynamicText; + +#include "..\..\..\..\addons\modChecker\displayConfig.hpp" + + _display = uiNameSpace getVariable ["RscExileXM8", displayNull]; + if(isNull _display)exitWith{ + throw "XM8 not loaded!"; + }; + + _strTxt = [_display,"ExAd_ModChecker","strTxt"] call ExAd_fnc_getAppCtrl; + _strTxt ctrlSetStructuredText parseText format[_message]; + + _pos = ctrlPosition _strTxt; + _strTxt ctrlSetPosition [_pos select 0, _pos select 1, _pos select 2, ctrlTextHeight _strTxt]; + _strTxt ctrlcommit 0; + ([_display,"ExAd_ModChecker","strTxt"] call ExAd_fnc_getAppCtrl) ctrlEnable true; +} +catch +{ + ["ErrorTitleAndText", ["ExAd - Mod Checker", _exception]] call ExileClient_gui_toaster_addTemplateToast; + ["extraApps", 1] call ExileClient_gui_xm8_slide +} + diff --git a/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/modchecker/xm8modChecker.sqf b/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/modchecker/xm8modChecker.sqf new file mode 100644 index 0000000..f7813d7 --- /dev/null +++ b/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/modchecker/xm8modChecker.sqf @@ -0,0 +1,20 @@ +// ********************************************************************************************************** +// * This project is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +// * https://creativecommons.org/licenses/by-sa/4.0/ +// ********************************************************************************************************** +// @file Name: xm8modChecker.sqf +// @file Author: jmayr2000 and NRZ7 (www.standarol.com) + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// DO NOT TOUCH UNDER THIS LINE IF DON'T KNOW WHAT ARE YOU DOING +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +errorLevel = 0; // Do not touch. Set errors to 0 before run modChecker.sqf + +#include "..\..\..\..\addons\modChecker\modConfig.hpp" + +if (errorLevel > 0) then { + warnMessage = "Some is WRONG with your MODS
"; // General error message + } else { + warnMessage = "All MODS are FINE
"; // All mods are loaded message + }; diff --git a/mpmissions/Exile.Altis/addons/modChecker/displayConfig.hpp b/mpmissions/Exile.Altis/addons/modChecker/displayConfig.hpp new file mode 100644 index 0000000..0799a27 --- /dev/null +++ b/mpmissions/Exile.Altis/addons/modChecker/displayConfig.hpp @@ -0,0 +1,53 @@ +// ********************************************************************************************************** +// * This project is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +// * https://creativecommons.org/licenses/by-sa/4.0/ +// ********************************************************************************************************** +// @file Name: modmodCheckerDisplay.sqf +// @file Author: NRZ7 (www.standarol.com) and Repentz +// @description: This script is a UI launched by modmodChecker.sqf. If any mod is not loaded, pop's a screen with detailed information and clickable community links (modmodCheckerDisplay.sqf). +// You can configure custom messages and links to your community guides. + + +///////////////////////////////////////////////////////////////////////////////////////////// +// DISPLAY HEADER +///////////////////////////////////////////////////////////////////////////////////////////// + +_message = ""; +_message = _message + "
"; +_message = _message + "Welcome to Mod modChecker
"; +_message = _message + "______________________________________________________________________________________

"; +_message = _message + warnMessage; +_message = _message + "
"; + + +///////////////////////////////////////////////////////////////////////////////////////////// +// MOD CONFIG PART HERE +// Remember to add-delete-modify the same mod variable names used in modmodCheckerConfig.hpp +///////////////////////////////////////////////////////////////////////////////////////////// +//_message = _message + modCheckExile; +//_message = _message + modCheckEsseker; +//_message = _message + modCheckRyan; +//_message = _message + modCheckWeapons; +//_message = _message + modCheckVehicles; +//_message = _message + modCheckUnits; +//_message = _message + modCheckTerrain; +_message = _message + modCheckCBA; +_message = _message + modCheckEN; +_message = _message + modCheckAR; +_message = _message + modCheckAUR; +_message = _message + modCheckBVFL; +_message = _message + modCheckNVG; +_message = _message + modCheckAG; +//_message = message + modCheckYOURMOD; + + +///////////////////////////////////////////////////////////////////////////////////////////// +// Custom message with community links - MODIFY HERE +///////////////////////////////////////////////////////////////////////////////////////////// + +_message = _message + "
"; +_message = _message + "If you get any error, please, read the following links

"; +_message = _message + "Download the mods from Steam Workshop Only click on Subscribe!
"; +_message = _message + "The mod list is only viewable by friends. Make sure you've befriended Zepheris96

"; +// _message = message + "Easy add more lines like this"; +// _message = _message + "You can easy add ANY LINK! And unlimited number of lines.
"; \ No newline at end of file diff --git a/mpmissions/Exile.Altis/addons/modChecker/init/modCheckerDisplay.sqf b/mpmissions/Exile.Altis/addons/modChecker/init/modCheckerDisplay.sqf new file mode 100644 index 0000000..365db4a --- /dev/null +++ b/mpmissions/Exile.Altis/addons/modChecker/init/modCheckerDisplay.sqf @@ -0,0 +1,71 @@ +// ********************************************************************************************************** +// * This project is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +// * https://creativecommons.org/licenses/by-sa/4.0/ +// ********************************************************************************************************** +// @file Name: modCheckerDisplay.sqf +// @file Author: NRZ7 (www.standarol.com) +// @description: This script is a UI launched by modchecker.sqf. If any mod is not loaded, pop's a screen with detailed information and clickable community links (modCheckerDisplay.sqf). +// You can configure custom messages and links to your community guides. + +/* + Some code is from + File: rules.sqf + For exile edited by Repentz + Link: http://www.exilemod.com/topic/10375-advanced-server-rules-for-xm8/ +*/ + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// DO NOT TOUCH UNDER THIS LINE IF DON'T KNOW WHAT ARE YOU DOING +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +if ((firstCheck == 0) && (errorLevel > 0)) then { player allowdamage false }; // God Mode ON to avoid die and close dialog only if ModCheckerDisplay is auto executed. + +disableSerialization; +[ + "", + 0, + 0.2, + 10, + 0, + 0, + 8 +] spawn BIS_fnc_dynamicText; + +createDialog "RscDisplayWelcome"; + +_display = findDisplay 999999; // 999999 needed to whitelist in infistar if you are using this. +_text1 = _display displayCtrl 1100; +_buttonSpoiler = _display displayctrl 2400; +_textSpoiler = _display displayctrl 1101; +_text2 = _display displayCtrl 1102; + +#include "..\displayConfig.hpp" + +//Fill only the first text +_text1 ctrlSetStructuredText (parseText _message); + +//Resize StructuredText component to display the scrollbar if needed +_positionText1 = ctrlPosition _text1; +_yText1 = _positionText1 select 1; +_hText1 = ctrlTextHeight _text1; +_text1 ctrlSetPosition [_positionText1 select 0, _yText1, _positionText1 select 2, _hText1]; +_text1 ctrlcommit 0; +//Hide second text, spoiler text and button +_buttonSpoiler ctrlSetFade 1; +_buttonSpoiler ctrlCommit 0; +_buttonSpoiler ctrlEnable false; +_textSpoiler ctrlSetFade 1; +_textSpoiler ctrlCommit 0; +_text2 ctrlSetFade 1; +_text2 ctrlCommit 0; + +//Waith until dialog is closed and kick the player if a required mod is not loaded. +waitUntil {!dialog }; +if (errorLevel > 90) then // non requiered addons have level 1. Requiered addons have error level 99. + { + endMission "LOSER" + } + else + { + firstCheck = 1; player allowDamage true // Disables God Mode protection and set mods as checked. + }; \ No newline at end of file diff --git a/mpmissions/Exile.Altis/addons/modChecker/init/modCheckerInit.sqf b/mpmissions/Exile.Altis/addons/modChecker/init/modCheckerInit.sqf new file mode 100644 index 0000000..e99d23a --- /dev/null +++ b/mpmissions/Exile.Altis/addons/modChecker/init/modCheckerInit.sqf @@ -0,0 +1,33 @@ +// ********************************************************************************************************** +// * This project is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +// * https://creativecommons.org/licenses/by-sa/4.0/ +// ********************************************************************************************************** +// @file Name: modChecker.sqf +// @file Author: NRZ7 (www.standarol.com) +// @description: This script check the mods loaded by the client. If any mod is not loaded, pop's a screen with detailed information and clickable community links (modCheckerDisplay.sqf). +// You can configure requiered addons (error 99) or optional addons (error 1). If any required mod fails, the client load "You Loose" screen after close the dialog. +// + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// DO NOT TOUCH UNDER THIS LINE IF DON'T KNOW WHAT ARE YOU DOING +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +errorLevel = 0; + +#include "..\modConfig.hpp" + +if (errorLevel > 0) then { + warnMessage = "Some is WRONG with your MODS
"; + } else { + warnMessage = "All MODS are FINE
"; + }; + +if ((errorLevel == 0) && (firstCheck == 0)) then { + firstCheck = 1 // Do nothing + } else { + execVM "addons\modChecker\init\modCheckerDisplay.sqf" + }; + +// execVM "addons\modChecker\init\modCheckerDisplay.sqf" + + diff --git a/mpmissions/Exile.Altis/addons/modChecker/modConfig.hpp b/mpmissions/Exile.Altis/addons/modChecker/modConfig.hpp new file mode 100644 index 0000000..c10b015 --- /dev/null +++ b/mpmissions/Exile.Altis/addons/modChecker/modConfig.hpp @@ -0,0 +1,158 @@ +// ********************************************************************************************************** +// * This project is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +// * https://creativecommons.org/licenses/by-sa/4.0/ +// ********************************************************************************************************** +// @file Name: modmodChecker.sqf +// @file Author: NRZ7 (www.standarol.com) +// @description: This script modCheck the mods loaded by the client. If any mod is not loaded, pop's a screen with detailed information and clickable community links (modmodCheckerDisplay.sqf). +// You can configure requiered addons (error 99) or optional addons (error 1). If any required mod fails, the client load "You Loose" screen after close the dialog. + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Exile_Client Example - READ TO UNDERSTAND - DO NOT TOUCH - READ - DO NOT TOUCH - READ - DO NOT TOUCH +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// Change "Exile_Client" to name of the CfgPatches from desired mod. +// You can find under editor. ("Tools" - "Config Viewer" - "Configfile" - "CfgPatches") +if (isClass(configFile >> "CfgPatches" >> "Exile_Client")) then + { +// Change modCheckExile to your desired and unique mod variable name +// Change "Exile Mod is" to your mod string. For advanced users, can change size, color, allign, etc. + modCheckExile = "Exile Mod is found!
"; + } else { +// Change "Exile Mod is" to your mod string + modCheckExile = "Exile Mod is NOT FOUND!
"; +// Set 99 to Required, Set 1 to optional + errorLevel = errorLevel + 99 + }; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// START OF MODS CONFIG - EDIT OR DELETE UNDER THIS LINE +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// Esseker Example - DELETE OR MODIFY +/*if (isClass(configFile >> "CfgPatches" >> "Esseker")) then + { + modCheckEsseker = "Esseker Map is found!
"; + } else { + modCheckEsseker = "Esseker Map is NOT FOUND!
"; + errorLevel = errorLevel + 99 + }; + +// Zombis & Demonds Example - DELETE OR MODIFY +if (isClass(configFile >> "CfgPatches" >> "Ryanzombies")) then + { + modCheckRyan = "Zombies and Demonds is found!
"; + } else { + modCheckRyan = "Zombies and Demonds is NOT FOUND!
"; + errorLevel = errorLevel + 99 + }; + +// CUP_Weapons Example - DELETE OR MODIFY +if (isClass(configFile >> "CfgPatches" >> "CUP_Weapons_WeaponsCore")) then + { + modCheckWeapons = "CUP Weapons is found!
"; + } else { + modCheckWeapons = "CUP Weapons is NOT FOUND!
"; + errorLevel = errorLevel + 99 + }; + +// CUP_Vehicles Example - DELETE OR MODIFY +if (isClass(configFile >> "CfgPatches" >> "CUP_Vehicles_Core")) then + { + modCheckVehicles = "CUP Vehicles is found!
"; + } else { + modCheckVehicles = "CUP Vehicles is NOT FOUND!
"; + errorLevel = errorLevel + 99 + }; + +// CUP_TerrainCore Example - DELETE OR MODIFY +if (isClass(configFile >> "CfgPatches" >> "CUP_Worlds")) then + { + modCheckTerrain = "CUP Terrain Core is found!
"; + } else { + modCheckTerrain = "CUP Terrain Core is NOT FOUND!
"; + errorLevel = errorLevel + 1 + }; + +// CUP_Units Example - DELETE OR MODIFY +if (isClass(configFile >> "CfgPatches" >> "CUP_Creatures_People_Core")) then + { + modCheckUnits = "CUP Units is found!
"; + } else { + modCheckUnits = "CUP Units is NOT FOUND!
"; + errorLevel = errorLevel + 99 + }; +*/ +// Community Base Addon Example - DELETE OR MODIFY +if (isClass(configFile >> "CfgPatches" >> "CBA_main")) then + { + modCheckCBA = "CBA_A3 is found!
"; + } else { + modCheckCBA = "CBA_A3 is NOT FOUND! (Required)
"; + errorLevel = errorLevel + 99 + }; + +//Enhanced Movement +if (isClass(configFile >> "CfgPatches" >> "BaBe_core")) then + { + modCheckEN = "Enhanced Movement is found!
"; + } else { + modCheckEN = "Enhanced Movement is NOT FOUND! (Not required)
"; + errorLevel = errorLevel + 1 + }; + +//Advanced Rappelling +if (isClass(configFile >> "CfgPatches" >> "AR_AdvancedRappelling")) then + { + modCheckAR = "Advanced Rappelling is found!
"; + } else { + modCheckAR = "Advanced Rappelling is NOT FOUND! (Not required)
"; + errorLevel = errorLevel + 1 + }; + +//Advanced Urban Rappelling +if (isClass(configFile >> "CfgPatches" >> "AUR_AdvancedUrbanRappelling")) then + { + modCheckAUR = "Advanced Urban Rappelling is found!
"; + } else { + modCheckAUR = "Advanced Urban Rappelling is NOT FOUND! (Not required)
"; + errorLevel = errorLevel + 1 + }; + +//bv_flashlight +if (isClass(configFile >> "CfgPatches" >> "bv_flashlight")) then + { + modCheckBVFL = "bv_flashlight is found!
"; + } else { + modCheckBVFL = "bv_flashlight is NOT FOUND! (Required)
"; + errorLevel = errorLevel + 99 + }; + +//lsd_nvg +if (isClass(configFile >> "CfgPatches" >> "lsd_nvg")) then + { + modCheckNVG = "Full Screen NV is found!
"; + } else { + modCheckNVG = "Full Screen NV is NOT FOUND! (Not required)
"; + errorLevel = errorLevel + 1 + }; + +//adjustable Grenades +if (isClass(configFile >> "CfgPatches" >> "vz_a3_adjustableGrenades")) then + { + modCheckAG = "Adjustable Grenades is found!
"; + } else { + modCheckAG = "Adjustable Grenades is NOT FOUND! (Not required)
"; + errorLevel = errorLevel + 1 + }; +// YOU CAN ADD MORE MODS, ADD FOR EACH SOME CODE LIKE THIS + +/* +if (isClass(configFile >> "CfgPatches" >> "YOUR_MOD_CLASSNAME")) then + { + modCheckYOURMOD = "YOUR MOD is found!
"; + } else { + modCheckYOURMOD = "YOUR MOD is NOT FOUND!
"; + errorLevel = errorLevel + 1 + }; +*/ diff --git a/mpmissions/Exile.Altis/config.cpp b/mpmissions/Exile.Altis/config.cpp index 37bcc7e..c5fe64a 100644 --- a/mpmissions/Exile.Altis/config.cpp +++ b/mpmissions/Exile.Altis/config.cpp @@ -2246,7 +2246,7 @@ class CfgVehicleTransport class CfgXM8 { - extraApps[] = {"ExAd_VG","ExAd_CHVD","ExAd_Bike","ExAd_SB","BRAmaRecipes"}; + extraApps[] = {"ExAd_Bike","ExAd_VG","ExAd_CHVD","BRAmaRecipes","ExAd_Bike","ExAd_modChecker"}; class ExAd_VG { @@ -2324,6 +2324,15 @@ class CfgXM8 onLoad = "ExAdClient\XM8\Apps\BRAmaRecipes\onLoad.sqf"; onOpen = "ExAdClient\XM8\Apps\BRAmaRecipes\onOpen.sqf"; }; + class ExAd_modChecker + { + title = "Mod Checker"; + controlID = 99999; + logo = "ExadClient\XM8\Apps\modChecker\modChecker.paa"; + onLoad = "ExAdClient\XM8\Apps\modChecker\onLoad.sqf"; + onOpen = "ExAdClient\XM8\Apps\modChecker\onOpen.sqf"; + onClose = "ExAdClient\XM8\Apps\modChecker\onClose.sqf"; + }; }; class SpawnVehicleItems{ diff --git a/mpmissions/Exile.Altis/initPlayerLocal.sqf b/mpmissions/Exile.Altis/initPlayerLocal.sqf index d816a0f..0902d4e 100644 --- a/mpmissions/Exile.Altis/initPlayerLocal.sqf +++ b/mpmissions/Exile.Altis/initPlayerLocal.sqf @@ -506,3 +506,13 @@ call ExileClient_object_trader_create; 187.428 ] call ExileClient_object_trader_create; + +/////////////////////////////////////////////////////////////////////////// +// MOD CHECKER +/////////////////////////////////////////////////////////////////////////// + +waitUntil {!isNull findDisplay 46 && !isNil 'ExileClientLoadedIn' && getPlayerUID player != ''}; // wait until player is in spawned +uiSleep 3; + +firstCheck = 0; +execVM "addons\modChecker\init\modCheckerInit.sqf";