Version 0.99

DML Flags
unGrief
messenger
The Zonal Countdowm
This commit is contained in:
Christian Franz
2022-03-03 17:40:00 +01:00
parent f1aa9cabf1
commit a1f5ca8567
21 changed files with 527 additions and 316 deletions

View File

@@ -1,5 +1,5 @@
raiseFlag = {}
raiseFlag.version = "1.0.0"
raiseFlag.version = "1.0.1"
raiseFlag.verbose = false
raiseFlag.requiredLibs = {
"dcsCommon", -- always
@@ -11,6 +11,8 @@ raiseFlag.flags = {}
Version History
1.0.0 - initial release
1.0.1 - synonym "raiseFlag!"
--]]--
function raiseFlag.addRaiseFlag(theZone)
table.insert(raiseFlag.flags, theZone)
@@ -32,8 +34,12 @@ end
--
function raiseFlag.createRaiseFlagWithZone(theZone)
-- get flag from faiseFlag itself
theZone.raiseFlag = cfxZones.getStringFromZoneProperty(theZone, "raiseFlag", "<none>") -- the flag to raise
if cfxZones.hasProperty(theZone, "raiseFlag") then
theZone.raiseFlag = cfxZones.getStringFromZoneProperty(theZone, "raiseFlag", "<none>") -- the flag to raise
else
theZone.raiseFlag = cfxZones.getStringFromZoneProperty(theZone, "raiseFlag!", "<none>") -- the flag to raise
end
theZone.flagValue = cfxZones.getNumberFromZoneProperty(theZone, "value", 1) -- value to set to
theZone.minAfterTime, theZone.maxAfterTime = cfxZones.getPositiveRangeFromZoneProperty(theZone, "afterTime", -1)
@@ -109,7 +115,7 @@ function raiseFlag.start()
trigger.action.outText("cfx raise flag requires dcsCommon", 30)
return false
end
if not dcsCommon.libCheck("cfx Count Down", raiseFlag.requiredLibs) then
if not dcsCommon.libCheck("cfx Raise Flag", raiseFlag.requiredLibs) then
return false
end
@@ -122,6 +128,12 @@ function raiseFlag.start()
raiseFlag.createRaiseFlagWithZone(aZone) -- process attributes
raiseFlag.addRaiseFlag(aZone) -- add to list
end
-- try synonym
attrZones = cfxZones.getZonesWithAttributeNamed("raiseFlag!")
for k, aZone in pairs(attrZones) do
raiseFlag.createRaiseFlagWithZone(aZone) -- process attributes
raiseFlag.addRaiseFlag(aZone) -- add to list
end
-- start update
raiseFlag.update()