Пример #1
0
        /// <summary>
        /// ダイアログを開いてパスをセットします。
        /// </summary>
        /// <returns>成功したかどうか</returns>
        public bool OpenPathDialog()
        {
            switch (this.DialogType)
            {
            case SetterDialogType.ProjectRoot:
                var Dlg = new Dialog.Common.dlgFileSelect(this.RootPath, this.FileFilter, this.EnabledFiles, false, false, this.Result);
                if (Dlg.ShowDialog() == DialogResult.OK)
                {
                    this.Result = Dlg.FileName;
                }
                else
                {
                    return(false);
                }
                break;

            case SetterDialogType.Folder:
                this.folderDlg.SelectedPath = this.Result;
                this.folderDlg.Description  = this.DialogTitle;
                if (this.folderDlg.ShowDialog(this) == DialogResult.OK)
                {
                    this.Result = this.folderDlg.SelectedPath;
                }
                else
                {
                    return(false);
                }
                break;

            case SetterDialogType.OpenFile:
                this.openFileDlg.FileName = this.Result;
                this.openFileDlg.Title    = this.DialogTitle;
                this.openFileDlg.Filter   = this.FileFilter;
                if (this.openFileDlg.ShowDialog(this) == DialogResult.OK)
                {
                    this.Result = this.openFileDlg.FileName;
                }
                else
                {
                    return(false);
                }
                break;

            case SetterDialogType.SaveFile:
                this.saveFileDlg.FileName = this.Result;
                this.saveFileDlg.Title    = this.DialogTitle;
                this.saveFileDlg.Filter   = this.FileFilter;
                if (this.saveFileDlg.ShowDialog(this) == DialogResult.OK)
                {
                    this.Result = this.saveFileDlg.FileName;
                }
                else
                {
                    return(false);
                }
                break;
            }
            return(true);
        }
Пример #2
0
        /// <summary>
        /// ターゲットグラフィック変更
        /// </summary>
        private void tmnChangeTargetGraph_Click(object sender, EventArgs e)
        {
            var Dlg = new Dialog.Common.dlgFileSelect(Resources.Path_Materials, Resources.Extension_Graphics, true, false, false, Settings.Default.DB_EffectTargetPicture);

            if (Dlg.ShowDialog() == DialogResult.OK)
            {
                this.mgr.ChangeTarget(Dlg.FileName);
            }
        }
Пример #3
0
        /// <summary>
        /// 画像の変更
        /// </summary>
        private void TargetGraphics_MouseClick(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                //右クリックで削除する
                this.picTargetGraphics.Image = null;
                this.FileName = "";
                this.GraphicsChanged?.Invoke(this, null);
                return;
            }

            var Dlg = new Dialog.Common.dlgFileSelect(Resources.Path_Materials, Resources.Extension_Graphics, this.EnabledTileset, true, this.OnlyTileset, this.FileName);

            if (Dlg.ShowDialog() == DialogResult.OK)
            {
                this.FileName = Dlg.FileName;
                this.reloadImage();
                this.GraphicsChanged?.Invoke(this, null);
            }
        }
