diff --git a/addons/advanced_ballistics/config.cpp b/addons/advanced_ballistics/config.cpp index 32f1406a07..1a2187783b 100644 --- a/addons/advanced_ballistics/config.cpp +++ b/addons/advanced_ballistics/config.cpp @@ -15,4 +15,8 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" #include "RscTitles.hpp" -#include "ACE_Settings.hpp" \ No newline at end of file +#include "ACE_Settings.hpp" + +class ACE_Extensions { + extensions[] += {"ace_advanced_ballistics"}; +}; diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 2599e12a6d..3a16ac9d43 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -248,5 +248,13 @@ if(isMultiplayer && { time > 0 || isNull player } ) then { }, 0, []] call cba_fnc_addPerFrameHandler; }; +// check dlls +{ + if (_x callExtension "version" == "") then { + private "_errorMsg"; + _errorMsg = format ["Extension %1.dll not installed.", _x]; - + diag_log text format ["[ACE] ERROR: %1", _errorMsg]; + ["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); + }; +} forEach getArray (configFile >> "ACE_Extensions" >> "extensions"); diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index aebc13df95..54a5118cb0 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -42,6 +42,7 @@ PREP(doAnimation); PREP(dropBackpack); PREP(endRadioTransmission); PREP(eraseCache); +PREP(errorMessage); PREP(execNextFrame); PREP(execPersistentFnc); PREP(execRemoteFnc); diff --git a/addons/common/config.cpp b/addons/common/config.cpp index 769ba37de1..16bd13fc0c 100644 --- a/addons/common/config.cpp +++ b/addons/common/config.cpp @@ -152,3 +152,15 @@ class CfgUIGrids { }; }; }; + +/* +// check dll +class RscStandardDisplay; +class RscDisplayMain: RscStandardDisplay { + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDisplayMain"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); [ARR_5('header','tail',{0},{},_this select 0)] call COMPILE_FILE(functions\fnc_errorMessage)); +}; +*/ + +class ACE_Extensions { + extensions[] = {}; +}; diff --git a/addons/common/functions/fnc_errorMessage.sqf b/addons/common/functions/fnc_errorMessage.sqf new file mode 100644 index 0000000000..e061772942 --- /dev/null +++ b/addons/common/functions/fnc_errorMessage.sqf @@ -0,0 +1,144 @@ +/* + * Author: commy2, based on BIS_fnc_errorMsg and BIS_fnc_guiMessage by Karel Moricky (BI) + * Stops simulation and opens a textbox with error message. + * + * Arguments: + * ? + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +disableSerialization; +endLoadingScreen; + +private ["_textHeader", "_textMessage", "_onOK", "_onCancel"]; + +_textHeader = _this select 0; +_textMessage = _this select 1; +_onOK = ARR_SELECT(_this,2,{}); +_onCancel = ARR_SELECT(_this,3,{}); + +if (typeName _textMessage == "STRING") then { + _textMessage = parseText _textMessage; +}; + +(ARR_SELECT(_this,4,call BIS_fnc_displayMission)) createDisplay "RscDisplayCommonMessagePause"; + +private ["_display", "_ctrlRscMessageBox", "_ctrlBcgCommonTop", "_ctrlBcgCommon", "_ctrlText", "_ctrlBackgroundButtonOK", "_ctrlBackgroundButtonMiddle", "_ctrlBackgroundButtonCancel", "_ctrlButtonOK", "_ctrlButtonCancel"]; + +_display = uiNamespace getVariable "RscDisplayCommonMessage_display"; +_ctrlRscMessageBox = _display displayCtrl 2351; +_ctrlBcgCommonTop = _display displayCtrl 235100; +_ctrlBcgCommon = _display displayCtrl 235101; +_ctrlText = _display displayCtrl 235102; +_ctrlBackgroundButtonOK = _display displayCtrl 235103; +_ctrlBackgroundButtonMiddle = _display displayCtrl 235104; +_ctrlBackgroundButtonCancel = _display displayCtrl 235105; +_ctrlButtonOK = _display displayCtrl 235106; +_ctrlButtonCancel = _display displayCtrl 235107; + +_ctrlBcgCommonTop ctrlSetText _textHeader; + +private ["_ctrlButtonOKPos", "_ctrlBcgCommonPos", "_bottomSpaceY", "_ctrlTextPos", "_marginX", "_marginY"]; + +_ctrlButtonOKPos = ctrlPosition _ctrlButtonOK; +_ctrlBcgCommonPos = ctrlPosition _ctrlBcgCommon; +_bottomSpaceY = (_ctrlButtonOKPos select 1) - ((_ctrlBcgCommonPos select 1) + (_ctrlBcgCommonPos select 3)); + +_ctrlTextPos = ctrlPosition _ctrlText; +_marginX = (_ctrlTextPos select 0) - (_ctrlBcgCommonPos select 0); +_marginY = (_ctrlTextPos select 1) - (_ctrlBcgCommonPos select 1); + +private ["_ctrlTextPosH", "_bottomPosY"]; + +_ctrlText ctrlSetStructuredText _textMessage; +_ctrlTextPosH = ctrlTextHeight _ctrlText; + +_ctrlBcgCommon ctrlSetPosition [ + _ctrlBcgCommonPos select 0, + _ctrlBcgCommonPos select 1, + _ctrlBcgCommonPos select 2, + _ctrlTextPosH + _marginY * 2 +]; +_ctrlBcgCommon ctrlCommit 0; + +_ctrlText ctrlSetPosition [ + (_ctrlBcgCommonPos select 0) + _marginX, + (_ctrlBcgCommonPos select 1) + _marginY, + (_ctrlBcgCommonPos select 2) - _marginX * 2, + _ctrlTextPosH +]; +_ctrlText ctrlCommit 0; + +_bottomPosY = (_ctrlBcgCommonPos select 1) + _ctrlTextPosH + (_marginY * 2) + _bottomSpaceY; + +{ + private "_xPos"; + _xPos = ctrlPosition _x; + + _xPos set [1, _bottomPosY]; + _x ctrlSetPosition _xPos; + _x ctrlCommit 0; +} foreach [ + _ctrlBackgroundButtonOK, + _ctrlBackgroundButtonMiddle, + _ctrlBackgroundButtonCancel, + _ctrlButtonOK, + _ctrlButtonCancel +]; + +private ["_ctrlRscMessageBoxPos", "_ctrlRscMessageBoxPosH"]; + +_ctrlRscMessageBoxPos = ctrlPosition _ctrlRscMessageBox; +_ctrlRscMessageBoxPosH = _bottomPosY + (_ctrlButtonOKPos select 3); + +_ctrlRscMessageBox ctrlSetPosition [ + 0.5 - (_ctrlBcgCommonPos select 2) / 2, + 0.5 - _ctrlRscMessageBoxPosH / 2, + (_ctrlBcgCommonPos select 2) + 0.5, + _ctrlRscMessageBoxPosH +]; + +_ctrlRscMessageBox ctrlEnable true; +_ctrlRscMessageBox ctrlCommit 0; + +if (_onOK isEqualTo {}) then { + _ctrlButtonOK ctrlEnable false; + _ctrlButtonOK ctrlSetFade 0; + _ctrlButtonOK ctrlSetText ""; + _ctrlButtonOK ctrlCommit 0; +} else { + _ctrlButtonOK ctrlEnable true; + _ctrlButtonOK ctrlSetFade 0; + _ctrlButtonOK ctrlSetText localize "STR_DISP_OK"; + _ctrlButtonOK ctrlCommit 0; + + ctrlSetFocus _ctrlButtonOK; +}; + +if (_onCancel isEqualTo {}) then { + _ctrlButtonCancel ctrlEnable false; + _ctrlButtonCancel ctrlSetFade 0; + _ctrlButtonCancel ctrlSetText ""; + _ctrlButtonCancel ctrlCommit 0; +} else { + _ctrlButtonCancel ctrlEnable true; + _ctrlButtonCancel ctrlSetFade 0; + _ctrlButtonCancel ctrlSetText localize "STR_DISP_CANCEL"; + _ctrlButtonCancel ctrlCommit 0; + + ctrlSetFocus _ctrlButtonCancel; +}; + +_ctrlButtonOK ctrlAddEventHandler ["buttonClick", {(ctrlParent (_this select 0)) closeDisplay 1; true}]; +_ctrlButtonCancel ctrlAddEventHandler ["buttonClick", {(ctrlParent (_this select 0)) closeDisplay 2; true}]; + +GVAR(errorOnOK) = _onOK; +GVAR(errorOnCancel) = _onCancel; + +_display displayAddEventHandler ["unload", {call ([{}, GVAR(errorOnOK), GVAR(errorOnCancel)] select (_this select 1))}]; +_display displayAddEventHandler ["keyDown", {_this select 1 == 1}]; diff --git a/addons/common/script_component.hpp b/addons/common/script_component.hpp index 279785f223..7c266c169d 100644 --- a/addons/common/script_component.hpp +++ b/addons/common/script_component.hpp @@ -11,4 +11,4 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_COMMON #endif -#include "\z\ace\addons\main\script_macros.hpp" +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/fcs/config.cpp b/addons/fcs/config.cpp index 711cbbbd25..12edf02ba3 100644 --- a/addons/fcs/config.cpp +++ b/addons/fcs/config.cpp @@ -20,3 +20,7 @@ class CfgPatches { #include "CfgWeapons.hpp" #include "CfgOptics.hpp" + +class ACE_Extensions { + extensions[] += {"ace_fcs"}; +}; diff --git a/addons/interact_menu/config.cpp b/addons/interact_menu/config.cpp index 139ff2db97..81d2dc3f75 100644 --- a/addons/interact_menu/config.cpp +++ b/addons/interact_menu/config.cpp @@ -36,3 +36,7 @@ class ACE_Settings { displayName = "$STR_ACE_Interact_Menu_UseListMenu"; }; }; + +class ACE_Extensions { + extensions[] += {"ace_breakLine"}; +};