From 52852997910d8b1b8b96e1319496e7afcbe3346a Mon Sep 17 00:00:00 2001 From: NRZ7 Date: Sat, 15 Oct 2016 13:39:45 +0200 Subject: [PATCH] Better ExAd integration and general structure change Reintal from scratch after this upgrade. --- ExAdClient/XM8/Apps/modchecker/onOpen.sqf | 24 +++++------ .../XM8/Apps/modchecker/xm8modChecker.sqf | 16 ++++--- .../{ => init}/modCheckerDisplay.sqf | 15 +++---- .../modCheckerInit.sqf} | 11 +++-- .../{modCheckerConfig.hpp => modChecker.hpp} | 40 +++++++++++++++--- addons/modChecker/modChecker.paa | Bin 22016 -> 0 bytes ...isplayConfig.hpp => modCheckerDisplay.hpp} | 16 ++++++- initPlayerLocal.sqf | 2 +- 8 files changed, 84 insertions(+), 40 deletions(-) rename addons/modChecker/{ => init}/modCheckerDisplay.sqf (82%) rename addons/modChecker/{modChecker.sqf => init/modCheckerInit.sqf} (91%) rename addons/modChecker/{modCheckerConfig.hpp => modChecker.hpp} (65%) delete mode 100644 addons/modChecker/modChecker.paa rename addons/modChecker/{modCheckerDisplayConfig.hpp => modCheckerDisplay.hpp} (50%) diff --git a/ExAdClient/XM8/Apps/modchecker/onOpen.sqf b/ExAdClient/XM8/Apps/modchecker/onOpen.sqf index 6986a98..6b59293 100644 --- a/ExAdClient/XM8/Apps/modchecker/onOpen.sqf +++ b/ExAdClient/XM8/Apps/modchecker/onOpen.sqf @@ -1,3 +1,14 @@ +// ********************************************************************************************************** +// * 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 @@ -8,8 +19,6 @@ try if(count _message == 0)exitWith{ throw "No server info provided"; }; - - 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; [ @@ -22,16 +31,7 @@ disableSerialization; 8 ] spawn BIS_fnc_dynamicText; -///////////////////////////////////////////////////////////////////////////////////////////// -// CUSTOMIZABLE PART HERE -// Remember to add-delete-modify the same mod variable names used in xm8modChecker.sqf -///////////////////////////////////////////////////////////////////////////////////////////// - -#include "..\..\..\..\addons\modChecker\modCheckerDisplayConfig.hpp" - -///////////////////////////////////////////////////////////////////////////////////////////////////// -// END OF CUSTOMIZABLE TEXT, DO NOT TOUCH UNDER THIS LINE IF YOU DON'T KWOW WHAT ARE YOU DOING -//////////////////////////////////////////////////////////////////////////////////////////////////// +#include "..\..\..\..\addons\modChecker\modCheckerDisplay.hpp" _display = uiNameSpace getVariable ["RscExileXM8", displayNull]; if(isNull _display)exitWith{ diff --git a/ExAdClient/XM8/Apps/modchecker/xm8modChecker.sqf b/ExAdClient/XM8/Apps/modchecker/xm8modChecker.sqf index a6697cd..767c120 100644 --- a/ExAdClient/XM8/Apps/modchecker/xm8modChecker.sqf +++ b/ExAdClient/XM8/Apps/modchecker/xm8modChecker.sqf @@ -1,11 +1,17 @@ - -errorLevel = 0; // Do not touch. Set errors to 0 before run modChecker.sqf - -#include "..\..\..\..\addons\modChecker\modCheckerConfig.hpp" +// ********************************************************************************************************** +// * 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\modChecker.hpp" if (errorLevel > 0) then { warnMessage = "Some is WRONG with your MODS
"; // General error message diff --git a/addons/modChecker/modCheckerDisplay.sqf b/addons/modChecker/init/modCheckerDisplay.sqf similarity index 82% rename from addons/modChecker/modCheckerDisplay.sqf rename to addons/modChecker/init/modCheckerDisplay.sqf index 0b65ba2..e1616b3 100644 --- a/addons/modChecker/modCheckerDisplay.sqf +++ b/addons/modChecker/init/modCheckerDisplay.sqf @@ -14,6 +14,10 @@ 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; @@ -35,16 +39,7 @@ _buttonSpoiler = _display displayctrl 2400; _textSpoiler = _display displayctrl 1101; _text2 = _display displayCtrl 1102; -///////////////////////////////////////////////////////////////////////////////////////////// -// CUSTOMIZABLE PART HERE -// Remember to add-delete-modify the same mod variable names used in modChecker.sqf -///////////////////////////////////////////////////////////////////////////////////////////// - -#include "modCheckerDisplayConfig.hpp" - -///////////////////////////////////////////////////////////////////////////////////////////////////// -// END OF CUSTOMIZABLE TEXT, DO NOT TOUCH UNDER THIS LINE IF YOU DON'T KWOW WHAT ARE YOU DOING -//////////////////////////////////////////////////////////////////////////////////////////////////// +#include "..\modCheckerDisplay.hpp" //Fill only the first text _text1 ctrlSetStructuredText (parseText _message); diff --git a/addons/modChecker/modChecker.sqf b/addons/modChecker/init/modCheckerInit.sqf similarity index 91% rename from addons/modChecker/modChecker.sqf rename to addons/modChecker/init/modCheckerInit.sqf index 0854323..7495b49 100644 --- a/addons/modChecker/modChecker.sqf +++ b/addons/modChecker/init/modCheckerInit.sqf @@ -8,14 +8,13 @@ // 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 "modCheckerConfig.hpp" - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// DO NOT TOUCH UNDER THIS LINE IF DON'T KNOW WHAT ARE YOU DOING -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#include "..\modChecker.hpp" if (errorLevel > 0) then { warnMessage = "Some is WRONG with your MODS
"; @@ -26,7 +25,7 @@ if (errorLevel > 0) then { if ((errorLevel == 0) && (firstCheck == 0)) then { firstCheck = 1 // Do nothing } else { - execVM "addons\modChecker\modCheckerDisplay.sqf" + execVM "addons\modChecker\init\modCheckerDisplay.sqf" }; // execVM "addons\modChecker\modCheckerDisplay.sqf" diff --git a/addons/modChecker/modCheckerConfig.hpp b/addons/modChecker/modChecker.hpp similarity index 65% rename from addons/modChecker/modCheckerConfig.hpp rename to addons/modChecker/modChecker.hpp index d50a264..755b759 100644 --- a/addons/modChecker/modCheckerConfig.hpp +++ b/addons/modChecker/modChecker.hpp @@ -1,8 +1,21 @@ -// Exile_Client Example -// Change "Exile_Client" to name of the Cfg patche from desired mod +// ********************************************************************************************************** +// * 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. + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// 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 checkExile to your desired mod variable name -// Change "Exile Mod is" to your mod string +// Change checkExile 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. checkExile = "Exile Mod is found!
"; } else { // Change "Exile Mod is" to your mod string @@ -11,6 +24,10 @@ if (isClass(configFile >> "CfgPatches" >> "Exile_Client")) then { errorLevel = errorLevel + 99 }; +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// START OF MODS CONFIG - EDIT OR DELETE UNDER THIS LINE +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Esseker Example - DELETE OR MODIFY if (isClass(configFile >> "CfgPatches" >> "Esseker")) then { checkEsseker = "Esseker Map is found!
"; @@ -66,4 +83,17 @@ if (isClass(configFile >> "CfgPatches" >> "CBA_main")) then } else { checkCBA = "CBA_A3 is NOT FOUND!
"; errorLevel = errorLevel + 1 - }; \ No newline at end of file + }; + + +// YOU CAN ADD MORE MODS, ADD FOR EACH SOME CODE LIKE THIS + +/* +if (isClass(configFile >> "CfgPatches" >> "YOUR_MOD_CLASSNAME")) then + { + checkYOURMOD = "YOUR MOD is found!
"; + } else { + checkYOURMOD = "YOUR MOD is NOT FOUND!
"; + errorLevel = errorLevel + 1 + }; +*/ diff --git a/addons/modChecker/modChecker.paa b/addons/modChecker/modChecker.paa deleted file mode 100644 index 544a39dadd7388793388c98429f560de883d9fc4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 22016 zcmeG^3sh7`mi1^_z|cTeJE+|ZprB~NL{{h-1Ii;aB1EI@Ot&x!;g{ei;j{i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wqlSQ`^`mTdl8*!((5FEKT) zdG;u*QGp~Zhuar6!-wK&3xqkq*G695tpDg0J)PFn8m}`1I+yx~&24$v3U^Hih(mTW z2!l9Q{~Ij(aM^=l3@rQB&hC7!D$$VrCgqQKYA3FSLU2@SbreuLptm$c#S#=je|JSHfRl-S{@No|z{>1kY(Mvl??n|u)l z{gYq~UA6;0(netLKMM81_8KoW(LcaWO8}?P;DN8azqCGX*&de9zLXV@xz z6k%Kplyf>!pY-;!fTp$Sa(%Qv5XUpDeH*|apU;#qm}jLD26akd@OG%b|Jdrs0x%WG zkuiZd%$wlQPu)0}ElJ=wgfW|On8FjD1=yha8-=xM{x>M5!c`7En3);Qc&vPno8J2V zEKs|%<8V0}UlE380F&S2do8OO$@^h2$JG74-3GqcxAFOL;BkWhP=OA$_hq4R%Y-@R`yN45@+8w+_e-`vucNRmlmC^mb-j0)rV^HJrI3wC9~ Mq#|A+5C{GL0X6Rws{jB1 diff --git a/addons/modChecker/modCheckerDisplayConfig.hpp b/addons/modChecker/modCheckerDisplay.hpp similarity index 50% rename from addons/modChecker/modCheckerDisplayConfig.hpp rename to addons/modChecker/modCheckerDisplay.hpp index 41c4845..364758b 100644 --- a/addons/modChecker/modCheckerDisplayConfig.hpp +++ b/addons/modChecker/modCheckerDisplay.hpp @@ -1,3 +1,17 @@ +// ********************************************************************************************************** +// * 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) and Repentz +// @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. + +///////////////////////////////////////////////////////////////////////////////////////////// +// CUSTOMIZABLE PART HERE +// Remember to add-delete-modify the same mod variable names used in modCheckerConfig.hpp +///////////////////////////////////////////////////////////////////////////////////////////// + // Display header _message = ""; _message = _message + "
"; @@ -20,4 +34,4 @@ _message = _message + checkCBA; _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 + "Guía de lanzamiento e instalación de mods [ESPAÑOL]

"; \ No newline at end of file +_message = _message + "Guía de lanzamiento e instalación de mods [ESPAÑOL]

"; \ No newline at end of file diff --git a/initPlayerLocal.sqf b/initPlayerLocal.sqf index 7e0659c..ea3f783 100644 --- a/initPlayerLocal.sqf +++ b/initPlayerLocal.sqf @@ -8,7 +8,7 @@ waitUntil {!isNull findDisplay 46 && !isNil 'ExileClientLoadedIn' && getPlayerUI uiSleep 3; firstCheck = 0; -execVM "addons\modChecker\modChecker.sqf"; +execVM "addons\modChecker\init\modCheckerInit.sqf"; /*Note, if you have Exile ProtectionRemember.sqf, use this