mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge remote-tracking branch 'origin/master' into develop
This commit is contained in:
commit
e4cea7b3c4
@ -1228,7 +1228,7 @@ CTLD.UnitTypeCapabilities = {
|
||||
|
||||
--- CTLD class version.
|
||||
-- @field #string version
|
||||
CTLD.version="1.0.44"
|
||||
CTLD.version="1.0.45"
|
||||
|
||||
--- Instantiate a new CTLD.
|
||||
-- @param #CTLD self
|
||||
@ -2455,10 +2455,12 @@ function CTLD:_GetCrates(Group, Unit, Cargo, number, drop, pack)
|
||||
table.insert(droppedcargo,realcargo)
|
||||
else
|
||||
realcargo = CTLD_CARGO:New(self.CargoCounter,cratename,templ,sorte,false,false,cratesneeded,self.Spawned_Crates[self.CrateCounter],false,cargotype.PerCrateMass,nil,subcat)
|
||||
Cargo:RemoveStock()
|
||||
end
|
||||
table.insert(self.Spawned_Cargo, realcargo)
|
||||
end
|
||||
if not (drop or pack) then
|
||||
Cargo:RemoveStock()
|
||||
end
|
||||
local text = string.format("Crates for %s have been positioned near you!",cratename)
|
||||
if drop then
|
||||
text = string.format("Crates for %s have been dropped!",cratename)
|
||||
@ -3824,7 +3826,7 @@ end
|
||||
-- @param #CTLD_CARGO.Enum Type Type of cargo. I.e. VEHICLE or FOB. VEHICLE will move to destination zones when dropped/build, FOB stays put.
|
||||
-- @param #number NoCrates Number of crates needed to build this cargo.
|
||||
-- @param #number PerCrateMass Mass in kg of each crate
|
||||
-- @param #number Stock Number of groups in stock. Nil for unlimited.
|
||||
-- @param #number Stock Number of buildable groups in stock. Nil for unlimited.
|
||||
-- @param #string SubCategory Name of sub-category (optional).
|
||||
function CTLD:AddCratesCargo(Name,Templates,Type,NoCrates,PerCrateMass,Stock,SubCategory)
|
||||
self:T(self.lid .. " AddCratesCargo")
|
||||
|
||||
@ -160,24 +160,28 @@ do -- Sound File
|
||||
-- @param #string FileName The name of the sound file, e.g. "Hello World.ogg".
|
||||
-- @param #string Path The path of the directory, where the sound file is located. Default is "l10n/DEFAULT/" within the miz file.
|
||||
-- @param #number Duration Duration in seconds, how long it takes to play the sound file. Default is 3 seconds.
|
||||
-- @param #bolean UseSrs Set if SRS should be used to play this file. Default is false.
|
||||
-- @return #SOUNDFILE self
|
||||
function SOUNDFILE:New(FileName, Path, Duration)
|
||||
function SOUNDFILE:New(FileName, Path, Duration, UseSrs)
|
||||
|
||||
-- Inherit BASE.
|
||||
local self=BASE:Inherit(self, BASE:New()) -- #SOUNDFILE
|
||||
|
||||
-- Debug info:
|
||||
self:F( {FileName, Path, Duration, UseSrs} )
|
||||
|
||||
-- Set file name.
|
||||
self:SetFileName(FileName)
|
||||
|
||||
-- Set if SRS should be used to play this file
|
||||
self:SetPlayWithSRS(UseSrs or false)
|
||||
|
||||
-- Set path.
|
||||
self:SetPath(Path)
|
||||
|
||||
-- Set duration.
|
||||
self:SetDuration(Duration)
|
||||
|
||||
-- Debug info:
|
||||
self:T(string.format("New SOUNDFILE: file name=%s, path=%s", self.filename, self.path))
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
@ -186,12 +190,15 @@ do -- Sound File
|
||||
-- @param #string Path Path to the directory, where the sound file is located. In case this is nil, it defaults to the DCS mission temp directory.
|
||||
-- @return #SOUNDFILE self
|
||||
function SOUNDFILE:SetPath(Path)
|
||||
self:F( {Path} )
|
||||
|
||||
-- Init path.
|
||||
self.path=Path or "l10n/DEFAULT/"
|
||||
|
||||
if not Path and self.useSRS then -- use path to mission temp dir
|
||||
self.path = os.getenv('TMP') .. "\\DCS\\Mission\\l10n\\DEFAULT"
|
||||
if not Path then
|
||||
if self.useSRS then -- use path to mission temp dir
|
||||
self.path = lfs.tempdir() .. "Mission\\l10n\\DEFAULT"
|
||||
else -- use internal path in miz file
|
||||
self.path="l10n/DEFAULT/"
|
||||
end
|
||||
end
|
||||
|
||||
-- Remove (back)slashes.
|
||||
@ -204,6 +211,8 @@ do -- Sound File
|
||||
-- Append slash.
|
||||
self.path=self.path.."/"
|
||||
|
||||
self:T("self.path=".. self.path)
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
@ -264,11 +273,13 @@ do -- Sound File
|
||||
-- @param #boolean Switch If true or nil, use SRS. If false, use DCS transmission.
|
||||
-- @return #SOUNDFILE self
|
||||
function SOUNDFILE:SetPlayWithSRS(Switch)
|
||||
self:F( {Switch} )
|
||||
if Switch==true or Switch==nil then
|
||||
self.useSRS=true
|
||||
else
|
||||
self.useSRS=false
|
||||
end
|
||||
self:T("self.useSRS=".. tostring(self.useSRS))
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user