private static void MultiMenuOpening(object sender, CancelEventArgs e) { TEX0Wrapper w = GetInstance <TEX0Wrapper>(); if (!ColorSmash.CanRunColorSmash) { ColorSmashSelectedToolStripMenuItem.Enabled = false; } foreach (TreeNode n in MainForm.Instance.resourceTree.SelectedNodes) { if (((TEX0Wrapper)n)?._resource.Parent == null) { DeleteSelectedToolStripMenuItem.Visible = false; DeleteSelectedToolStripMenuItem.Enabled = false; ColorSmashSelectedToolStripMenuItem.Enabled = false; break; } if (((TEX0Wrapper)n)._resource.Parent != w._resource.Parent) { ColorSmashSelectedToolStripMenuItem.Enabled = false; } } }
private static void MenuOpening(object sender, CancelEventArgs e) { TEX0Wrapper w = GetInstance <TEX0Wrapper>(); DuplicateToolStripMenuItem.Enabled = w.Parent != null; ReplaceToolStripMenuItem.Enabled = w.Parent != null; RestoreToolStripMenuItem.Enabled = w._resource.IsDirty || w._resource.IsBranch; MoveUpToolStripMenuItem.Enabled = w.PrevNode != null; MoveDownToolStripMenuItem.Enabled = w.NextNode != null; DeleteToolStripMenuItem.Enabled = w.Parent != null; if (w._resource.Name.StartsWith("InfStc.") && Regex.Match(w._resource.Name, @"(\.\d+)?$").Success&& w._resource.Name.LastIndexOf(".") > 0 && w._resource.Name.LastIndexOf(".") <= w._resource.Name.Length && int.TryParse( w._resource.Name.Substring(w._resource.Name.LastIndexOf(".") + 1, w._resource.Name.Length - (w._resource.Name.LastIndexOf(".") + 1)), out int _)) { ConvertStocksToolStripMenuItem.Enabled = true; ConvertStocksToolStripMenuItem.Visible = true; ConvertStocksToolStripMenuItem.Text = w._resource.Name.Length == 10 ? "Convert to Expanded 50-Stock System" : "Convert to Default Stock System"; } else { ConvertStocksToolStripMenuItem.Enabled = false; ConvertStocksToolStripMenuItem.Visible = false; } }
private static void MenuOpening(object sender, CancelEventArgs e) { TEX0Wrapper w = GetInstance <TEX0Wrapper>(); _menu.Items[3].Enabled = _menu.Items[10].Enabled = w.Parent != null; _menu.Items[4].Enabled = w._resource.IsDirty || w._resource.IsBranch; _menu.Items[6].Enabled = w.PrevNode != null; _menu.Items[7].Enabled = w.NextNode != null; }
private static void MenuOpening(object sender, CancelEventArgs e) { TEX0Wrapper w = GetInstance <TEX0Wrapper>(); ReplaceToolStripMenuItem.Enabled = w.Parent != null; RestoreToolStripMenuItem.Enabled = w._resource.IsDirty || w._resource.IsBranch; MoveUpToolStripMenuItem.Enabled = w.PrevNode != null; MoveDownToolStripMenuItem.Enabled = w.NextNode != null; DeleteToolStripMenuItem.Enabled = w.Parent != null; }