private void SetSFXScriptPath(string SFXPath) { Cutscene ActiveCutscene = CurrentDialog.CutsceneBefore; bool ExistingScriptFound = false; foreach (CutsceneActionScript ActiveScript in ActiveCutscene.DicActionScript.Values) { if (ActiveScript is ScriptPlaySFX) { ScriptPlaySFX ActivePlayMapTheme = (ScriptPlaySFX)ActiveScript; ActivePlayMapTheme.SFXPath = SFXPath; ExistingScriptFound = true; break; } } txtSFX.Text = SFXPath; if (!ExistingScriptFound) { ScriptCutsceneBehavior NewCutsceneBehavior = new ScriptCutsceneBehavior(); ActiveCutscene.AddActionScript(NewCutsceneBehavior); ScriptPlaySFX NewPlayMapTheme = new ScriptPlaySFX(); NewPlayMapTheme.ScriptSize.Location = new System.Drawing.Point(170, 0); NewPlayMapTheme.SFXPath = SFXPath; InitScript(NewPlayMapTheme); ActiveCutscene.AddActionScript(NewPlayMapTheme); NewCutsceneBehavior.ArrayEvents[0].Add(new EventInfo(ActiveCutscene.DicActionScript.Count - 1, 0)); } }
private string GetSFXScriptPath() { Cutscene ActiveCutscene = CurrentDialog.CutsceneBefore; foreach (CutsceneActionScript ActiveScript in ActiveCutscene.DicActionScript.Values) { if (ActiveScript is ScriptPlaySFX) { ScriptPlaySFX ActivePlayMapTheme = (ScriptPlaySFX)ActiveScript; return(ActivePlayMapTheme.SFXPath); } } return(string.Empty); }