private bool ResourceRequestWasSubmitted(ItemID requestedItem, int requestQuantity) { // Grab a bunch of references to various scripts in the Notebook NotebookUI notebook = GameManager.Instance.NotebookUI; ReviewedResourceRequestDisplay reviewDisplay = notebook.GetComponentInChildren <ReviewedResourceRequestDisplay>(true); ReviewedResourceRequest review = reviewDisplay.LastReviewConfirmed; // If there is a review that was just confirmed then check if it was the correct request if (review != null) { ResourceRequest request = review.Request; return(request.ItemRequested == requestedItem && request.QuantityRequested == requestQuantity); } else { return(false); } }
private void FreezeUntilResourceRequestSubmitted(ItemID requestedItem, int requestQuantity) { // Grab a bunch of references to various scripts in the Notebook NotebookUI notebook = GameManager.Instance.NotebookUI; ConceptsUI concepts = notebook.GetComponentInChildren <ConceptsUI>(true); ResourceRequestEditor requestEditor = notebook.ResourceRequestEditor; ReviewedResourceRequestDisplay reviewDisplay = notebook.GetComponentInChildren <ReviewedResourceRequestDisplay>(true); TMP_InputField quantityInput = requestEditor.QuantityInput; ItemDropdown itemRequestedDropdown = requestEditor.ItemRequestedDropdown; // Freeze conversation until correct review was confirmed FreezingScheduler.FreezeUntilConditionIsMet(() => ResourceRequestWasSubmitted(requestedItem, requestQuantity), HighlightingScheduler.ClearHighlights); HighlightingScheduler.SetHighlights(HighlightNotebookButton(), HighlightNotebookTabButton(NotebookTab.Concepts), HighlightItemDropdown(itemRequestedDropdown, requestedItem)[0], HighlightItemDropdown(itemRequestedDropdown, requestedItem)[1], HighlightInputField(quantityInput, requestQuantity.ToString()), new ConditionalHighlight() { predicate = () => !reviewDisplay.gameObject.activeInHierarchy, target = () => concepts.RequestButton.transform as RectTransform }); }