private void bExtra_Click(object sender, EventArgs e) { GameData.Desc desc = this.getDesc(this.fieldName.Text); if (desc == null) { return; } if (desc.flags == 16) { TextDialog textDialog = new TextDialog(this.fieldName.Text, this.fieldValue.Text, null); if (textDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { this.fieldValue.Text = textDialog.Text; return; } } else if (desc.defaultValue is GameData.TripleInt) { string str = ""; itemType _itemType = desc.list; if (_itemType == itemType.NULL_ITEM) { _itemType = itemType.BUILDING; str = "is node=true"; } ItemDialog itemDialog = new ItemDialog(string.Concat("选择 ", this.fieldName.Text, " 的关联"), this.nav.ou.gameData, _itemType, true, str, _itemType); if (itemDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { List <string> strs = new List <string>(); foreach (GameData.Item item in itemDialog.Items) { string str1 = item.stringID; if (desc.flags > 0) { str1 = string.Concat(str1, " ", (desc.defaultValue as GameData.TripleInt).v0.ToString()); } if (desc.flags > 1) { str1 = string.Concat(str1, " ", (desc.defaultValue as GameData.TripleInt).v1.ToString()); } if (desc.flags > 2) { str1 = string.Concat(str1, " ", (desc.defaultValue as GameData.TripleInt).v2.ToString()); } strs.Add(str1); } this.fieldValue.Text = string.Join("; ", strs); } } }
protected override void ButtonPressed() { PropertyGrid.PropertyGrid.Item item = this.mItem; PropertyGrid.PropertyGrid propertyGrid = this.mGrid; TranslationManager.TranslationDialogueLine.Line data = this.mItem.Data as TranslationManager.TranslationDialogueLine.Line; TextDialog textDialog = new TextDialog(this.mItem.Name, data.Translation, data.Original); if (textDialog.ShowDialog() == DialogResult.OK) { this.mItem = item; this.mGrid = propertyGrid; char[] chrArray = new char[] { ' ', '\n', '\r' }; base.setValue(textDialog.Value.TrimEnd(chrArray)); this.mItem = null; this.mGrid = null; } }