Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Jan 1, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions addons/advanced_fatigue/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ 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);
[QEGVAR(medical,bloodVolume), { // 6->1.0, 5->1.167, 4->1.33
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);
Expand Down
11 changes: 6 additions & 5 deletions addons/common/functions/fnc_isModLoaded.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,25 @@
* 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;
private _key = toLowerANSI _modName;
private _return = GVAR(isModLoadedCache) get _key;
johnb432 marked this conversation as resolved.
Show resolved Hide resolved

if (isNil "_return") then {
_return = isClass (configFile >> "CfgPatches" >> _modName);
GVAR(isModLoadedCache) set [_modName, _return];
GVAR(isModLoadedCache) set [_key, _return];
};

_return
2 changes: 1 addition & 1 deletion addons/compat_sog/functions/fnc_handlePunjiTrapTrigger.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion addons/csw/functions/fnc_assemble_deployTripod.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion addons/csw/functions/fnc_staticWeaponInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions addons/dogtags/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"];

Expand Down
2 changes: 1 addition & 1 deletion addons/gforces/functions/fnc_pfhUpdateGForces.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand Down
4 changes: 2 additions & 2 deletions addons/grenades/functions/fnc_flashbangExplosionEH.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand Down
2 changes: 1 addition & 1 deletion addons/killtracker/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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";
};
Expand Down
2 changes: 1 addition & 1 deletion addons/overpressure/functions/fnc_firedEHBB.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion addons/overpressure/functions/fnc_overpressureDamage.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion addons/zeus/functions/fnc_bi_moduleArsenal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

[{
Expand Down
2 changes: 1 addition & 1 deletion addons/zeus/functions/fnc_moduleSetMedic.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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,[""]);
Expand Down
2 changes: 1 addition & 1 deletion addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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,[""]);
Expand Down
2 changes: 1 addition & 1 deletion addons/zeus/functions/fnc_moduleSetMedicalVehicle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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,[""]);
Expand Down