Faction Test 100.6.0.0
This commit is contained in:
@@ -517,6 +517,11 @@ namespace Barotrauma
|
||||
|
||||
if (musicDisposed) { Thread.Sleep(60); }
|
||||
}
|
||||
|
||||
public static void ForceMusicUpdate()
|
||||
{
|
||||
updateMusicTimer = 0.0f;
|
||||
}
|
||||
|
||||
private static void UpdateMusic(float deltaTime)
|
||||
{
|
||||
@@ -544,7 +549,7 @@ namespace Barotrauma
|
||||
|
||||
IEnumerable<BackgroundMusic> suitableMusic = GetSuitableMusicClips(currentMusicType, currentIntensity);
|
||||
int mainTrackIndex = 0;
|
||||
if (suitableMusic.Count() == 0)
|
||||
if (suitableMusic.None())
|
||||
{
|
||||
targetMusic[mainTrackIndex] = null;
|
||||
}
|
||||
@@ -611,10 +616,17 @@ namespace Barotrauma
|
||||
targetMusic[typeAmbienceTrackIndex] = suitableTypeAmbiences.GetRandomUnsynced();
|
||||
}
|
||||
|
||||
IEnumerable<BackgroundMusic> suitableIntensityMusic = Enumerable.Empty<BackgroundMusic>();
|
||||
if (targetMusic[mainTrackIndex] is { MuteIntensityTracks: false } mainTrack && Screen.Selected == GameMain.GameScreen)
|
||||
{
|
||||
float intensity = currentIntensity;
|
||||
if (mainTrack?.ForceIntensityTrack != null)
|
||||
{
|
||||
intensity = mainTrack.ForceIntensityTrack.Value;
|
||||
}
|
||||
suitableIntensityMusic = GetSuitableMusicClips("intensity".ToIdentifier(), intensity);
|
||||
}
|
||||
//get the appropriate intensity layers for current situation
|
||||
IEnumerable<BackgroundMusic> suitableIntensityMusic = Screen.Selected == GameMain.GameScreen ?
|
||||
GetSuitableMusicClips("intensity".ToIdentifier(), currentIntensity) :
|
||||
Enumerable.Empty<BackgroundMusic>();
|
||||
int intensityTrackStartIndex = 3;
|
||||
for (int i = intensityTrackStartIndex; i < MaxMusicChannels; i++)
|
||||
{
|
||||
@@ -744,6 +756,14 @@ namespace Barotrauma
|
||||
|
||||
firstTimeInMainMenu = false;
|
||||
|
||||
if (GameMain.GameSession != null)
|
||||
{
|
||||
foreach (var mission in GameMain.GameSession.Missions)
|
||||
{
|
||||
var missionMusic = mission.GetOverrideMusicType();
|
||||
if (!missionMusic.IsEmpty) { return missionMusic; }
|
||||
}
|
||||
}
|
||||
|
||||
if (Character.Controlled != null)
|
||||
{
|
||||
@@ -833,7 +853,7 @@ namespace Barotrauma
|
||||
{
|
||||
return "levelend".ToIdentifier();
|
||||
}
|
||||
if (Timing.TotalTime < GameMain.GameSession.RoundStartTime + 120.0 &&
|
||||
if (GameMain.GameSession.RoundDuration > 120.0 &&
|
||||
Level.Loaded?.Type == LevelData.LevelType.LocationConnection)
|
||||
{
|
||||
return "start".ToIdentifier();
|
||||
|
||||
@@ -238,17 +238,24 @@ namespace Barotrauma
|
||||
public readonly float Volume;
|
||||
|
||||
public readonly Vector2 IntensityRange;
|
||||
public readonly bool MuteIntensityTracks;
|
||||
public readonly float? ForceIntensityTrack;
|
||||
|
||||
public readonly bool ContinueFromPreviousTime;
|
||||
public int PreviousTime;
|
||||
|
||||
public BackgroundMusic(ContentXElement element, SoundsFile file) : base(element, file, stream: true)
|
||||
{
|
||||
Type = element.GetAttributeIdentifier("type", "");
|
||||
IntensityRange = element.GetAttributeVector2("intensityrange", new Vector2(0.0f, 100.0f));
|
||||
DuckVolume = element.GetAttributeBool("duckvolume", false);
|
||||
this.Volume = element.GetAttributeFloat("volume", 1.0f);
|
||||
ContinueFromPreviousTime = element.GetAttributeBool("continuefromprevioustime", false);
|
||||
Type = element.GetAttributeIdentifier(nameof(Type), "");
|
||||
IntensityRange = element.GetAttributeVector2(nameof(IntensityRange), new Vector2(0.0f, 100.0f));
|
||||
DuckVolume = element.GetAttributeBool(nameof(DuckVolume), false);
|
||||
MuteIntensityTracks = element.GetAttributeBool(nameof(MuteIntensityTracks), false);
|
||||
if (element.GetAttribute(nameof(ForceIntensityTrack)) != null)
|
||||
{
|
||||
ForceIntensityTrack = element.GetAttributeFloat(nameof(ForceIntensityTrack), 0.0f);
|
||||
}
|
||||
Volume = element.GetAttributeFloat(nameof(Volume), 1.0f);
|
||||
ContinueFromPreviousTime = element.GetAttributeBool(nameof(ContinueFromPreviousTime), false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user