Example #1
0
        public override void SrcReset(AllDB DBList)
        {
            this.ltvDB.SelectedIndices.Clear();

            //デザイナーを更新
            var wndSize = (Size)DBList[Database.DBIndices.System].DBs[0][(int)Database.DBSystemIndices.WindowSize, 0].Value;

            mgrDBUnit.WindowSize      = wndSize;
            mgrDBUnit.LevelExpression = DBList[Database.DBIndices.System].DBs[0][(int)Database.DBSystemIndices.EnemyLevelExpression, 0].Value?.ToString() ?? "";
            this.tolScale_SelectedIndexChanged(this, null);

            //エネミーリストを更新
            this.ltvEnemyList.BeginUpdate();
            this.ltvEnemyList.SelectedIndices.Clear();
            this.ltvEnemyList.Items.Clear();
            foreach (DataGridViewRow row in DBList[Database.DBIndices.Enemy].DBs[0].Rows)
            {
                if (row.IsNewRow)
                {
                    continue;
                }

                var newItem = new ListViewItem {
                    Text = row.Cells[(int)Database.DBDefaultColumnIndices.FixedID].Value?.ToString()
                };
                newItem.SubItems.Add(row.Cells[(int)Database.DBDefaultColumnIndices.VisibleID].Value?.ToString());
                newItem.SubItems.Add(row.Cells[(int)Database.DBDefaultColumnIndices.Name].Value?.ToString());
                newItem.SubItems.Add(mgrDBUnit.UnitOneData.EnemyDataInUnit.CalcLevel(DBList, int.Parse(row.Cells[(int)Database.DBDefaultColumnIndices.FixedID].Value?.ToString())).ToString());
                this.ltvEnemyList.Items.Add(newItem);
            }
            this.ltvEnemyList.EndUpdate();

            //ユニットリストを更新
            this.edittingListChanged(this, null);
        }
Example #2
0
        public override void SrcReset(AllDB DBList)
        {
            //デザイナービューのサイズをリセットする
            var wndSize = (Size)DBList[Database.DBIndices.System].DBs[0][(int)Database.DBSystemIndices.WindowSize, 0].Value;

            this.pnlPreview.Size   = wndSize;
            mgrDBEffect.ScreenSize = wndSize;
            mgrDBEffect.FPS        = (int)DBList[Database.DBIndices.System].DBs[0][(int)Database.DBSystemIndices.EffectFPS, 0]?.Value;

            //サウンド命令のファイル名を修正する:これは保存対象項目だがIsDirtyに関わる操作ではない
            foreach (var data in this.mgr.Data)
            {
                foreach (var order in data.Orders)
                {
                    if (order.Type == mgrDBEffect.EffectOneData.EffectOrder.OrderType.Sound)
                    {
                        //ファイル名が変更されている場合は修正する
                        var idName = Database.GetIDNameFromFixedID(DBList[Database.DBIndices.Material].DBs[(int)Database.DBMaterialIndices.Sound], int.Parse(order.Options[(int)mgrDBEffect.EffectOneData.EffectOrder.SoundOptionIndices.FixedID]));
                        if (order.Options[(int)mgrDBEffect.EffectOneData.EffectOrder.SoundOptionIndices.IDName] != idName)
                        {
                            order.Options[(int)mgrDBEffect.EffectOneData.EffectOrder.SoundOptionIndices.IDName] = idName;
                            if (this.mgr.EdittingData == data)
                            {
                                this.edittingDataChanged(this, new mgrDBEffect.DataChangedEventArgs(false, true, false, false));
                            }
                        }
                    }
                }
            }

            //エフェクトリストを更新
            this.edittingListChanged(this, null);
        }
Example #3
0
 /// <summary>
 /// 指定した命令を新規作成
 /// </summary>
 public EffectOrder(AllDB DBList, int frame, OrderType type, string[] opt)
 {
     this.dbList  = DBList;
     this.Frame   = frame;
     this.Type    = type;
     this.Options = opt;
 }
Example #4
0
 /// <summary>
 /// 仮命令を正式に作成
 /// </summary>
 public EffectOrder(AllDB DBList, EffectOrder order)
 {
     this.dbList  = DBList;
     this.Frame   = order.Frame;
     this.Type    = order.Type;
     this.Options = order.Options;
 }