Пример #4
0
        /// <summary>
        /// ツールによって挿入コードを生成します。
        /// </summary>
        private string getCodeTool(TreeNode node)
        {
            var nodeTag = node.Tag?.ToString();

            switch (nodeTag)
            {
            case TagToolMessage:
                var DlgMsg = new Dialog.Text.Script.dlgEVcmdMessage(this.dbCtl.DBList);
                if (DlgMsg.ShowDialog() != DialogResult.OK)
                {
                    return("");
                }
                return(DlgMsg.Result);

            case TagToolFileName:
                var DlgFN = new Dialog.Common.dlgFileSelect(null, "", true, true, false);
                if (DlgFN.ShowDialog() != DialogResult.OK)
                {
                    return("");
                }
                //両端のダブルクォートとパス区切り記号のエスケープシーケンス化
                return("\"" + DlgFN.FileName.Replace("\\", "\\\\") + "\"");

            case TagToolEVID:
                if (this.ParentForm is Dialog.Map.dlgEVSettings)
                {
                    //イベント編集画面のときに限る
                    if (this.mgrMap.MapData == null)
                    {
                        //編集中のマップが存在しない
                        return("");
                    }

                    var DlgEVID = new Dialog.Common.dlgSelectInList("イベントIDの挿入");
                    for (var i = 0; i < this.mgrMap.MapData.EVCount; i++)
                    {
                        DlgEVID.AddItem(this.mgrMap.MapData[i].VisibleID, this.mgrMap.MapData[i].Name);
                    }

                    if (DlgEVID.ShowDialog() != DialogResult.OK)
                    {
                        //ダイアログ中断
                        return("");
                    }

                    if (!Settings.Default.Script_FixedIDHexMode)
                    {
                        //10進数のID表記
                        return(this.mgrMap.MapData[DlgEVID.GetResultIndex()].FixedID.ToString() + "/*" + DlgEVID.GetResultTitle() + "*/");
                    }
                    else
                    {
                        //16進数のID表記
                        return("0x" + this.mgrMap.MapData[DlgEVID.GetResultIndex()].FixedID.ToString("X") + "/*" + DlgEVID.GetResultTitle() + "*/");
                    }
                }
                else
                {
                    MessageBox.Show("イベントIDの挿入はマップエディター上のイベント編集画面でのみ有効です。", Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return("");
                }

            case TagToolDBID:
            case TagToolDBColumn:
                var DlgDB2 = new Dialog.Text.Script.dlgInsertDB(this.dbCtl.DBList, (nodeTag == TagToolDBColumn) ? true : false, false);
                if (DlgDB2.ShowDialog() != DialogResult.OK)
                {
                    return("");
                }
                return(DlgDB2.Result);

            case TagToolChangeMap:
                var DlgMap = new Dialog.Text.Script.dlgEVcmdChangeMap(this.dbCtl.DBList);
                if (DlgMap.ShowDialog() != DialogResult.OK)
                {
                    return("");
                }
                return(DlgMap.Result);

            case TagToolColor:
                var DlgCLR = new ColorDialog {
                    AllowFullOpen = true,
                    FullOpen      = true
                };
                if (DlgCLR.ShowDialog() != DialogResult.OK)
                {
                    return("");
                }

                //RGBの順で3つの引数を作り、カラーコードを取得する関数をセットにする
                return(Resources.SQ_GetColor.Replace("$", $"{DlgCLR.Color.R}, {DlgCLR.Color.G}, {DlgCLR.Color.B}"));

            case TagToolPathNormalEV:
            case TagToolPathExtraEV:
            case TagToolPathExtraPlayer:
                var DlgPath = new Dialog.Text.Script.dlgEVcmdMoveTask(
                    nodeTag != TagToolPathNormalEV,
                    nodeTag == TagToolPathExtraPlayer
                    );
                if (DlgPath.ShowDialog() != DialogResult.OK)
                {
                    return("");
                }
                return(DlgPath.Result);

            case TagSQTagSummary:
                return(GenerateGlueCode.GenerateSQDocument.SQ_TAG + GenerateGlueCode.GenerateSQDocument.DOC_SUMMARY + "\r\n");

            case TagSQTagNode:
                return(GenerateGlueCode.GenerateSQDocument.SQ_TAG + GenerateGlueCode.GenerateSQDocument.DOC_PATH + "\r\n");

            case TagSQTagParameter:
                return(GenerateGlueCode.GenerateSQDocument.SQ_TAG + GenerateGlueCode.GenerateSQDocument.DOC_PARAM + "\r\n");

            case TagSQTagReturn:
                return(GenerateGlueCode.GenerateSQDocument.SQ_TAG + GenerateGlueCode.GenerateSQDocument.DOC_RETURN + "\r\n");

            case TagSQTagComment:
                return(GenerateGlueCode.GenerateSQDocument.SQ_TAG + GenerateGlueCode.GenerateSQDocument.DOC_COMMENT + "\r\n");
            }
            return("");
        }