mirror of
https://github.com/NRZ7/modChecker---Exile-version.git
synced 2024-08-30 17:32:11 +00:00
First Release
This commit is contained in:
commit
d179f008bf
BIN
addons/modChecker/modChecker.paa
Normal file
BIN
addons/modChecker/modChecker.paa
Normal file
Binary file not shown.
99
addons/modChecker/modChecker.sqf
Normal file
99
addons/modChecker/modChecker.sqf
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
// **********************************************************************************************************
|
||||||
|
// * 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.
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
errorLevel = 0;
|
||||||
|
|
||||||
|
|
||||||
|
// Exile_Client Example
|
||||||
|
// Change "Exile_Client" to name of the Cfg patche from desired mod
|
||||||
|
if (isClass(configFile >> "CfgPatches" >> "Exile_Client")) then {
|
||||||
|
// Change checkExile to your desired mod variable name
|
||||||
|
// Change "Exile Mod is" to your mod string
|
||||||
|
checkExile = "<t size='0.9' shadow='1' shadowColor='#000000' align='center'>Exile Mod is</t><t color='#2fd402' size='0.9' shadow='1' shadowColor='#000000' align='center'> found!</t><br/>";
|
||||||
|
} else {
|
||||||
|
// Change "Exile Mod is" to your mod string
|
||||||
|
checkExile = "<t size='0.9' shadow='1' shadowColor='#000000' align='center'>Exile Mod is</t><t color='#ff0000' size='0.9' shadow='1' shadowColor='#000000' align='center'> NOT FOUND!</t><br/>";
|
||||||
|
// Set 99 to Required, Set 1 to optional
|
||||||
|
errorLevel = errorLevel + 99
|
||||||
|
};
|
||||||
|
|
||||||
|
// Esseker Example
|
||||||
|
if (isClass(configFile >> "CfgPatches" >> "Esseker")) then {
|
||||||
|
checkEsseker = "<t size='0.9' shadow='1' shadowColor='#000000' align='center'>Esseker Map is</t><t color='#2fd402' size='0.9' shadow='1' shadowColor='#000000' align='center'> found!</t><br/>";
|
||||||
|
} else {
|
||||||
|
checkEsseker = "<t size='0.9' shadow='1' shadowColor='#000000' align='center'>Esseker Map is</t><t color='#ff0000' size='0.9' shadow='1' shadowColor='#000000' align='center'> NOT FOUND!</t><br/>";
|
||||||
|
errorLevel = errorLevel + 99
|
||||||
|
};
|
||||||
|
|
||||||
|
// Zombis & Demonds Example
|
||||||
|
if (isClass(configFile >> "CfgPatches" >> "Ryanzombies")) then {
|
||||||
|
checkRyan = "<t size='0.9' shadow='1' shadowColor='#000000' align='center'>Zombies and Demonds is</t><t color='#2fd402' size='0.9' shadow='1' shadowColor='#000000' align='center'> found!</t><br/>";
|
||||||
|
} else {
|
||||||
|
checkRyan = "<t size='0.9' shadow='1' shadowColor='#000000' align='center'>Zombies and Demonds is</t><t color='#ff0000' size='0.9' shadow='1' shadowColor='#000000' align='center'> NOT FOUND!</t><br/>";
|
||||||
|
errorLevel = errorLevel + 99
|
||||||
|
};
|
||||||
|
|
||||||
|
// CUP_Weapons Example
|
||||||
|
if (isClass(configFile >> "CfgPatches" >> "CUP_Weapons_WeaponsCore")) then {
|
||||||
|
checkWeapons = "<t size='0.9' shadow='1' shadowColor='#000000' align='center'>CUP Weapons is</t><t color='#2fd402' size='0.9' shadow='1' shadowColor='#000000' align='center'> found!</t><br/>";
|
||||||
|
} else {
|
||||||
|
checkWeapons = "<t size='0.9' shadow='1' shadowColor='#000000' align='center'>CUP Weapons is</t><t color='#ff0000' size='0.9' shadow='1' shadowColor='#000000' align='center'> NOT FOUND!</t><br/>";
|
||||||
|
errorLevel = errorLevel + 1
|
||||||
|
};
|
||||||
|
|
||||||
|
// CUP_Vehicles Example
|
||||||
|
if (isClass(configFile >> "CfgPatches" >> "CUP_Vehicles_Core")) then {
|
||||||
|
checkVehicles = "<t size='0.9' shadow='1' shadowColor='#000000' align='center'>CUP Vehicles is</t><t color='#2fd402' size='0.9' shadow='1' shadowColor='#000000' align='center'> found!</t><br/>";
|
||||||
|
} else {
|
||||||
|
checkVehicles = "<t size='0.9' shadow='1' shadowColor='#000000' align='center'>CUP Vehicles is</t><t color='#ff0000' size='0.9' shadow='1' shadowColor='#000000' align='center'> NOT FOUND!</t><br/>";
|
||||||
|
errorLevel = errorLevel + 1
|
||||||
|
};
|
||||||
|
|
||||||
|
// CUP_TerrainCore Example
|
||||||
|
if (isClass(configFile >> "CfgPatches" >> "CUP_Worlds")) then {
|
||||||
|
checkTerrain = "<t size='0.9' shadow='1' shadowColor='#000000' align='center'>CUP Terrain Core is</t><t color='#2fd402' size='0.9' shadow='1' shadowColor='#000000' align='center'> found!</t><br/>";
|
||||||
|
} else {
|
||||||
|
checkTerrain = "<t size='0.9' shadow='1' shadowColor='#000000' align='center'>CUP Terrain Core is</t><t color='#ff0000' size='0.9' shadow='1' shadowColor='#000000' align='center'> NOT FOUND!</t><br/>";
|
||||||
|
errorLevel = errorLevel + 1
|
||||||
|
};
|
||||||
|
|
||||||
|
// CUP_Units Example
|
||||||
|
if (isClass(configFile >> "CfgPatches" >> "CUP_Creatures_People_Core")) then {
|
||||||
|
checkUnits = "<t size='0.9' shadow='1' shadowColor='#000000' align='center'>CUP Units is</t><t color='#2fd402' size='0.9' shadow='1' shadowColor='#000000' align='center'> found!</t><br/>";
|
||||||
|
} else {
|
||||||
|
checkUnits = "<t size='0.9' shadow='1' shadowColor='#000000' align='center'>CUP Units is</t><t color='#ff0000' size='0.9' shadow='1' shadowColor='#000000' align='center'> NOT FOUND!</t><br/>";
|
||||||
|
errorLevel = errorLevel + 1
|
||||||
|
};
|
||||||
|
|
||||||
|
// Community Base Addon Example
|
||||||
|
if (isClass(configFile >> "CfgPatches" >> "CBA_main")) then
|
||||||
|
{
|
||||||
|
checkCBA = "<t size='0.9' shadow='1' shadowColor='#000000' align='center'>CBA_A3 is</t><t color='#2fd402' size='0.9' shadow='1' shadowColor='#000000' align='center'> found!</t><br/>";
|
||||||
|
} else {
|
||||||
|
checkCBA = "<t size='0.9' shadow='1' shadowColor='#000000' align='center'>CBA_A3 is</t><t color='#ff0000' size='0.9' shadow='1' shadowColor='#000000' align='center'> NOT FOUND!</t><br/>";
|
||||||
|
errorLevel = errorLevel + 1
|
||||||
|
};
|
||||||
|
|
||||||
|
if (errorLevel > 0) then {
|
||||||
|
warnMessage = "<t color='#ff0000' size='1.3' shadow='1' shadowColor='#000000' align='center'>Some is WRONG with your MODS</t><br/>";
|
||||||
|
} else {
|
||||||
|
warnMessage = "<t color='#2fd402' size='1.3' shadow='1' shadowColor='#000000' align='center'>All MODS are FINE</t><br/>";
|
||||||
|
};
|
||||||
|
|
||||||
|
if ((errorLevel == 0) && (firstCheck == 0)) then {
|
||||||
|
firstCheck = 1 // Do nothing
|
||||||
|
} else {
|
||||||
|
execVM "addons\modChecker\modCheckerDisplay.sqf"
|
||||||
|
};
|
||||||
|
|
||||||
|
// execVM "addons\modChecker\modCheckerDisplay.sqf"
|
||||||
|
|
||||||
|
|
97
addons/modChecker/modCheckerDisplay.sqf
Normal file
97
addons/modChecker/modCheckerDisplay.sqf
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
// **********************************************************************************************************
|
||||||
|
// * 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/
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ((firstCheck == 0) && (errorLevel > 0)) then { player allowdamage false }; // God Mode ON to avoid die and close dialog only if ModCheckerDisplay is auto opened.
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Remember to add-delete-modify the same mod variable names like modChecker.sqf
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// Display header
|
||||||
|
_message = "";
|
||||||
|
_message = _message + "<t align='center' size='2' shadow='0'></t><br />";
|
||||||
|
_message = _message + "<t align='center' size='2' shadow='0'>Welcome to Mod Checker</t><br />";
|
||||||
|
_message = _message + "<t align='center'>______________________________________________________________________________________<br /><br />";
|
||||||
|
_message = _message + warnMessage;
|
||||||
|
_message = _message + "<t align='center'><br />";
|
||||||
|
|
||||||
|
//Mod variable names
|
||||||
|
_message = _message + checkExile;
|
||||||
|
_message = _message + checkEsseker;
|
||||||
|
_message = _message + checkRyan;
|
||||||
|
_message = _message + checkWeapons;
|
||||||
|
_message = _message + checkVehicles;
|
||||||
|
_message = _message + checkUnits;
|
||||||
|
_message = _message + checkTerrain;
|
||||||
|
_message = _message + checkCBA;
|
||||||
|
|
||||||
|
// Custom message with community links
|
||||||
|
_message = _message + "<br />";
|
||||||
|
_message = _message + "If you get any error, please, read the following links<br /><br />";
|
||||||
|
_message = _message + "Download the mods from <a href= 'http://steamcommunity.com/sharedfiles/filedetails/?id=752130537' color='#ff9900'>Steam Workshop</a> Only click on Subscribe!<br />";
|
||||||
|
_message = _message + "<a href= 'http://standarol.com/index.php/topic,674.0.html' color='#ff9900'>Guía de lanzamiento e instalación de mods [ESPAÑOL]</a> </t><br /><br />";
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// END OF CUSTOMIZABLE TEXT, DO NOT TOUCH UNDER THIS LINE IF YOU DON'T KWOW WHAT ARE YOU WANT
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
//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.
|
||||||
|
};
|
12
config.cpp
Normal file
12
config.cpp
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
class CfgXM8
|
||||||
|
{
|
||||||
|
extraApps[] = {"modChecker"};
|
||||||
|
|
||||||
|
class modChecker
|
||||||
|
{
|
||||||
|
title = "Mod Checker";
|
||||||
|
logo = "addons\modChecker\modChecker.paa";
|
||||||
|
quickFunction = "[] execVM 'addons\modChecker\modChecker.sqf'";
|
||||||
|
|
||||||
|
};
|
||||||
|
};
|
29
initPlayerLocal.sqf
Normal file
29
initPlayerLocal.sqf
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
// Add this at the bottom of initPlayerLocal.sqf
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
// MOD CHECKER
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
waitUntil {!isNull findDisplay 46 && !isNil 'ExileClientLoadedIn' && getPlayerUID player != ''}; // wait until player is in spawned
|
||||||
|
uiSleep 3;
|
||||||
|
|
||||||
|
firstCheck = 0;
|
||||||
|
execVM "addons\modChecker\modChecker.sqf";
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
// MOD CHECKER + PROTECTION REMEMBER
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
/*Note, if you have Exile ProtectionRemember.sqf, use this
|
||||||
|
|
||||||
|
waitUntil {!isNull findDisplay 46 && !isNil 'ExileClientLoadedIn' && getPlayerUID player != ''}; // wait until player is in spawned
|
||||||
|
uiSleep 3;
|
||||||
|
execVM "addons\scripts\protectionRemember.sqf";
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
// MOD CHECKER
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
firstCheck = 0;
|
||||||
|
execVM "addons\modChecker\modChecker.sqf";
|
||||||
|
|
||||||
|
*/
|
Loading…
Reference in New Issue
Block a user