/// <summary> /// コンストラクター /// </summary> public dlgEVTemplates(EVData ev, string mapGUID, CtrlComponent.Text.ctlCommandTree comTree, CtrlComponent.Database.ctlDatabaseEditor dbCtl) { this.InitializeComponent(); Common.EnableDoubleBuffering(this); this.ev = ev; this.tilePosition = ev.TilePosition; this.MapGUID = mapGUID; this.comTree = comTree; this.dbCtl = dbCtl; this.dbList = dbCtl.DBList; // デフォルトの可視ID this.numEVVisibleID.Value = ev.VisibleID; //初期設定 //リンク this.uctlSQChangeMapLink.DBList = this.dbList; //ドア Database.CreateComboBoxListFromSrcDB(this.cmbKeyItemDoor, this.dbList[Database.DBIndices.Item].DBs[0], true); Database.CreateComboBoxListFromSrcDB(this.cmbSEDoor, this.dbList[Database.DBIndices.Material].DBs[(int)Database.DBMaterialIndices.Sound], true); Database.SelectComboBoxItemFromIDName(this.cmbSEDoor, Settings.Default.Last_EVTemplate_DoorSE); if (this.cmbSEDoor.SelectedIndex == -1) { this.cmbSEDoor.SelectedIndex = 0; //「なし」を選択 } //ドア+リンク Database.CreateComboBoxListFromSrcDB(this.cmbKeyItemDL, this.dbList[Database.DBIndices.Item].DBs[0], true); Database.CreateComboBoxListFromSrcDB(this.cmbSEDL, this.dbList[Database.DBIndices.Material].DBs[(int)Database.DBMaterialIndices.Sound], true); Database.SelectComboBoxItemFromIDName(this.cmbSEDL, Settings.Default.Last_EVTemplate_DoorSE); this.uctlSQChangeMapDL.DBList = this.dbList; if (this.cmbSEDL.SelectedIndex == -1) { this.cmbSEDL.SelectedIndex = 0; //「なし」を選択 } //村人 this.uctlSQMessageHuman.SetDBList(this.dbList); //財宝 Database.CreateComboBoxListFromSrcDB(this.cmbOpenSETreasure, this.dbList[Database.DBIndices.Material].DBs[(int)Database.DBMaterialIndices.Sound], true); Database.CreateComboBoxListFromSrcDB(this.cmbItemTreasure, this.dbList[Database.DBIndices.Item].DBs[0], false); Database.CreateComboBoxListFromSrcDB(this.cmbKeyItemTreasure, this.dbList[Database.DBIndices.Item].DBs[0], true); Database.CreateComboBoxListFromSrcDB(this.cmbSelfValueTreasure, this.dbList[Database.DBIndices.Value].DBs[(int)Database.DBValueIndices.SelfEvent], false); Database.SelectComboBoxItemFromIDName(this.cmbOpenSETreasure, Settings.Default.Last_EVTemplate_TreasureSE); this.rdbMoneyTreasure.Checked = true; if (this.cmbOpenSETreasure.SelectedIndex == -1) { this.cmbOpenSETreasure.SelectedIndex = 0; //「なし」を選択 } //お店 Database.CreateComboBoxListFromSrcDB(this.cmbFaceShop, this.dbList[Database.DBIndices.Material].DBs[(int)Database.DBMaterialIndices.Face], true); Database.CreateComboBoxListFromSrcDB(this.cmbItemDBShop, this.dbList[Database.DBIndices.Item].DBs[0]); this.uctlShopItemList.SetupList(new string[] { "商品名" }, null, true); //ユーザー定義 this.reloadEVTemplates(); }
/// <summary> /// コンストラクター /// </summary> public dlgEVSettings(EVData ev, string mapGUID, CtrlComponent.Text.ctlCommandTree comTree, CtrlComponent.Database.ctlDatabaseEditor dbCtl) { this.InitializeComponent(); Common.EnableDoubleBuffering(this); this.Result = ev; this.MapGUID = mapGUID; this.comTree = comTree; this.comTreeParent = comTree.Parent; //元々コマンドツリーを格納していたコントロールを覚えておく this.comTree.RequestInsertCode += this.uctlComTree_RequestInsertCode; this.comTree.EnabledEasyEditorTools = true; //Easyエディターツール群を有効にする this.dbCtl = dbCtl; //NOTE: イベント情報 IN //初期設定 this.numID.Value = ev.VisibleID; this.txtName.Text = ev.Name; this.uctlPosition.Maximum = new Point(Map.MaxMapSize); this.uctlPosition.Result = ev.TilePosition; //イベント情報をもとにセットする foreach (var page in ev.Pages) { if (this.addPage()) { ((CtrlComponent.Map.ctlEVPage) this.tbcEVPages.TabPages[this.tbcEVPages.TabCount - 1].Controls[0]).SetEVPageData(page.Clone() as EVData.EventOnePage); } } var ctl = (this.tbcEVPages.SelectedTab.Controls[0] as CtrlComponent.Map.ctlEVPage); ctl.uctlEVCommandEditor.Setup(comTree); ctl.uctlTextEditor.Setup(dbCtl); this.tbcEVPages_Selecting(this, new TabControlCancelEventArgs(this.tbcEVPages.SelectedTab, this.tbcEVPages.SelectedIndex, false, TabControlAction.Selecting)); }
/// <summary> /// コマンドツリーから引数入力補助メニューの中身を生成する /// </summary> private void SetCommandTree(CtrlComponent.Text.ctlCommandTree comTree) { this.comTree = comTree; this.argTools.Items.Clear(); foreach (TreeNode rootNode in comTree.trvTree.Nodes) { var newItem = new ToolStripMenuItem(); this.SetToolStripMenuItemSettings(newItem, rootNode); this.GetSubNodes(newItem, rootNode); this.argTools.Items.Add(newItem); } }
/// <summary> /// コンストラクター:直接入力モード /// </summary> public dlgInsertCommand(CtrlComponent.Text.ctlCommandTree comTree, string summary, string comment, string footer, string defaultText) { this.InitializeComponent(); this.obj = null; //与えられたオブジェクトに応じてセットアップする this.lblSummary.Text = summary; this.lblComment.Text = comment; this.lblReturnType.Text = ""; this.lblReturnComment.Text = footer; //単一入力欄を作る this.SuspendLayout(); var newArg = new CtrlComponent.Text.ctlArgment(); newArg.Setup(this.argTools, -1, "", "", defaultText); newArg.Size = new Size(this.pnlArguments.Width * 90 / 100, newArg.Height); this.pnlArguments.Controls.Add(newArg); this.ResumeLayout(false); this.SetCommandTree(comTree); }
/// <summary> /// コンストラクター:関数入力モード /// </summary> public dlgInsertCommand(CtrlComponent.Text.ctlCommandTree comTree, SQObject obj, string[] args = null) { this.InitializeComponent(); this.obj = obj; //与えられたオブジェクトに応じてセットアップする //概要 if (!string.IsNullOrEmpty(obj.Summary)) { this.lblSummary.Text = obj.Summary; } else { //概要がない場合はオブジェクトのフルパスをそのまま表示する this.lblSummary.Text = (obj.ClassPath ?? "不明な関数: " + obj.Name).Replace("\\", "."); } //詳細説明 if (!string.IsNullOrEmpty(obj.Comment)) { this.lblComment.Text = obj.Comment; } else { this.lblComment.Text = "説明はありません。"; } //戻り値の型 if (!string.IsNullOrEmpty(obj.ReturnType)) { this.lblReturnType.Text = $"戻り値 ({obj.ReturnType}):\r\n"; } else { //戻り値の型が不明な場合 this.lblReturnType.Text = $"戻り値 (不明):\r\n"; } //戻り値の説明: 句点で改行するやさしさ if (!string.IsNullOrEmpty(obj.ReturnComment)) { this.lblReturnComment.Text = obj.ReturnComment.Replace("。", "。\r\n"); } else if (obj.ReturnType == "void") { this.lblReturnComment.Text = "戻り値はありません。"; } else { this.lblReturnComment.Text = "説明はありません。"; } //引数欄を作る this.SuspendLayout(); for (var i = 0; i < obj.ArgumentList.Count; i++) { var newArg = new CtrlComponent.Text.ctlArgment(); newArg.Setup(this.argTools, i + 1, obj.ArgumentList[i], (i < obj.ArgComments.Count) ? obj.ArgComments[i] : "", (args != null && i < args.Length) ? args[i] : ""); newArg.Size = new Size(this.pnlArguments.Width * 90 / 100, newArg.Height); this.pnlArguments.Controls.Add(newArg); } this.ResumeLayout(false); this.SetCommandTree(comTree); }
/// <summary> /// このコントロールを使える状態にします。 /// </summary> public void Setup(CtrlComponent.Text.ctlCommandTree comTree) { this.comTree = comTree; }