private void SetBGMScriptPath(string BGMPath)
        {
            Cutscene ActiveCutscene = CurrentDialog.CutsceneBefore;

            bool ExistingScriptFound = false;

            foreach (CutsceneActionScript ActiveScript in ActiveCutscene.DicActionScript.Values)
            {
                if (ActiveScript is ScriptPlayMapTheme)
                {
                    ScriptPlayMapTheme ActivePlayMapTheme = (ScriptPlayMapTheme)ActiveScript;
                    ActivePlayMapTheme.BGMPath = BGMPath;
                    ExistingScriptFound        = true;
                    break;
                }
            }

            txtBGM.Text = BGMPath;
            if (!ExistingScriptFound)
            {
                ScriptCutsceneBehavior NewCutsceneBehavior = new ScriptCutsceneBehavior();
                ActiveCutscene.AddActionScript(NewCutsceneBehavior);

                ScriptPlayMapTheme NewPlayMapTheme = new ScriptPlayMapTheme();
                NewPlayMapTheme.ScriptSize.Location = new System.Drawing.Point(170, 0);
                NewPlayMapTheme.BGMPath             = BGMPath;
                InitScript(NewPlayMapTheme);
                ActiveCutscene.AddActionScript(NewPlayMapTheme);

                NewCutsceneBehavior.ArrayEvents[0].Add(new EventInfo(ActiveCutscene.DicActionScript.Count - 1, 0));
            }
        }
Пример #2
0
        private void tsmCopy_Click(object sender, EventArgs e)
        {
            CutsceneScript NewScript = null;

            if (ActiveScriptType == ActiveScriptTypes.ActionScript)
            {
                NewScript = ActiveCutscene.DicActionScript[ActiveScriptIndex].CopyScript(ActiveCutscene);
            }
            else if (ActiveScriptType == ActiveScriptTypes.DataContainer)
            {
                NewScript = ActiveCutscene.ListDataContainer[ActiveScriptIndex].CopyScript(ActiveCutscene);
            }

            NewScript.ScriptSize.X = 0;
            NewScript.ScriptSize.Y = 0;

            InitScript(NewScript);
            if (NewScript is CutsceneDataContainer)
            {
                UInt32 NextID = 1;
                for (int S = ActiveCutscene.ListDataContainer.Count - 1; S >= 0; --S)
                {
                    if (ActiveCutscene.ListDataContainer[S].Name == NewScript.Name)
                    {
                        NextID++;
                    }
                }
                ((CutsceneDataContainer)NewScript).ID = NextID;
                ActiveCutscene.ListDataContainer.Add((CutsceneDataContainer)NewScript);
            }
            else
            {
                ActiveCutscene.AddActionScript((CutsceneActionScript)NewScript);
            }
            DrawScripts();
        }