Exemple #1
0
        private void btnSelectOrigin_Click(Object sender, EventArgs e)
        {
            // 将当前选中的物件设为原始模型
            if (this._selectedElementId == null)
            {
                BstManager.DisplayErrorMessageBox(
                    this._i18N.LoadI18NValue("GuiItems", "actionSelectErrorTitle"),
                    this._i18N.LoadI18NValue("GuiItems", "actionSelectTargetErrorMsg")
                    );
                return; // 没有选中的元素,直接退出
            }
            var element = (JObject)this._data[this._selectedElementId];

            this._originElementId = this._selectedElementId;
            // 展示icon,该icon应该已经有本地缓存,直接读取本地缓存
            this.LoadOriginAndTargetIconPic(this.pictureBoxOrigin, element);
            // 显示模型数据
            this.textBoxOrigin.Text = element.ToString();
            // 存储原始模型数据
            var originData = new JObject();

            originData["id"]   = this._originElementId;
            originData["data"] = element;
            if (this._formType == BstManager.TypeAttach ||
                this._formType == BstManager.TypeCostume)
            {
                var originRace = (string)element["race"];
                if (Regex.IsMatch(originRace, BstManager.Instance.RaceTypes[BstManager.RaceIdLyn], RegexOptions.IgnoreCase))
                {
                    originRace = BstManager.Instance.RaceTypes[BstManager.RaceIdLyn];
                }
                this._originSettings[originRace] = originData;
            }
            else
            {
                this._originSettings = originData;
            }
            BstManager.WriteJsonFile(BstManager.GetItemOriginJsonPath(this._formType), this._originSettings);
        }
Exemple #2
0
        private void Init(int formType)
        {
            this._formType       = formType;
            this._originSettings = BstManager.ReadJsonFile(BstManager.GetItemOriginJsonPath(this._formType));
            // 数据列表
            this._dataTable = new DataTable();
            // icon列
            var columnIcon = new DataColumn("Icon")
            {
                DataType    = Type.GetType("System.Byte[]"),
                AllowDBNull = true,
                ColumnName  = this._i18N.LoadI18NValue("GuiItems", "tableColIcon")
            };

            //columnIcon.ReadOnly = true;
            this._dataTable.Columns.Add(columnIcon);
            // code列
            var columnCode = new DataColumn("Code")
            {
                ColumnName = this._i18N.LoadI18NValue("GuiItems", "tableColCode"),
                ReadOnly   = true
            };

            this._dataTable.Columns.Add(columnCode);

            // 数据展示列表
            this.gridItems.DataSource         = this._dataTable;
            this.gridItems.RowTemplate.Height = 64;
            // icon列
            var gridColumnIcon = this.gridItems.Columns[0];

            gridColumnIcon.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
            gridColumnIcon.Width        = 64;
            // 展示列表点击事件
            this.gridItems.CellClick += new DataGridViewCellEventHandler(this.gridItems_CellClick);
            // 展示列表鼠标滚轴事件
            this.gridItems.MouseWheel += new MouseEventHandler(this.gridItems_MouseWheel);

            // 种族选择控件
            // ReSharper disable once CoVariantArrayConversion
            this.comboBoxRace.Items.AddRange(BstManager.Instance.RaceNames.ToArray());
            this.comboBoxRace.SelectedIndex         = 0;
            this.comboBoxRace.SelectedIndexChanged += new EventHandler(this.comboBoxRace_SelectedIndexChanged);

            // 查找模型控件
            this.btnFilter.Click += new EventHandler(this.btnFilter_Click);

            // 全部恢复按钮
            this.btnTopRestoreAll.Click += new EventHandler(this.btnTopRestoreAll_Click);
            // 预览原始模型2D截图
            this.btnView2DOrigin.Click += new EventHandler(this.btnView2DOrigin_Click);
            // 预览原始模型3D模型
            this.btnView3DOrigin.Click += new EventHandler(this.btnView3DOrigin_Click);
            // 预览目标模型2D截图
            this.btnView2DTarget.Click += new EventHandler(this.btnView2DTarget_Click);
            // 预览目标模型3D模型
            this.btnView3DTarget.Click += new EventHandler(this.btnView3DTarget_Click);
            // 替换按钮
            this.btnReplace.Click += new EventHandler(this.btnReplace_Click);

            // 展示选中物件的3D模型按钮
            this.btnView3DInfo.Click += new EventHandler(this.btnView3DInfo_Click);
            // 选为原始模型按钮
            this.btnSelectOrigin.Click += new EventHandler(this.btnSelectOrigin_Click);
            // 选为目标模型按钮
            this.btnSelectTarget.Click += new EventHandler(this.btnSelectTarget_Click);
            // 报告bug按钮
            this.btnReportIssue.Click += new EventHandler(this.btnReportIssue_Click);
        }