private void RefreshTabVisibility() { bool shouldAdd = DetermineIfShouldShowTab(); if (shouldAdd) { if (control == null) { control = new Gum.Plugins.AlignmentButtons.AlignmentPluginControl(); } if (!isAdded) { GumCommands.Self.GuiCommands.AddControl(control, "Alignment"); isAdded = true; } } else { if (control != null && isAdded) { GumCommands.Self.GuiCommands.RemoveControl(control); isAdded = false; } } }
private void RefreshTabVisibility() { var shouldAdd = SelectedState.Self.SelectedElement != null && SelectedState.Self.SelectedStateSave != null; if (shouldAdd) { if (SelectedState.Self.SelectedScreen != null && SelectedState.Self.SelectedInstance == null) { // screens as a whole can't be aligned shouldAdd = false; } } if (shouldAdd) { if (control == null) { control = new Gum.Plugins.AlignmentButtons.AlignmentPluginControl(); } if (!isAdded) { GumCommands.Self.GuiCommands.AddControl(control, "Alignment"); isAdded = true; } } else { if (control != null && isAdded) { GumCommands.Self.GuiCommands.RemoveControl(control); isAdded = false; } } }