mirror of
https://github.com/akaAgar/the-universal-mission-for-dcs-world.git
synced 2026-08-21 21:16:50 +00:00
Introduced administrative settings.
They are defined in `TUM.administrativeSettings`. They have a default value in `TUM.administrativeSettingsDefaultValues`. They can be overloaded either: - by script (with a call like `TUM.administrativeSettings.setValue(TUM.administrativeSettings.USE_SPECIFIC_RADIOMENU, true)` - by a parameter named after the setting in a trigger zone called `TUM_Administrative_Settings` Settings that are already implemented: - USE_SPECIFIC_RADIOMENU: use a specific radio menu for the mission commands, or use the main one? - INITIALIZE_AUTOMATICALLY: automatically initialize the mission when the script is loaded. If false, you must call TUM.initialize() manually. - IGNORE_ZONES_STARTINGWITH: if set, ignore all zones starting with this string. This is useful to avoid conflicts with other scripts that use the same zone names. - ONLY_ZONES_STARTINGWITH: if set, only adds zones starting with this string. This is useful to avoid conflicts with other scripts that use the same zone names.
This commit is contained in:
@@ -125,7 +125,27 @@ do
|
||||
elseif DCSEx.string.startsWith(z.name:lower(), "water") then
|
||||
table.insert(waterZones, z)
|
||||
else
|
||||
table.insert(missionZones, z)
|
||||
local onlyZonesStartingWith = TUM.administrativeSettings.getValue(TUM.administrativeSettings.ONLY_ZONES_STARTINGWITH)
|
||||
if onlyZonesStartingWith and #onlyZonesStartingWith > 0 then
|
||||
if type(onlyZonesStartingWith) ~= "table" then
|
||||
onlyZonesStartingWith = { onlyZonesStartingWith }
|
||||
end
|
||||
for _, zonePrefix in ipairs(onlyZonesStartingWith) do
|
||||
if DCSEx.string.startsWith(z.name:lower(), zonePrefix:lower()) then
|
||||
table.insert(missionZones, z)
|
||||
break
|
||||
end
|
||||
end
|
||||
else
|
||||
local ignoreZonesStartingWith = TUM.administrativeSettings.getValue(TUM.administrativeSettings.IGNORE_ZONES_STARTINGWITH)
|
||||
if ignoreZonesStartingWith then
|
||||
if not DCSEx.string.startsWith(z.name:lower(), ignoreZonesStartingWith:lower()) then
|
||||
table.insert(missionZones, z)
|
||||
end
|
||||
else
|
||||
table.insert(missionZones, z)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user