Merge pull request #2068 from FlightControl-Master/FF/MasterDevel

MSRS
This commit is contained in:
Frank
2023-12-24 03:21:50 +01:00
committed by GitHub
4 changed files with 1040 additions and 969 deletions

View File

@@ -2456,15 +2456,18 @@ do -- COORDINATE
-- Write command as string and execute that. Idea by Grimes https://forum.dcs.world/topic/324201-mark-to-all-function/#comment-5273793 -- Write command as string and execute that. Idea by Grimes https://forum.dcs.world/topic/324201-mark-to-all-function/#comment-5273793
local s=string.format("trigger.action.markupToAll(7, %d, %d,", Coalition, MarkID) local s=string.format("trigger.action.markupToAll(7, %d, %d,", Coalition, MarkID)
for _,vec in pairs(vecs) do for _,vec in pairs(vecs) do
s=s..string.format("%s,", UTILS._OneLineSerialize(vec)) --s=s..string.format("%s,", UTILS._OneLineSerialize(vec))
s=s..string.format("{x=%.1f, y=%.1f, z=%.1f},", vec.x, vec.y, vec.z)
end end
s=s..string.format("%s, %s, %s, %s", UTILS._OneLineSerialize(Color), UTILS._OneLineSerialize(FillColor), tostring(LineType), tostring(ReadOnly)) s=s..string.format("{%.3f, %.3f, %.3f, %.3f},", Color[1], Color[2], Color[3], Color[4])
if Text and Text~="" then s=s..string.format("{%.3f, %.3f, %.3f, %.3f},", FillColor[1], FillColor[2], FillColor[3], FillColor[4])
s=s..string.format(", \"%s\"", Text) s=s..string.format("%d,", LineType or 1)
s=s..string.format("%s", tostring(ReadOnly))
if Text and type(Text)=="string" and string.len(Text)>0 then
s=s..string.format(", \"%s\"", tostring(Text))
end end
s=s..")" s=s..")"
-- Execute string command -- Execute string command
local success=UTILS.DoString(s) local success=UTILS.DoString(s)

View File

@@ -2496,6 +2496,7 @@ end
-- @return #ZONE_POLYGON_BASE self -- @return #ZONE_POLYGON_BASE self
function ZONE_POLYGON_BASE:DrawZone(Coalition, Color, Alpha, FillColor, FillAlpha, LineType, ReadOnly, IncludeTriangles) function ZONE_POLYGON_BASE:DrawZone(Coalition, Color, Alpha, FillColor, FillAlpha, LineType, ReadOnly, IncludeTriangles)
if self._.Polygon and #self._.Polygon >= 3 then if self._.Polygon and #self._.Polygon >= 3 then
Coalition = Coalition or self:GetDrawCoalition() Coalition = Coalition or self:GetDrawCoalition()
@@ -2517,6 +2518,21 @@ function ZONE_POLYGON_BASE:DrawZone(Coalition, Color, Alpha, FillColor, FillAlph
end end
end end
if false then
local coords = self:GetVerticiesCoordinates()
local coord=coords[1] --Core.Point#COORDINATE
table.remove(coords, 1)
coord:MarkupToAllFreeForm(coords, Coalition, Color, Alpha, FillColor, FillAlpha, LineType, ReadOnly, "Drew Polygon")
if true then
return
end
end
return self return self
end end
@@ -3673,13 +3689,17 @@ ZONE_OVAL = {
--- Creates a new ZONE_OVAL from a center point, major axis, minor axis, and angle. --- Creates a new ZONE_OVAL from a center point, major axis, minor axis, and angle.
--- ported from https://github.com/nielsvaes/CCMOOSE/blob/master/Moose%20Development/Moose/Shapes/Oval.lua --- ported from https://github.com/nielsvaes/CCMOOSE/blob/master/Moose%20Development/Moose/Shapes/Oval.lua
-- @param #ZONE_OVAL self
-- @param #string name Name of the zone.
-- @param #table vec2 The center point of the oval -- @param #table vec2 The center point of the oval
-- @param #number major_axis The major axis of the oval -- @param #number major_axis The major axis of the oval
-- @param #number minor_axis The minor axis of the oval -- @param #number minor_axis The minor axis of the oval
-- @param #number angle The angle of the oval -- @param #number angle The angle of the oval
-- @return #ZONE_OVAL The new oval -- @return #ZONE_OVAL The new oval
function ZONE_OVAL:New(name, vec2, major_axis, minor_axis, angle) function ZONE_OVAL:New(name, vec2, major_axis, minor_axis, angle)
self = BASE:Inherit(self, ZONE_BASE:New()) self = BASE:Inherit(self, ZONE_BASE:New())
self.ZoneName = name self.ZoneName = name
self.CenterVec2 = vec2 self.CenterVec2 = vec2
self.MajorAxis = major_axis self.MajorAxis = major_axis

View File

@@ -890,7 +890,7 @@ _ATIS = {}
--- ATIS class version. --- ATIS class version.
-- @field #string version -- @field #string version
ATIS.version = "0.10.4" ATIS.version = "1.0.0"
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- TODO list -- TODO list
@@ -1528,12 +1528,12 @@ end
--- Use SRS Simple-Text-To-Speech for transmissions. No sound files necessary. --- Use SRS Simple-Text-To-Speech for transmissions. No sound files necessary.
-- @param #ATIS self -- @param #ATIS self
-- @param #string PathToSRS Path to SRS directory. -- @param #string PathToSRS Path to SRS directory (only necessary if SRS exe backend is used).
-- @param #string Gender Gender: "male" or "female" (default). -- @param #string Gender Gender: "male" or "female" (default).
-- @param #string Culture Culture, e.g. "en-GB" (default). -- @param #string Culture Culture, e.g. "en-GB" (default).
-- @param #string Voice Specific voice. Overrides `Gender` and `Culture`. -- @param #string Voice Specific voice. Overrides `Gender` and `Culture`.
-- @param #number Port SRS port. Default 5002. -- @param #number Port SRS port. Default 5002.
-- @param #string GoogleKey Path to Google JSON-Key. -- @param #string GoogleKey Path to Google JSON-Key (SRS exe backend) or Google API key (DCS-gRPC backend).
-- @return #ATIS self -- @return #ATIS self
function ATIS:SetSRS(PathToSRS, Gender, Culture, Voice, Port, GoogleKey) function ATIS:SetSRS(PathToSRS, Gender, Culture, Voice, Port, GoogleKey)
if PathToSRS or MSRS.path then if PathToSRS or MSRS.path then

File diff suppressed because it is too large Load Diff