Skip to content

Commit

Permalink
Editor: marked CrossfadeMusic and HasMODMusic properties as Obsolete
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-mogilko committed Oct 26, 2023
1 parent 32958c6 commit 598875f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 32 deletions.
13 changes: 0 additions & 13 deletions Editor/AGS.Editor/AGSEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1291,19 +1291,6 @@ private string[] ConstructFileListForEXE()
return files.ToArray();
}

public void SetMODMusicFlag()
{
foreach (AudioClip clip in _game.RootAudioClipFolder.GetAllAudioClipsFromAllSubFolders())
{
if (clip.FileType == AudioClipFileType.MOD)
{
_game.Settings.HasMODMusic = true;
return;
}
}
_game.Settings.HasMODMusic = false;
}

public bool AboutToDeleteSprite(int spriteNumber)
{
PreDeleteSpriteEventArgs evArgs = new PreDeleteSpriteEventArgs(spriteNumber);
Expand Down
3 changes: 1 addition & 2 deletions Editor/AGS.Editor/BuildTargets/BuildTargetDataFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ private void CreateAudioVOXFile(bool forceRebuild)

public override bool Build(CompileMessages errors, bool forceRebuild)
{
if (!base.Build(errors, forceRebuild)) return false;
Factory.AGSEditor.SetMODMusicFlag();
if (!base.Build(errors, forceRebuild)) return false;
if (!DataFileWriter.SaveThisGameToFile(AGSEditor.COMPILED_DTA_FILE_NAME, Factory.AGSEditor.CurrentGame, errors))
{
return false;
Expand Down
1 change: 0 additions & 1 deletion Editor/AGS.Editor/BuildTargets/BuildTargetDebug.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public override void DeleteMainGameData(string name)

private object CreateDebugFiles(IWorkProgress progress, object parameter)
{
Factory.AGSEditor.SetMODMusicFlag();
CompileMessages errors = (parameter as CompileMessages);
if (!DataFileWriter.SaveThisGameToFile(AGSEditor.COMPILED_DTA_FILE_NAME, Factory.AGSEditor.CurrentGame, errors))
{
Expand Down
21 changes: 5 additions & 16 deletions Editor/AGS.Types/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ public Settings()
private bool _oldKeyHandling = false;
private bool _scaleCharacterSpriteOffsets = true;
private int _playSoundOnScore = -1;
private CrossfadeSpeed _crossfadeMusic = CrossfadeSpeed.No;
private int _dialogOptionsGUI = 0;
private int _dialogOptionsGap = 0;
private int _dialogBulletImage = 0;
Expand All @@ -107,7 +106,6 @@ public Settings()
private bool _backwardsText = false;
private int _uniqueID;
private Guid _guid;
private bool _hasMODMusic = false;
private int _totalScore = 0;
private GUIAlphaStyle _guiAlphaStyle = GUIAlphaStyle.MultiplyTranslucenceSrcBlend;
private SpriteAlphaStyle _spriteAlphaStyle = SpriteAlphaStyle.Improved;
Expand Down Expand Up @@ -800,16 +798,10 @@ public int PlaySoundOnScore
set { _playSoundOnScore = value; }
}

[DisplayName("Crossfade music tracks")]
[Description("When going from one track to another, they can be crossfaded")]
[DefaultValue(CrossfadeSpeed.No)]
[Category("Sound")]
[Obsolete]
[Browsable(false)]
public CrossfadeSpeed CrossfadeMusic
{
get { return _crossfadeMusic; }
set { _crossfadeMusic = value; }
}
// NOTE: have to keep setter here because we load old games before upgrading them
public CrossfadeSpeed CrossfadeMusic { get; set; }

[DisplayName("Use GUI for dialog options")]
[Description("Dialog options can be drawn on a textwindow GUI (0 to just draw at bottom of screen instead)")]
Expand Down Expand Up @@ -1038,12 +1030,9 @@ public int MaximumScore
set { _totalScore = value; }
}

[Obsolete]
[Browsable(false)]
public bool HasMODMusic
{
get { return _hasMODMusic; }
set { _hasMODMusic = value; }
}
public bool HasMODMusic { get; }

[DisplayName("Default mask resolution")]
[Description("What resolution do room region masks have relative to the room size")]
Expand Down

0 comments on commit 598875f

Please sign in to comment.