Common - Make FUNC(isModLoaded) case-insensitive (#9704)

* Update fnc_isModLoaded.sqf

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

* Update fnc_isModLoaded.sqf

---------

Co-authored-by: LinkIsGrim <salluci.lovi@gmail.com>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
This commit is contained in:
johnb432 2024-01-01 02:45:01 +01:00 committed by GitHub
parent f063c4404a
commit 8ca5263f18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 21 additions and 28 deletions

View File

@ -60,7 +60,7 @@ if (!hasInterface) exitWith {};
}, true] call CBA_fnc_addPlayerEventHandler;
// - Duty factors -------------------------------------------------------------
if (["ACE_Medical"] call EFUNC(common,isModLoaded)) then {
if (["ace_medical"] call EFUNC(common,isModLoaded)) then {
[QEGVAR(medical,pain), { // 0->1.0, 0.5->1.05, 1->1.1
linearConversion [0, 1, (_this getVariable [QEGVAR(medical,pain), 0]), 1, 1.1, true];
}] call FUNC(addDutyFactor);
@ -68,7 +68,7 @@ if (!hasInterface) exitWith {};
linearConversion [6, 0, (_this getVariable [QEGVAR(medical,bloodVolume), 6]), 1, 2, true];
}] call FUNC(addDutyFactor);
};
if (["ACE_Dragging"] call EFUNC(common,isModLoaded)) then {
if (["ace_dragging"] call EFUNC(common,isModLoaded)) then {
[QEGVAR(dragging,isCarrying), {
[1, 3] select (_this getVariable [QEGVAR(dragging,isCarrying), false]);
}] call FUNC(addDutyFactor);

View File

@ -4,24 +4,17 @@
* Check in CfgPatches if modification is loaded
*
* Arguments:
* 0: Mod Name or Classname of the mod in CfgPatches <STRING>
* 0: Classname of the mod in CfgPatches <STRING>
*
* Return Value:
* if modification is loaded <BOOL>
* If modification is loaded <BOOL>
*
* Example:
* ["class"] call ace_common_fnc_isModLoaded
* "class" call ace_common_fnc_isModLoaded
*
* Public: Yes
*/
params [["_modName", "", [""]]];
private _return = GVAR(isModLoadedCache) get _modName;
if (isNil "_return") then {
_return = isClass (configFile >> "CfgPatches" >> _modName);
GVAR(isModLoadedCache) set [_modName, _return];
};
_return
GVAR(isModLoadedCache) getOrDefaultCall [toLowerANSI _modName, {isClass (configFile >> "CfgPatches" >> _modName)}, true]

View File

@ -15,7 +15,7 @@
* Public: No
*/
params ["_trap"];
if (!(["ACE_Medical"] call EFUNC(common,isModLoaded))) exitWith {};
if (!(["ace_medical"] call EFUNC(common,isModLoaded))) exitWith {};
private _radius = getNumber (configOf _trap >> "indirectHitRange");
private _affectedUnits = _trap nearEntities ["CAManBase", _radius];

View File

@ -53,7 +53,7 @@
[_player, "PutDown"] call EFUNC(common,doGesture);
// drag after deploying
if ((missionNamespace getVariable [QGVAR(dragAfterDeploy), false]) && {["ACE_dragging"] call EFUNC(common,isModLoaded)}) then {
if ((missionNamespace getVariable [QGVAR(dragAfterDeploy), false]) && {["ace_dragging"] call EFUNC(common,isModLoaded)}) then {
if ([_player, _cswTripod] call EFUNC(dragging,canCarry)) then {
TRACE_1("starting carry",_cswTripod);
[_player, _cswTripod] call EFUNC(dragging,startCarry);

View File

@ -89,7 +89,7 @@ if (hasInterface && {!(_typeOf in GVAR(initializedStaticTypes))}) then {
_ammoActionPath = [_typeOf, 0, ["ACE_MainActions"], _ammoAction] call EFUNC(interact_menu,addActionToClass);
};
if (["ACE_reload"] call EFUNC(common,isModLoaded)) then {
if (["ace_reload"] call EFUNC(common,isModLoaded)) then {
// move reload's check ammo action to the ammo handling point (remove and re-add)
[_typeOf, 0, ["ACE_MainActions", QEGVAR(reload,CheckAmmo)]] call EFUNC(interact_menu,removeActionFromClass);
private _checkAmmoAction = [QGVAR(checkAmmo), localize ELSTRING(reload,checkAmmo), "", EFUNC(reload,checkAmmo), EFUNC(reload,canCheckAmmo)] call EFUNC(interact_menu,createAction);

View File

@ -7,7 +7,7 @@
// Add actions and event handlers only if ace_medical is loaded
// - Adding actions via config would create a dependency
if (["ACE_Medical"] call EFUNC(common,isModLoaded)) then {
if (["ace_medical"] call EFUNC(common,isModLoaded)) then {
if (hasInterface) then {
private _checkTagAction = [
"ACE_CheckDogtag",
@ -47,7 +47,7 @@ if (["ACE_Medical"] call EFUNC(common,isModLoaded)) then {
};
// If the arsenal is loaded, show the custom names for dog tags when in the arsenal
if (["ACE_Arsenal"] call EFUNC(common,isModLoaded)) then {
if (["ace_arsenal"] call EFUNC(common,isModLoaded)) then {
[QEGVAR(arsenal,rightPanelFilled), {
params ["_display", "_leftPanelIDC", "_rightPanelIDC"];

View File

@ -71,7 +71,7 @@ private _suitCoef = if ((uniform ACE_player) != "") then {
private _gBlackOut = MAXVIRTUALG / _classCoef + MAXVIRTUALG / _suitCoef - MAXVIRTUALG;
// Unconsciousness
if ((_average > _gBlackOut) && {["ACE_Medical"] call EFUNC(common,isModLoaded) && {!(ACE_player getVariable ["ACE_isUnconscious", false])}}) then {
if ((_average > _gBlackOut) && {["ace_medical"] call EFUNC(common,isModLoaded) && {!(ACE_player getVariable ["ACE_isUnconscious", false])}}) then {
[ACE_player, true, (10 + floor(random 5)), true] call EFUNC(medical,setUnconscious);
};

View File

@ -110,14 +110,14 @@ if (hasInterface && {!isNull ACE_player} && {alive ACE_player}) then {
_strength = _strength * _losCoefficient;
// Add ace_hearing ear ringing sound effect
if (["ACE_Hearing"] call EFUNC(common,isModLoaded) && {_strength > 0 && {EGVAR(hearing,damageCoefficent) > 0.25}}) then {
if (["ace_hearing"] call EFUNC(common,isModLoaded) && {_strength > 0 && {EGVAR(hearing,damageCoefficent) > 0.25}}) then {
private _earringingStrength = 40 * _strength;
[_earringingStrength] call EFUNC(hearing,earRinging);
TRACE_1("Earringing Strength",_earringingStrength);
};
// add ace_medical pain effect:
if (["ACE_Medical"] call EFUNC(common,isModLoaded) && {_strength > 0.1}) then {
if (["ace_medical"] call EFUNC(common,isModLoaded) && {_strength > 0.1}) then {
[ACE_player, _strength / 2] call EFUNC(medical,adjustPainLevel);
};

View File

@ -19,7 +19,7 @@
if ((getText (missionconfigfile >> "CfgDebriefingSections" >> QUOTE(XADDON) >> "variable")) != QXGVAR(outputText)) exitWith {
TRACE_1("no mission debriefing config",_this);
};
if (!(["ACE_Medical"] call EFUNC(common,isModLoaded))) exitWith {
if (!(["ace_medical"] call EFUNC(common,isModLoaded))) exitWith {
WARNING("No ACE-Medical");
XGVAR(outputText) = "No ACE-Medical";
};

View File

@ -53,7 +53,7 @@ if (_distance < _backblastRange) then {
[_damage * 100] call BIS_fnc_bloodEffect;
if (["ACE_Medical"] call EFUNC(common,isModLoaded)) then {
if (["ace_medical"] call EFUNC(common,isModLoaded)) then {
[_unit, _damage, "body", "backblast", _unit] call EFUNC(medical,addDamageToUnit);
} else {
_unit setDamage (damage _unit + _damage);

View File

@ -57,7 +57,7 @@ TRACE_3("cache",_overpressureAngle,_overpressureRange,_overpressureDamage);
[_damage * 100] call BIS_fnc_bloodEffect;
};
if (["ACE_Medical"] call EFUNC(common,isModLoaded)) then {
if (["ace_medical"] call EFUNC(common,isModLoaded)) then {
[_x, _damage, "body", "backblast", _firer] call EFUNC(medical,addDamageToUnit);
} else {
_x setDamage (damage _x + _damage);

View File

@ -33,7 +33,7 @@ if (_activated && local _logic) then {
};
if (_error == "") then {
if (["ACE_Arsenal"] call EFUNC(common,isModLoaded)) then {
if (["ace_arsenal"] call EFUNC(common,isModLoaded)) then {
if (!isPlayer _unit || {player == _unit}) then {
[{

View File

@ -21,7 +21,7 @@ params ["_logic"];
if !(local _logic) exitWith {};
if !(["ACE_Medical"] call EFUNC(common,isModLoaded)) then {
if !(["ace_medical"] call EFUNC(common,isModLoaded)) then {
[LSTRING(RequiresAddon)] call FUNC(showMessage);
} else {
private _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]);

View File

@ -21,7 +21,7 @@ params ["_logic"];
if !(local _logic) exitWith {};
if !(["ACE_Medical"] call EFUNC(common,isModLoaded)) then {
if !(["ace_medical"] call EFUNC(common,isModLoaded)) then {
[LSTRING(RequiresAddon)] call FUNC(showMessage);
} else {
private _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]);

View File

@ -21,7 +21,7 @@ params ["_logic"];
if !(local _logic) exitWith {};
if !(["ACE_Medical"] call EFUNC(common,isModLoaded)) then {
if !(["ace_medical"] call EFUNC(common,isModLoaded)) then {
[LSTRING(RequiresAddon)] call FUNC(showMessage);
} else {
private _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]);