private void deleteWordSwap_Click(object sender, EventArgs e) { baseForm mdiParent = base.MdiParent as baseForm; TranslationManager.TranslationDialogue selectedItem = this.listItems.SelectedItem as TranslationManager.TranslationDialogue; mdiParent.nav.ou.gameData.deleteItem(selectedItem.Item); TranslationManager.EnabledWordSwaps.Remove(selectedItem); this.listItems.Items.Remove(selectedItem); this.RefreshList(); }
public ModInfo(baseForm parent) { this.parentForm = parent; this.InitializeComponent(); base.ShowIcon = true; base.Icon = System.Drawing.Icon.FromHandle(Resources.UIAboutBox.GetHicon()); this.cbVisiblity.SelectedIndex = 0; this.pbUpload.Visible = false; this.lbUploadStatus.Visible = false; }
private void newWordSwap_Click(object sender, EventArgs e) { baseForm mdiParent = base.MdiParent as baseForm; GameData.Item item = mdiParent.nav.ou.gameData.createItem(itemType.WORD_SWAPS); TranslationManager.TranslationDialogue translationDialogue = new TranslationManager.TranslationDialogue(item); TranslationManager.EnabledWordSwaps.Add(translationDialogue); this.listItems.Items.Add(translationDialogue); mdiParent.nav.showItemProperties(item); }
private void openItemToolStripMenuItem_Click(object sender, EventArgs e) { baseForm mdiParent = base.MdiParent as baseForm; foreach (object selectedItem in this.errorList.SelectedItems) { Errors.Item tag = ((ListViewItem)selectedItem).Tag as Errors.Item; mdiParent.nav.showItemProperties(tag.item); } }
private void errorList_DoubleClick(object sender, EventArgs e) { if (this.errorList.SelectedItems.Count == 0) { return; } baseForm mdiParent = base.MdiParent as baseForm; Errors.Item tag = this.errorList.SelectedItems[0].Tag as Errors.Item; mdiParent.nav.showItemProperties(tag.item); }
private void listItems_DoubleClick(object sender, EventArgs e) { TranslationManager.TranslationDialogue selectedItem = this.listItems.SelectedItem as TranslationManager.TranslationDialogue; if (selectedItem != null) { baseForm mdiParent = base.MdiParent as baseForm; if (selectedItem.Item.getState() == GameData.State.OWNED) { mdiParent.nav.showItemProperties(selectedItem.Item); return; } DialogTranslation dialogTranslation = new DialogTranslation(this, mdiParent.nav, selectedItem) { MdiParent = base.MdiParent }; if (this.contentFilter != null) { dialogTranslation.findLine(this.contentFilter); } dialogTranslation.Show(); } }
public InheritFiles(baseForm _nav, string baseDir, string modDir) { int i; this.parentForm = _nav; this.InitializeComponent(); this.baseDir = baseDir; this.modDir = modDir; string[] strArrays = new string[0]; try { strArrays = File.ReadAllLines(string.Concat(baseDir, "mods.cfg")); } catch (Exception exception) { } string[] strArrays1 = new string[(int)InheritFiles.FixedModsList.Length + (int)strArrays.Length]; InheritFiles.FixedMods.CopyTo(strArrays1, 0); strArrays.CopyTo(strArrays1, (int)InheritFiles.FixedModsList.Length); List <string> strs = new List <string>(); DirectoryInfo directoryInfo = new DirectoryInfo(baseDir); FileInfo[] files = directoryInfo.GetFiles("*.base"); for (i = 0; i < (int)files.Length; i++) { strs.Add(files[i].Name); } files = directoryInfo.GetFiles("*.mod"); for (i = 0; i < (int)files.Length; i++) { strs.Add(files[i].Name); } List <string> strs1 = new List <string>(); directoryInfo = new DirectoryInfo(modDir); if (directoryInfo.Exists) { DirectoryInfo[] directories = directoryInfo.GetDirectories(); List <string> strs2 = new List <string>((int)directories.Length); DirectoryInfo[] directoryInfoArray = directories; for (i = 0; i < (int)directoryInfoArray.Length; i++) { DirectoryInfo directoryInfo1 = directoryInfoArray[i]; FileInfo[] fileInfoArray = directoryInfo1.GetFiles(string.Concat(directoryInfo1.Name, ".mod")); if (fileInfoArray.Length != 0) { strs1.Add(fileInfoArray[0].Name); } } } string[] strArrays2 = strArrays1; for (i = 0; i < (int)strArrays2.Length; i++) { string str = strArrays2[i]; if (strs.Contains(str)) { this.baseList.Nodes.Add(str).Checked = true; strs.Remove(str); } else if (strs1.Contains(str)) { this.modList.Nodes.Add(str).Checked = true; strs1.Remove(str); this.defaultChecked.Add(str); } } foreach (string str1 in strs) { this.baseList.Nodes.Add(str1); } foreach (string str2 in strs1) { this.modList.Nodes.Add(str2); } System.Windows.Forms.Cursor.Current = Cursors.WaitCursor; foreach (TreeNode node in this.baseList.Nodes) { GameData.Header header = GameData.loadHeader(string.Concat(baseDir, node.Text)); node.ToolTipText = this.createToolTip(node.Text, header); node.Tag = header; } foreach (TreeNode treeNode in this.modList.Nodes) { string str3 = treeNode.Text.Substring(0, treeNode.Text.Length - 4); GameData.Header header1 = GameData.loadHeader(string.Concat(modDir, str3, "/", treeNode.Text)); treeNode.ToolTipText = this.createToolTip(treeNode.Text, header1); treeNode.Tag = header1; } System.Windows.Forms.Cursor.Current = Cursors.Default; this.updateActiveMod(); this.baseList.DrawMode = TreeViewDrawMode.OwnerDrawText; this.baseList.DrawNode += new DrawTreeNodeEventHandler(this.modList_DrawNode); this.baseList.MouseDown += new MouseEventHandler(this.modList_MouseDown); this.baseList.MouseClick += new MouseEventHandler(this.modList_MouseClick); this.baseList.MouseDoubleClick += new MouseEventHandler(this.modList_MouseClick); this.baseList.ItemDrag += new ItemDragEventHandler(this.modList_ItemDrag); this.baseList.DragDrop += new DragEventHandler(this.modList_DragDrop); this.baseList.DragOver += new DragEventHandler(this.modList_DragOver); this.modList.DrawMode = TreeViewDrawMode.OwnerDrawText; this.modList.DrawNode += new DrawTreeNodeEventHandler(this.modList_DrawNode); this.modList.MouseDown += new MouseEventHandler(this.modList_MouseDown); this.modList.MouseClick += new MouseEventHandler(this.modList_MouseClick); this.modList.MouseDoubleClick += new MouseEventHandler(this.modList_MouseClick); this.modList.ItemDrag += new ItemDragEventHandler(this.modList_ItemDrag); this.modList.DragDrop += new DragEventHandler(this.modList_DragDrop); this.modList.DragOver += new DragEventHandler(this.modList_DragOver); this.btnNewTranslation.Enabled = false; this.cbActiveTranslation.Enabled = false; }