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; scope = 2;
icon = QUOTE(PATHTOF(UI\Icon_Module_settings_ca.paa)); icon = QUOTE(PATHTOF(UI\Icon_Module_settings_ca.paa));
isGlobal = 1; isGlobal = 1;
isSingular = 1;
class Arguments { class Arguments {
class allowHandcuffOwnSide { class allowHandcuffOwnSide {
displayName = CSTRING(ModuleSettings_handcuffSide_name); displayName = CSTRING(ModuleSettings_handcuffSide_name);

View File

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

View File

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

View File

@ -25,7 +25,9 @@ params ["_name", "_value", ["_force", false], ["_broadcastChanges", false]];
local _settingData = [_name] call FUNC(getSettingData); local _settingData = [_name] call FUNC(getSettingData);
// Exit if the setting does not exist // 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"]; _settingData params ["", "_typeName", "_isClientSetable", "", "", "", "_isForced"];

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -4,27 +4,32 @@
["InitSettingsFromModules", { ["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. // 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. // 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 { [_x] call {
private ["_logic", "_logicType", "_config", "_isGlobal", "_isDisposable", "_isPersistent","_function"]; params ["_logic"];
_logic = _this select 0; local _logicType = typeof _logic;
_logicType = typeof _logic;
_logic hideobject true; _logic hideobject true;
if (_logic getvariable [QGVAR(initalized), false]) exitwith {}; if (_logic getvariable [QGVAR(initalized), false]) exitwith {};
_config = (configFile >> "CfgVehicles" >> _logicType); local _config = (configFile >> "CfgVehicles" >> _logicType);
if !(isClass _config) exitwith {}; if !(isClass _config) exitwith {};
// isGlobal = 1; local _isGlobal = getNumber (_config >> "isGlobal") > 0;
_isGlobal = getNumber (_config >> "isGlobal") > 0; local _isDisposable = getNumber (_config >> "isDisposable") > 0;
_isDisposable = getNumber (_config >> "isDisposable") > 0; local _isPersistent = getNumber (_config >> "isPersistent") > 0 || getnumber (_config >> "isGlobal") > 1;
_isPersistent = getNumber (_config >> "isPersistent") > 0 || getnumber (_config >> "isGlobal") > 1; local _isSingular = getNumber (_config >> "isSingular") > 0;
_function = getText (_config >> "function"); local _function = getText (_config >> "function");
if (isnil _function) then { if (isnil _function) then {
_function = compile _function; _function = compile _function;
} else { } else {
_function = missionNamespace getvariable _function; _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 { if (_isGlobal || isServer) then {
[_logic, (synchronizedObjects _logic), true] call _function; [_logic, (synchronizedObjects _logic), true] call _function;
@ -38,7 +43,7 @@
deleteVehicle _logic; deleteVehicle _logic;
}; };
}; };
}foreach GVAR(moduleInitCollection); } forEach GVAR(moduleInitCollection);
if (isServer) then { if (isServer) then {
GVAR(serverModulesRead) = true; GVAR(serverModulesRead) = true;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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