Example #5
0
 public EnemyDataInUnit(int fixedID, Point pos, AllDB DBList)
 {
     this.FixedID  = fixedID;
     this.Position = pos;
     this.dbList   = DBList;
     this.Img      = null;
 }
Example #6
0
 /// <summary>
 /// コンストラクター
 /// </summary>
 public TilesetOneData(int fixedID, int visibleID, string name, string comment, AllDB DBList) : base(fixedID, visibleID, name)
 {
     this.Comment   = comment;
     this.dbList    = DBList;
     this.AutoTiles = new List <AutoTileData>();
     this.ObjTiles  = new List <ObjTileData>();
 }
Example #7
0
        /// <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();
        }
Example #8
0
        /// <summary>
        /// コンストラクター
        /// </summary>
        public dlgAddOn(AllDB mgr, string nowList)
        {
            this.InitializeComponent();
            this.Manager = mgr;

            //アドオンの効果内容リストを生成する
            this.cmbType.Items.Clear();
            Common.SetListControlKeyValuePairMode(this.cmbType);
            var addonList = DBLiteral.GetListAddon();

            foreach (var item in addonList)
            {
                this.cmbType.Items.Add(new AddonItem(item.Name, item));
            }

            //既存リストを生成する
            var list = new List <ListViewItem>();

            if (!string.IsNullOrEmpty(nowList))
            {
                var split = nowList.Split(Resources.Split_LongData.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);

                if (split != null)
                {
                    foreach (var item in split)
                    {
                        var add      = new ListViewItem();
                        var subsplit = item.Split(Resources.Split_SimpleList.ToCharArray());
                        add.Text = ((AddonItem)this.cmbType.Items[int.Parse(subsplit[(int)AddonInfoIndices.AddonType])]).Key;

                        //実際にユーザーが作成するのと同じ手順を踏むことで、DBSrcも反映される
                        //対応する関連IDを取得する
                        this.cmbType.SelectedItem   = ((AddonItem)this.cmbType.Items[int.Parse(subsplit[(int)AddonInfoIndices.AddonType])]);
                        this.cmbDBSrc.SelectedIndex = -1;
                        add.SubItems.Add("");
                        add.SubItems[add.SubItems.Count - 1].Tag = "";

                        foreach (DBListType dbitem in this.cmbDBSrc.Items)
                        {
                            //FixedIDで探索する
                            if (dbitem.Value.ToString() == subsplit[(int)AddonInfoIndices.DBItem])
                            {
                                add.SubItems[add.SubItems.Count - 1].Text = dbitem.Key;
                                add.SubItems[add.SubItems.Count - 1].Tag  = dbitem.Value.ToString();
                                break;
                            }
                        }

                        add.SubItems.Add(subsplit[(int)AddonInfoIndices.Option]);
                        list.Add(add);
                    }
                }
            }

            this.uctlListEditor.SetupList(new string[] { "内容", "関連ID", "値" }, list);
            this.cmbType.SelectedIndex = -1;
            this.cmbType_SelectedIndexChanged(this, null);
        }
Example #9
0
 /// <summary>
 /// コンストラクター
 /// </summary>
 public TileGraphicsData(AllDB DBlist, int fixedID, string rPath = null)
 {
     this.dbList  = DBlist;
     this.FixedID = fixedID;
     if (!string.IsNullOrEmpty(rPath))
     {
         this.FileName = rPath;
     }
 }
Example #10
0
        /// <summary>
        /// コンストラクター
        /// </summary>
        public dlgSelectMapTilePosition(string rPath, AllDB DBList)
        {
            this.InitializeComponent();

            //マップビューアをセットアップ
            this.uctlViewer.DBList = DBList;
            this.uctlViewer.LoadMap(rPath);
            Media.StopDraw = false;
        }
