private void HandleDialogueOptionHit(DialogueOptionUI dialogueOption) { if (_dialogueBox.GetValue <bool>("_revealingOptions")) { return; } var selectedOption = _dialogueBox.GetSelectedOption(); var options = _dialogueBox.GetValue <List <DialogueOptionUI> >("_optionsUIElements"); options[selectedOption].SetSelected(false); _dialogueBox.SetValue("_selectedOption", options.IndexOf(dialogueOption)); dialogueOption.SetSelected(true); }
private void Update() { if (_currentDialogueBox != null && OWInput.GetInputMode() == InputMode.Dialogue) { if (OWInput.IsNewlyPressed(InputLibrary.interact) || OWInput.IsNewlyPressed(InputLibrary.cancel) || OWInput.IsNewlyPressed(InputLibrary.enter) || OWInput.IsNewlyPressed(InputLibrary.enter2)) { if (!_currentDialogueBox.AreTextEffectsComplete()) { _currentDialogueBox.FinishAllTextEffects(); return; } if (_currentDialogueBox.TimeCompletelyRevealed() < 0.1f) { return; } var selectedOption = _currentDialogueBox.GetSelectedOption(); if (!InputDialogueOption(selectedOption)) { EndConversation(); return; } } else { if (OWInput.IsNewlyPressed(InputLibrary.down) || OWInput.IsNewlyPressed(InputLibrary.down2)) { _currentDialogueBox.OnDownPressed(); return; } if (OWInput.IsNewlyPressed(InputLibrary.up) || OWInput.IsNewlyPressed(InputLibrary.up2)) { _currentDialogueBox.OnUpPressed(); } } } }