Add warning for duplicate setting modules.

This commit is contained in:
PabstMirror 2015-10-18 23:34:11 -05:00
parent 16180686d2
commit 64de91ed06
24 changed files with 43 additions and 11 deletions

View File

@ -176,6 +176,7 @@ class CfgVehicles {
scope = 2;
icon = QUOTE(PATHTOF(UI\Icon_Module_settings_ca.paa));
isGlobal = 1;
isSingular = 1;
class Arguments {
class allowHandcuffOwnSide {
displayName = CSTRING(ModuleSettings_handcuffSide_name);

View File

@ -8,6 +8,7 @@ class CfgVehicles {
function = QFUNC(moduleSettings);
functionPriority = 1;
isGlobal = 1;
isSingular = 1;
isTriggerActivated = 0;
author = ECSTRING(common,ACETeam);

View File

@ -35,6 +35,7 @@ class CfgVehicles {
function = QFUNC(moduleCheckPBOs);
scope = 2;
isGlobal = 1;
isSingular = 1;
icon = QUOTE(PATHTOF(UI\Icon_Module_CheckPBO_ca.paa));
class Arguments {
class Action {

View File

@ -25,7 +25,9 @@ params ["_name", "_value", ["_force", false], ["_broadcastChanges", false]];
local _settingData = [_name] call FUNC(getSettingData);
// Exit if the setting does not exist
if (_settingData isEqualTo []) exitWith {};
if (_settingData isEqualTo []) exitWith {
ACE_LOGERROR_1("SetSetting [%1] setting does not exist", _name);
};
_settingData params ["", "_typeName", "_isClientSetable", "", "", "", "_isForced"];

View File

@ -6,6 +6,7 @@ class ACE_ModuleExplosive: ACE_Module {
function = QUOTE(FUNC(module));
scope = 2;
isGlobal = 1;
isSingular = 1;
icon = PATHTOF(UI\Icon_Module_Explosives_ca.paa);
class Arguments {
class RequireSpecialist {

View File

@ -7,6 +7,7 @@ class CfgVehicles {
icon = QUOTE(PATHTOF(UI\Icon_Module_finger_ca.paa));
function = QFUNC(moduleSettings);
isGlobal = 0;
isSingular = 1;
author = ECSTRING(common,ACETeam);
class Arguments {
class enabled {

View File

@ -101,6 +101,7 @@ class CfgVehicles {
function = QFUNC(moduleHearing);
scope = 2;
isGlobal = 1;
isSingular = 1;
icon = PATHTOF(UI\Icon_Module_Hearing_ca.paa);
class Arguments {
class EnableCombatDeafness {

View File

@ -8,6 +8,7 @@ class CfgVehicles {
function = "ACE_Interaction_fnc_moduleInteraction";
scope = 2;
isGlobal = 1;
isSingular = 1;
icon = PATHTOF(UI\Icon_Module_Interaction_ca.paa);
class Arguments {

View File

@ -23,6 +23,7 @@ class CfgVehicles {
function = QFUNC(moduleMap);
scope = 2;
isGlobal = 1;
isSingular = 1;
icon = PATHTOF(UI\Icon_Module_Map_ca.paa);
class Arguments {
class MapIllumination {
@ -82,6 +83,7 @@ class CfgVehicles {
function = QFUNC(blueForceTrackingModule);
scope = 2;
isGlobal = 0;
isSingular = 1;
icon = PATHTOF(UI\Icon_Module_BFTracking_ca.paa);
class Arguments {
class Enabled {

View File

@ -6,6 +6,7 @@ class CfgVehicles {
displayName = CSTRING(moduleSettings_displayName);
function = QFUNC(moduleSettings);
isGlobal = 0;
isSingular = 1;
author = ECSTRING(common,ACETeam);
icon = PATHTOF(ui\icon_module_map_gestures_ca.paa);
class Arguments {

View File

@ -17,6 +17,7 @@ class CfgVehicles {
function = QUOTE(DFUNC(moduleMedicalSettings));
functionPriority = 1;
isGlobal = 1;
isSingular = 1;
isTriggerActivated = 0;
author = ECSTRING(common,ACETeam);
@ -153,6 +154,7 @@ class CfgVehicles {
function = QUOTE(FUNC(moduleAdvancedMedicalSettings));
functionPriority = 10;
isGlobal = 2;
isSingular = 1;
isTriggerActivated = 0;
isDisposable = 0;
author = ECSTRING(common,ACETeam);
@ -274,6 +276,7 @@ class CfgVehicles {
function = QUOTE(DFUNC(moduleReviveSettings));
functionPriority = 1;
isGlobal = 1;
isSingular = 1;
isTriggerActivated = 0;
author = ECSTRING(common,ACETeam);

View File

@ -10,6 +10,7 @@ class CfgVehicles {
function = QUOTE(DFUNC(module));
functionPriority = 1;
isGlobal = 0;
isSingular = 1;
isTriggerActivated = 0;
author = ECSTRING(common,ACETeam);
class Arguments {

View File

@ -38,6 +38,7 @@ class CfgVehicles {
function = QFUNC(moduleMapFill);
scope = 2;
isGlobal = 0;
isSingular = 1;
icon = QUOTE(PATHTOF(UI\Icon_Module_microDAGR_ca.paa));
functionPriority = 0;
class Arguments {

View File

@ -52,6 +52,7 @@ class CfgVehicles {
function = QFUNC(moduleInit);
scope = 2;
isGlobal = 0;
isSingular = 1;
icon = QUOTE(PATHTOF(UI\Icon_Module_mk6_ca.paa));
functionPriority = 0;
class Arguments {

View File

@ -4,27 +4,32 @@
["InitSettingsFromModules", {
// TODO This is a basic and limited implementation that mimics some of the functionality from the A3 module framework, but not all of it.
// We have to execute this in the postInit XEH because on object init, the parameters of the modules are not yet available. They are if we execute it at the start of postInit execution.
local _uniqueModulesHandled = [];
{
[_x] call {
private ["_logic", "_logicType", "_config", "_isGlobal", "_isDisposable", "_isPersistent","_function"];
_logic = _this select 0;
_logicType = typeof _logic;
params ["_logic"];
local _logicType = typeof _logic;
_logic hideobject true;
if (_logic getvariable [QGVAR(initalized), false]) exitwith {};
_config = (configFile >> "CfgVehicles" >> _logicType);
local _config = (configFile >> "CfgVehicles" >> _logicType);
if !(isClass _config) exitwith {};
// isGlobal = 1;
_isGlobal = getNumber (_config >> "isGlobal") > 0;
_isDisposable = getNumber (_config >> "isDisposable") > 0;
_isPersistent = getNumber (_config >> "isPersistent") > 0 || getnumber (_config >> "isGlobal") > 1;
_function = getText (_config >> "function");
local _isGlobal = getNumber (_config >> "isGlobal") > 0;
local _isDisposable = getNumber (_config >> "isDisposable") > 0;
local _isPersistent = getNumber (_config >> "isPersistent") > 0 || getnumber (_config >> "isGlobal") > 1;
local _isSingular = getNumber (_config >> "isSingular") > 0;
local _function = getText (_config >> "function");
if (isnil _function) then {
_function = compile _function;
} else {
_function = missionNamespace getvariable _function;
};
if (_isSingular && {_logicType in _uniqueModulesHandled}) then { //ToDo: should this be an exit?
ACE_LOGWARNING_1("Module [%1] - More than 1 singular module placed", _logicType);
};
if (_isSingular) then {_uniqueModulesHandled pushBack _logicType;};
if (_isGlobal || isServer) then {
[_logic, (synchronizedObjects _logic), true] call _function;
@ -38,7 +43,7 @@
deleteVehicle _logic;
};
};
}foreach GVAR(moduleInitCollection);
} forEach GVAR(moduleInitCollection);
if (isServer) then {
GVAR(serverModulesRead) = true;

View File

@ -7,6 +7,7 @@ class CfgVehicles {
function = QFUNC(moduleNameTags);
scope = 2;
isGlobal = 1;
isSingular = 1;
icon = QUOTE(PATHTOF(UI\Icon_Module_NameTags_ca.paa));
class Arguments {
class showPlayerNames {

View File

@ -8,6 +8,7 @@ class CfgVehicles {
function = QUOTE(DFUNC(moduleAllowConfigExport));
functionPriority = 1;
isGlobal = 1;
isSingular = 1;
isTriggerActivated = 0;
author = ECSTRING(common,ACETeam);
class Arguments {

View File

@ -25,6 +25,7 @@ class CfgVehicles {
function = QFUNC(moduleRepairSettings);
functionPriority = 1;
isGlobal = 1;
isSingular = 1;
isTriggerActivated = 0;
author = ECSTRING(Common,ACETeam);
class Arguments {

View File

@ -7,6 +7,7 @@ class CfgVehicles {
function = QFUNC(moduleInit);
scope = 2;
isGlobal = 1;
isSingular = 1;
icon = QUOTE(PATHTOF(UI\Icon_Module_Sitting_ca.paa));
class Arguments {
class enable {

View File

@ -74,6 +74,7 @@ class CfgVehicles {
function = QFUNC(moduleInit);
scope = 2;
isGlobal = 0;
isSingular = 1;
icon = QUOTE(PATHTOF(UI\Icon_Module_VehicleLock_ca.paa));
functionPriority = 0;
class Arguments {

View File

@ -7,6 +7,7 @@ class CfgVehicles {
displayName = CSTRING(Module_DisplayName);
scope = 2;
isGlobal = 1;
isSingular = 1;
//icon = ""; // needs an icon
class Arguments {
class moduleViewDistanceEnabled {

View File

@ -8,6 +8,7 @@ class CfgVehicles {
function = QUOTE(DFUNC(initModuleSettings));
functionPriority = 1;
isGlobal = 1;
isSingular = 1;
isTriggerActivated = 0;
author = ECSTRING(common,ACETeam);
class Arguments {

View File

@ -8,6 +8,7 @@ class CfgVehicles {
function = QUOTE(DFUNC(initModuleSettings));
functionPriority = 1;
isGlobal = 1;
isSingular = 1;
isTriggerActivated = 0;
author = ECSTRING(common,ACETeam);
class Arguments {

View File

@ -23,6 +23,7 @@ class CfgVehicles {
function = QFUNC(moduleZeusSettings);
functionPriority = 1;
isGlobal = 1;
isSingular = 1;
isTriggerActivated = 0;
author = "SilentSpike";
class Arguments {