Example #11
0
        public override void SrcReset(AllDB DBList)
        {
            //グラフィックが更新されて、大きさや内容が変化する可能性があるため、ここでロードし直して更新する
            mgrDBTileset.TileSize = int.Parse(this.DBList[Database.DBIndices.System].DBs[0][(int)Database.DBSystemIndices.TileSize, 0].Value.ToString());
            if (this.mgr.EdittingData != null)
            {
                this.mgr.EdittingData.ResetCanvas();
                this.picPreview.Image = this.mgr.EdittingData.Canvas;
            }

            //タイルセットリストを更新
            this.edittingListChanged(this, null);
        }
Example #12
0
        public static Dictionary <Database.DBAddress, DataGridView> GetAllDBList(AllDB dbList)
        {
            var list = new Dictionary <Database.DBAddress, DataGridView>();

            for (var mainID = 0; mainID < dbList.Count; mainID++)
            {
                var DBs = dbList[(Database.DBIndices)mainID].DBs;
                for (var subID = 0; subID < DBs.Length; subID++)
                {
                    //KeyにはDataGridViewへのアドレスを格納する
                    list.Add(new Database.DBAddress((Database.DBIndices)mainID, subID), DBs[subID]);
                }
            }

            return(list);
        }
Example #13
0
        /// <summary>
        /// 指定したデータベースに可変IDと名前の列を追加します。
        /// </summary>
        /// <param name="db">対象オブジェクト</param>
        public static void AddStandardHeadColumns(AllDB DBList, DataGridView db)
        {
            DBColumn temp;

            temp = new DBColumnTextOneNumber(DBList, "ID", 60, int.MinValue, int.MaxValue, 0)
            {
                Frozen = true
            };
            Database.AddDBColumn(db, temp);

            temp = new DBColumnText(DBList, "名前", 150, false)
            {
                Frozen = true
            };
            Database.AddDBColumn(db, temp);
        }
Example #14
0
        /// <summary>
        /// コンストラクター
        /// </summary>
        public dlgEVcmdChangeMap(AllDB DBList, string fileName = "", int x = 0, int y = 0, int dir = (int)Map.Direction4.None)
        {
            this.InitializeComponent();
            this.uctlMapViewer.DBList = DBList;

            //既定のマップファイルを選択
            this.uctlMapTree.SelectTreeNode(fileName);

            //選択座標を予約
            this.reservedPosition = new Point(x, y);

            //向きリストを生成
            this.cmbDirection.Items.Clear();
            this.cmbDirection.Items.AddRange(Map.GetDirection4List(true));
            this.cmbDirection.SelectedIndex = dir;
        }
