/// <summary> /// Insère un script /// </summary> /// <returns></returns> public static VO_Script CreateScript(bool interactionScript, Enums.ScriptType type) { //Création de l'objet VO_Script newScript = new VO_Script(Guid.NewGuid()) { Lines = new List <VO_Line>() }; //Insertion de l'objet if (interactionScript) { GameCore.Instance.Game.InteractionScripts.Add(newScript); } newScript.Lines = new List <VO_Line>(); newScript.ScriptType = type; return(newScript); }
/// <summary> /// Chargement du dialogue /// </summary> /// <param name="dialog">VO_Dialog</param> public void LoadDialog(VO_Dialog dialog, Enums.ScriptType scriptType) { Cursor.Current = Cursors.WaitCursor; this.grdDialog.SuspendLayout(); CurrentDialog = dialog.Clone(); CanceledChanges = false; _ScriptType = scriptType; if (scriptType == Enums.ScriptType.AnimationEvents || scriptType == Enums.ScriptType.CharacterEvents || scriptType == Enums.ScriptType.Events || scriptType == Enums.ScriptType.StageEvents) { _UseCurrentStage = true; } else { _UseCurrentStage = false; } //Désactiver les eventhandlers grdDialog.CellValueChanged -= new DataGridViewCellEventHandler(grdDialog_CellValueChanged); grdDialog.CellClick -= new DataGridViewCellEventHandler(grdDialog_CellClick); //Charger les listes LoadLists(); chkShowFaces.Checked = CurrentDialog.UseFaces; //Charger la gridview grdDialog.Rows.Clear(); foreach (VO_Message message in CurrentDialog.Messages) { InsertMessage(message); } //Activer les eventhandlers grdDialog.CellValueChanged += new DataGridViewCellEventHandler(grdDialog_CellValueChanged); grdDialog.CellClick += new DataGridViewCellEventHandler(grdDialog_CellClick); this.grdDialog.ResumeLayout(); Cursor.Current = DefaultCursor; }
/// <summary> /// Insère un script /// </summary> /// <returns></returns> public static VO_Script CreateScript(Enums.ScriptType type) { return(CreateScript(false, type)); }