/// <summary> /// 命令を追加します。 /// </summary> public void AddOrder(EffectOrder order) { this.Orders.Add(new EffectOrder(this.DBList, order)); this.sortOrders(); this.IsDirty = true; this.DataChangedEx?.Invoke(this, new DataChangedEventArgs(false, true, false, false)); }
/// <summary> /// 指定したインデックスの命令を置き換えます。 /// </summary> public void ReplaceOrder(int index, EffectOrder order) { this.Orders[index] = order; this.sortOrders(); this.IsDirty = true; this.DataChangedEx?.Invoke(this, new DataChangedEventArgs(false, true, false, false)); }
/// <summary> /// 仮命令を正式に作成 /// </summary> public EffectOrder(AllDB DBList, EffectOrder order) { this.dbList = DBList; this.Frame = order.Frame; this.Type = order.Type; this.Options = order.Options; }
/// <summary> /// コンストラクター /// </summary> public dlgOrder(AllDB DBList, EffectOrder baseOrder, int frameLength, int targetFrame, bool enabledEditFrameNum, List <string> SQList) { this.InitializeComponent(); this.numTargetFrame.Enabled = enabledEditFrameNum; this.numTargetFrame.Maximum = frameLength - 1; this.DBList = DBList; //効果音リストの生成 Database.CreateComboBoxListFromSrcDB(this.cmbSEList, DBList[Database.DBIndices.Material].DBs[(int)Database.DBMaterialIndices.Sound], false); //独自コマンドの関数リストを生成 this.cmbCommand.Items.Clear(); foreach (var sqFile in SQList) { var funcs = SQ.GetFunctionList(sqFile); foreach (var func in funcs) { this.cmbCommand.Items.Add(func.SubItems[(int)SQ.FuncListColumns.Name].Text); } } this.tips.SetToolTip(this.cmbCommand, $"同一フレームの実行カウンターは {Resources.SQ_EffectSameCounter} です。\r\nこれは特定のフレームが最初に実行されるときだけ処理したい場合などに使います。"); //既定値のセット this.numTargetFrame.Value = (this.numTargetFrame.Maximum >= targetFrame) ? targetFrame : this.numTargetFrame.Maximum; if (baseOrder == null) { return; } if (baseOrder.Frame < frameLength) { //有効なフレーム番号のときだけ既定値からセットする this.numTargetFrame.Value = baseOrder.Frame; } switch (baseOrder.Type) { case EffectOrder.OrderType.Sound: //一致する効果音ファイルを探す for (var i = 0; i < this.cmbSEList.Items.Count; i++) { if (((SoundItem)this.cmbSEList.Items[i]).Value.ToString() == baseOrder.Options[(int)EffectOrder.SoundOptionIndices.FixedID]) { this.cmbSEList.SelectedIndex = i; this.uctlSEEditor.SoundData = new Media.SoundObject( DBList[Database.DBIndices.Material].DBs[(int)Database.DBMaterialIndices.Sound].Rows[i].Cells[(int)Database.DBDefaultColumnIndices.Count].Value?.ToString(), int.Parse(baseOrder.Options[(int)EffectOrder.SoundOptionIndices.Volume]), int.Parse(baseOrder.Options[(int)EffectOrder.SoundOptionIndices.Pitch]), int.Parse(baseOrder.Options[(int)EffectOrder.SoundOptionIndices.Pan]) ); break; } } this.rdbSE.Checked = true; break; case EffectOrder.OrderType.Shake: this.numShakeStrength.Value = int.Parse(baseOrder.Options[0]); this.rdbShake.Checked = true; break; case EffectOrder.OrderType.Flash: this.pnlFlashColor.BackColor = Common.StringToColor(baseOrder.Options[(int)EffectOrder.FlashOptionIndices.Color]); this.numFlashStrength.Value = int.Parse(baseOrder.Options[(int)EffectOrder.FlashOptionIndices.Strength]); this.numFlashCount.Value = int.Parse(baseOrder.Options[(int)EffectOrder.FlashOptionIndices.Count]); this.rdbFlash.Checked = true; break; case EffectOrder.OrderType.WaitBreak: this.rdbWaitBreak.Checked = true; break; case EffectOrder.OrderType.User: this.cmbCommand.Text = baseOrder.Options[0]; this.rdbScript.Checked = true; break; } }