Example #15
0
        /// <summary>
        /// コンストラクター
        /// </summary>
        public dlgBattleTest(AllDB dbList)
        {
            this.InitializeComponent();
            Common.EnableDoubleBuffering(this);
            this.dbList = dbList;

            //ソースDBのリストを生成する
            Common.SetListControlKeyValuePairMode(this.cmbDBChar);
            Database.CreateComboBoxListFromSrcDB(this.cmbDBChar, dbList[Database.DBIndices.Char].DBs[0]);

            //既存リストを生成する
            var list = new List <ListViewItem>();

            if (!string.IsNullOrEmpty(Settings.Default.Last_BattleTestPTData))
            {
                var split = Settings.Default.Last_BattleTestPTData.Split(Resources.Split_LongData.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                if (split != null)
                {
                    foreach (var charData in split)
                    {
                        var subspl = charData.Split(Resources.Split_IDNamePair.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                        if (subspl.Length != 2)
                        {
                            continue;       //不正な形式
                        }
                        var idName = Database.GetIDNameFromFixedID(this.dbList[Database.DBIndices.Char].DBs[0], int.Parse(subspl[0]));
                        if (!string.IsNullOrEmpty(idName))
                        {
                            var add = new ListViewItem {
                                Text = subspl[0]
                            };
                            add.SubItems.Add(Database.GetIDFromIDName(idName).ToString());
                            add.SubItems.Add(Database.GetNameFromIDName(idName));
                            add.SubItems.Add(subspl[1]);
                            list.Add(add);
                        }
                    }
                }
            }

            //リスト列を設定する
            this.uctlPartyEditor.SetupList(new string[] { "ID", "名前", "レベル" }, list, true, 1);
        }
Example #16
0
        /// <summary>
        /// コンストラクター
        /// </summary>
        public dlgEditColumn(DBColumn col, DataGridView dgv, CtrlComponent.Database.ctlDatabaseEditor mgr)
        {
            this.InitializeComponent();
            this.dbList = mgr.DBList;
            this.uctlMyList.SetupList(new string[] { "項目名" }, null);

            //依存先データベースリストを生成
            var dblist = mgr.GetAllDBList();

            ComboBox[] tgt = { this.cmbDBsList, this.cmbDBsIDNames, this.cmbButtonSrcDB };
            foreach (var cmb in tgt)
            {
                Common.SetListControlKeyValuePairMode(cmb);
                foreach (var db in dblist)
                {
                    var name = mgr.GetDBName(db.Key);
                    if (string.IsNullOrEmpty(name) == false && db.Value.AllowUserToAddRows)
                    {
                        cmb.Items.Add(new DBListType(name, db.Key));
                    }
                }
            }

            //ComboBoxの項目を選択する処理の定義
            var restoreSrcDB = new Action <ComboBox, Database.DBAddress>((cmb, address) => {
                var i = 0;
                foreach (DBListType cmbList in cmb.Items)
                {
                    if (address == new Database.DBAddress(cmbList.Value.MainID, cmbList.Value.SubID))
                    {
                        cmb.SelectedIndex = i;
                        break;
                    }
                    i++;
                }
            });

            //既存データを復元する
            if (col == null)
            {
                return;     //新規作成の場合は処理しない
            }

            this.txtHeaderText.Text = col.HeaderText;

            //クラスの継承関係の都合上、末端の派生先から先に確認していく
            if (col is DBColumnTextNumbers)
            {
                //テキスト系
                this.tbcFormType.SelectedIndex = (int)DBColumnType.TextNumbers;
                this.numIntsMax.Value          = ((DBColumnTextOneNumber)col).MaxValue;
                this.numIntsMin.Value          = ((DBColumnTextOneNumber)col).MinValue;
            }
            else if (col is DBColumnTextOneNumber)
            {
                this.tbcFormType.SelectedIndex = (int)DBColumnType.TextOneNumber;
                this.numOneIntMax.Value        = ((DBColumnTextOneNumber)col).MaxValue;
                this.numOneIntMin.Value        = ((DBColumnTextOneNumber)col).MinValue;
            }
            else if (col is DBColumnTextIDNames)
            {
                this.tbcFormType.SelectedIndex  = (int)DBColumnType.TextIDNames;
                this.chkTextIDValueMode.Checked = false;
                restoreSrcDB(this.cmbDBsIDNames, ((DBColumnTextIDNames)col).SrcDBAddress);
            }
            else if (col is DBColumnTextIDValues)
            {
                this.tbcFormType.SelectedIndex  = (int)DBColumnType.TextIDNames;
                this.chkTextIDValueMode.Checked = true;
                restoreSrcDB(this.cmbDBsIDNames, ((DBColumnTextIDValues)col).SrcDBAddress);
            }
            else if (col is DBColumnListDB)
            {
                //リスト系
                this.tbcFormType.SelectedIndex = (int)DBColumnType.List;
                this.rdbFromDB.Checked         = true;
                restoreSrcDB(this.cmbDBsList, ((DBColumnListDB)col).SrcDBAddress);
            }
            else if (col is DBColumnListUser)
            {
                this.tbcFormType.SelectedIndex = (int)DBColumnType.List;
                this.rdbFromMyList.Checked     = true;
                var editList = new List <ListViewItem>();
                foreach (var item in ((DBColumnListUser)col).SrcMyList)
                {
                    editList.Add(new ListViewItem(item));
                }
                this.uctlMyList.SetupList(new string[] { "項目名" }, editList);
            }
            else if (col is DBColumnButtonInputIDNames)
            {
                //ボタン系
                this.tbcFormType.SelectedIndex    = (int)DBColumnType.Button;
                this.rdbButtonIDNames.Checked     = true;
                this.chkButtonIDValueMode.Checked = false;
                restoreSrcDB(this.cmbButtonSrcDB, ((DBColumnButtonInputIDNames)col).SrcDBAddress);
                this.numIDNameSetterDestColumnIndex.Value = ((DBColumnButtonInputIDNames)col).DestColumnIndex;
            }
            else if (col is DBColumnButtonInputIDValues)
            {
                this.tbcFormType.SelectedIndex    = (int)DBColumnType.Button;
                this.rdbButtonIDNames.Checked     = true;
                this.chkButtonIDValueMode.Checked = true;
                restoreSrcDB(this.cmbButtonSrcDB, ((DBColumnButtonInputIDValues)col).SrcDBAddress);
                this.numIDNameSetterDestColumnIndex.Value = ((DBColumnButtonInputIDValues)col).DestColumnIndex;
            }
            else if (col is DBColumnButtonSelectFile)
            {
                this.tbcFormType.SelectedIndex          = (int)DBColumnType.Button;
                this.rdbButtonFileSelect.Checked        = true;
                this.numFileSetterDestColumnIndex.Value = ((DBColumnButtonSelectFile)col).DestColumnIndex;
            }
            else if (col is DBColumnText)
            {
                //基本系
                this.tbcFormType.SelectedIndex = (int)DBColumnType.Text;
            }
            else if (col is DBColumnBool)
            {
                this.tbcFormType.SelectedIndex = (int)DBColumnType.Bool;
            }
            else if (col is DBColumnPictureFile)
            {
                this.tbcFormType.SelectedIndex = (int)DBColumnType.PictureFile;
            }
        }
Example #17
0
        private readonly bool valueMode;             //共通変数を挿入するモードであるかどうか

        /// <summary>
        /// コンストラクター
        /// </summary>
        /// <param name="DBList">すべてのデータベース</param>
        /// <param name="isColumnMode">行ではなく列を選択するモードにするかどうか</param>
        /// <param name="isValueMode">共通変数を選択するモードにするかどうか</param>
        public dlgInsertDB(AllDB DBList, bool isColumnMode, bool isValueMode)
        {
            if (DBList == null)
            {
                //データベースのインスタンスがないと、ダイアログをセットアップできないのでキャンセル
                this.Close();
                return;
            }

            this.InitializeComponent();
            this.dbList    = DBList;
            this.valueMode = isValueMode;

            if (isValueMode)
            {
                //共通変数を挿入するモード
                this.columnMode = false;
                this.chkColumnNameMode.Visible = false;       //列名は挿入できない

                //共通変数限定のデータベースリストを生成する
                this.lstDB.Items.Clear();
                Common.SetListControlKeyValuePairMode(this.lstDB);
                for (var i = 0; i <= (int)Database.DBValueIndices.CommonString; i++)
                {
                    var dbKey = new Database.DBAddress(Database.DBIndices.Value, i);
                    this.lstDB.Items.Add(new DBListType(CtrlComponent.Database.ctlDatabaseEditor.GetDBName(this.dbList, dbKey), dbKey));
                }
            }
            else
            {
                //データベース項目を挿入するモード
                this.columnMode = isColumnMode;
                this.chkColumnNameMode.Visible = isColumnMode;
                this.chkColumnNameMode.Checked = false;

                //データベースリストを生成する
                this.lstDB.Items.Clear();
                Common.SetListControlKeyValuePairMode(this.lstDB);
                var dblist = CtrlComponent.Database.ctlDatabaseEditor.GetAllDBList(this.dbList);
                foreach (var db in dblist)
                {
                    var name = CtrlComponent.Database.ctlDatabaseEditor.GetDBName(this.dbList, db.Key);
                    if (string.IsNullOrEmpty(name) == false && db.Value.AllowUserToAddRows)
                    {
                        this.lstDB.Items.Add(new DBListType(name, db.Key));
                    }
                }
            }

            //項目リストの列をセットアップする
            this.ltvDBItem.Columns.Clear();
            if (!isColumnMode)
            {
                //項目モード
                this.ltvDBItem.Columns.Add("FixedID", 0);
                this.ltvDBItem.Columns.Add("ID", 60);
                this.ltvDBItem.Columns.Add("名前", 150);
            }
            else
            {
                //列名モード
                this.ltvDBItem.Columns.Add("Index", 60);
                this.ltvDBItem.Columns.Add("名前", 150);
            }

            //既定のデータベースを選択する
            this.lstDB.SelectedIndex = (Settings.Default.Last_DBType < this.lstDB.Items.Count) ? Settings.Default.Last_DBType : 0;
        }
Example #18
0
 /// <summary>
 /// コンストラクター
 /// </summary>
 public EffectOneData(int fixedID, int visibleID, string name, int frameLangth, Database.DBEffectViewPosition dest, AllDB DBList) : base(fixedID, visibleID, name)
 {
     this.Layers      = new List <EffectLayer>();
     this.Orders      = new List <EffectOrder>();
     this.FrameLength = frameLangth;
     this.DrawDest    = dest;
     this.DBList      = DBList;
 }
Example #19
0
        /// <summary>
        /// コンストラクター
        /// </summary>
        public dlgMapTest(AllDB dbList, MapOneData mapData)
        {
            this.InitializeComponent();
            Common.EnableDoubleBuffering(this);
            this.dbList  = dbList;
            this.mapData = mapData;

            //変数種別リストを生成する
            this.cmbValueType.Items.Clear();
            for (var i = 0; i <= (int)Database.DBValueIndices.CommonString + 1; i++)
            {
                switch ((Database.DBValueIndices)i)
                {
                case Database.DBValueIndices.CommonFlag:
                    this.cmbValueType.Items.Add($"{i}:スクリプト共通フラグ");
                    break;

                case Database.DBValueIndices.CommonInteger:
                    this.cmbValueType.Items.Add($"{i}:スクリプト共通整数");
                    break;

                case Database.DBValueIndices.CommonString:
                    this.cmbValueType.Items.Add($"{i}:スクリプト共通文字列");
                    break;

                default:
                    this.cmbValueType.Items.Add($"{i}:イベント個別変数");
                    break;
                }
            }

            //変数リストは暫定的なので無効化
            this.cmbValues.Items.Clear();
            this.cmbValues.Enabled = false;

            //イベントリストを生成
            //イベントリストはイベント個別変数が選択されたときのみ有効なので初期状態では無効化とする
            this.cmbEVs.Items.Clear();
            for (int i = 0; i < mapData.EVCount; i++)
            {
                this.cmbEVs.Items.Add($"{mapData[i].VisibleID}:{mapData[i].Name}");
            }
            this.cmbEVs.Enabled = false;

            //既存リストを生成する
            var list = new List <ListViewItem>();
            var buf  = Settings.Default.Last_MapTestValueData;
            var spl  = buf.Split(Resources.Split_SimpleList.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);

            foreach (var statement in spl)
            {
                var add = new ListViewItem();
                buf = statement;

                //FixedIDを取得する
                string fixedID   = null;
                int    evFixedID = -1;
                string value     = "";
                if (statement.Contains("="))
                {
                    //スクリプト共通変数
                    fixedID = statement.Substring(2, statement.IndexOf("=") - 2);    //頭2文字以降の文字列から = まで
                    value   = Common.CutDoubleQuotation(statement.Substring(statement.IndexOf("=") + 1));
                }
                else
                {
                    //イベント個別変数
                    var regux = new Regex(Resources.Requx_SQSelfValueForMapTest);
                    var match = regux.Match(statement);
                    if (!match.Success || match.Groups.Count != 4)
                    {
                        //無効なフォーマット
                        continue;
                    }
                    if (!int.TryParse(match.Groups[1].Value, out evFixedID))
                    {
                        //無効なフォーマット
                        continue;
                    }
                    fixedID = match.Groups[2].Value;
                    value   = match.Groups[3].Value;
                }
                add.Text = fixedID.ToString();

                //種別を判定する
                var subDB          = -1;
                var valueTypeIndex = -1;
                var type           = buf.Substring(0, 2);
                if (type == Resources.SQ_UserFlag)
                {
                    subDB          = (int)Database.DBValueIndices.CommonFlag;
                    valueTypeIndex = subDB;
                }
                else if (type == Resources.SQ_UserInteger)
                {
                    subDB          = (int)Database.DBValueIndices.CommonInteger;
                    valueTypeIndex = subDB;
                }
                else if (type == Resources.SQ_UserString)
                {
                    subDB          = (int)Database.DBValueIndices.CommonString;
                    valueTypeIndex = subDB;
                }
                else
                {
                    //イベント個別変数
                    subDB          = (int)Database.DBValueIndices.SelfEvent;
                    valueTypeIndex = this.cmbValueType.Items.Count - 1;
                }

                //種別と変数名をセットする
                add.SubItems.Add(this.cmbValueType.Items[valueTypeIndex].ToString());
                add.SubItems.Add(Database.GetIDNameFromFixedID(this.dbList[Database.DBIndices.Value].DBs[subDB], int.Parse(fixedID)));

                //値をセットする
                add.SubItems.Add(value);

                if (evFixedID != -1)
                {
                    //イベントをセットする
                    add.SubItems.Add(this.getEVVisibleIDNamePairFromFixedID(evFixedID) ?? $"{dlgMapTest.NotFoundEVIDPrefix}:{evFixedID}");
                }
                else
                {
                    add.SubItems.Add("");
                }

                list.Add(add);
            }

            //リスト列を設定する
            this.uctlListEditor.SetupList(new string[] { "種別", "変数", "値", "イベント" }, list, true, 1);
        }
Example #20
0
 /// <summary>
 /// このデータベース編集画面に切り替わったときに他のデータベースを参照する部分を更新します。
 /// </summary>
 public virtual void SrcReset(AllDB DBList)
 {
 }
Example #21
0
 /// <summary>
 /// コンストラクター
 /// </summary>
 public mgrDBEffect(AllDB DBList, DataGridView mydb, EffectDrawObject drawer) : base(DBList, mydb)
 {
     this.Drawer = drawer;
 }
Example #22
0
 public static string GetDBName(AllDB dbList, Database.DBAddress address)
 {
     return(dbList[address.MainID]?.DBs[address.SubID]?.Tag?.ToString());
 }
Example #23
0
 /// <summary>
 /// データベースのインスタンスをセットする
 /// </summary>
 public void SetDBList(AllDB DBList)
 {
     this.dbList = DBList;
     Database.CreateComboBoxListFromSrcDB(this.cmbFaceMsg, this.dbList[Database.DBIndices.Material].DBs[(int)Database.DBMaterialIndices.Face], true);
 }
Example #24
0
        /// <summary>
        /// コンストラクター
        /// </summary>
        public dlgMapSettings(AllDB DBList, string title, CtrlComponent.Map.mgrMapObject.MapOneData data)
        {
            this.InitializeComponent();
            Common.EnableDoubleBuffering(this);
            this.Text = title;

            //設定対象が存在しない場合はダイアログを開かない
            this.result = data;
            if (data == null)
            {
                this.DialogResult = DialogResult.Cancel;
                this.Close();
                return;
            }

            //NOTE: マップ情報 IN
            //初期設定
            this.uctlMapSize.Maximum = new Point(Map.MaxMapSize);
            this.cmbMapLoopType.Items.AddRange(Map.GetMapLoopTypeList());
            this.cmbPTMoveSpeed.Items.AddRange(Map.GetSpeedList());
            Common.SetListControlKeyValuePairMode(this.cmbTileset);
            Database.CreateComboBoxListFromSrcDB(this.cmbTileset, DBList[Database.DBIndices.Tileset].DBs[0]);
            this.uctlPathBaseMap.FileFilter = Resources.Extension_Map;
            this.uctlPathBaseMap.RootPath   = Resources.Path_Maps;

            this.uctlPathBGM.FileFilter = Resources.Extension_Sounds;
            this.uctlPathBGM.RootPath   = Resources.Path_Materials;
            this.uctlPathBGS.FileFilter = Resources.Extension_LoopSounds;
            this.uctlPathBGS.RootPath   = Resources.Path_Materials;

            this.uctlPathBack.FileFilter = Resources.Extension_Graphics;
            this.uctlPathBack.RootPath   = Resources.Path_Materials;
            this.cmbBackScrollType.Items.AddRange(Map.GetScrollTypeList());
            this.cmbBackScrollType.SelectedIndex = (int)Map.ScrollType.None;

            this.uctlPathFog.FileFilter = Resources.Extension_Graphics;
            this.uctlPathFog.RootPath   = Resources.Path_Materials;
            this.cmbFogScrollType.Items.AddRange(Map.GetScrollTypeList());
            this.cmbFogScrollType.SelectedIndex = (int)Map.ScrollType.None;
            this.cmbFogBlend.Items.AddRange(Media.GetBlendModeList());
            this.cmbFogBlend.SelectedIndex = (int)Media.BlendMode.Alpha;

            this.uctlPathBattleBack.FileFilter = Resources.Extension_Graphics;
            this.uctlPathBattleBack.RootPath   = Resources.Path_Materials;
            Common.SetListControlKeyValuePairMode(this.cmbUnitDB);
            Database.CreateComboBoxListFromSrcDB(this.cmbUnitDB, DBList[Database.DBIndices.Unit].DBs[0]);

            //マップ設定を復元する
            this.txtName.Text                 = data.Name;
            this.uctlMapSize.Result           = new Point(data.MapSize);
            this.cmbMapLoopType.SelectedIndex = (int)data.MapLoopOption;
            Database.SelectComboBoxItemFromIDName(this.cmbTileset, Database.GetIDNameFromFixedID(DBList[Database.DBIndices.Tileset].DBs[0], data.TilesetFixedID));
            this.cmbPTMoveSpeed.SelectedIndex = (int)data.MoveSpeed;
            this.uctlPathBaseMap.Result       = data.BaseMapFileName;

            this.uctlPathBGM.Result      = data.BGM.FileName;
            this.uctlBGMEditor.SoundData = data.BGM;
            this.uctlPathBGS.Result      = data.BGS.FileName;
            this.uctlBGSEditor.SoundData = data.BGS;

            this.uctlPathBack.Result             = data.BackPictureFileName;
            this.cmbBackScrollType.SelectedIndex = (int)data.BackPictureScrollType;
            this.numBackSpeed.Value = data.BackPictureScrollSpeed;

            this.uctlPathFog.Result             = data.FogFileName;
            this.cmbFogScrollType.SelectedIndex = (int)data.FogScrollType;
            this.numFogSpeed.Value         = data.FogScrollSpeed;
            this.cmbFogBlend.SelectedIndex = (int)data.FogBlendMode;

            this.numEncounterRate.Value    = data.EncounterRate;
            this.uctlPathBattleBack.Result = data.BattleBackFileName;
            var units = new List <ListViewItem>();

            foreach (var unit in data.EncounterUnits)
            {
                var item = new ListViewItem {
                    Text = unit.ToString()
                };

                var IDName = Database.GetIDNameFromFixedID(DBList[Database.DBIndices.Unit].DBs[0], unit);
                if (string.IsNullOrEmpty(IDName))
                {
                    //存在しないFixedIDは除外する
                    continue;
                }
                item.SubItems.Add(IDName);

                units.Add(item);
            }
            this.uctlUnitList.SetupList(new string[] { "ユニット" }, units, true);
        }
Example #25
0
        /// <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;
            }
        }
