public void CloseChooseContainerPanel() { GameSettings settings = db.settings; try { if (placeholder.parentProduct.currentContainer == null) { BeingMoved(true, "No Container Selected", "Press '" + settings.GetOpenChooseContainerPanel().ToLower() + "' to choose"); } else { Box.PackagedBud packagedBud = placeholder.parentProduct.GetPackagedBud(); if (packagedBud != null) { string topString = "Moving " + packagedBud.weight + "g of " + packagedBud.strain.name; StoreObjectReference container = placeholder.parentProduct.currentContainer; string bottomString = "Container - " + container.boxWeight + "g Capacity"; BeingMoved(false, topString, bottomString); } else { print("No packaged bud"); } } } catch (System.NullReferenceException) { BeingMoved(true, "No Container Selected", "Press '" + settings.GetOpenChooseContainerPanel().ToLower() + "' to choose"); } chooseContainerPanel = null; }
public void OpenChooseContainerPanel(ProductManager.CurrentProduct currentProduct) { chooseContainerPanel = uiManager.OpenChooseContainerPanel(this, currentProduct); chooseContainerPanel.cancelButton.onClick.RemoveAllListeners(); chooseContainerPanel.cancelButton.onClick.AddListener(() => CloseChooseContainerPanel()); }