Example #26
0
 /// <summary>
 /// コンストラクター
 /// </summary>
 public UserDBOneData(int fixedID, int visibleID, string name, string comment, int colCount, AllDB dbList) : base(fixedID, visibleID, name)
 {
     this.DBList      = dbList;
     this.Comment     = comment;
     this.ColumnCount = colCount;
 }
Example #27
0
 public ObjTileData(AllDB DBList, int fixedID, string rPath) : base(DBList, fixedID)
 {
     this.SetFile(rPath);
 }
Example #28
0
 /// <summary>
 /// コンストラクター
 /// </summary>
 public UnitOneData(int fixedID, int visibleID, string name, AllDB DBList) : base(fixedID, visibleID, name)
 {
     this.DBList  = DBList;
     this.Enemies = new List <EnemyDataInUnit>();
 }
Example #29
0
 /// <summary>
 /// コンストラクター
 /// </summary>
 public mgrDBTileset(AllDB DBList, DataGridView mydb) : base(DBList, mydb) { }
Example #30
0
 /// <summary>
 /// コンストラクター
 /// </summary>
 public EffectDrawObject(AllDB dbList, Control ctl, mgrDBEffect parent) : base(ctl, Media.DXInterpolation.Bilinear)
 {
     this.dbList = dbList;
     this.parent = parent;
 }