Browse Source

Merge pull request #952 from breadnone/DialogInput-fix

nextLineInputFlagWon't Always Be True On Mouse Clicks
master
Steve Halliwell 4 years ago
parent
commit
23e15af36e
  1. 1
      Assets/Fungus/Docs/CHANGELOG.txt
  2. 7
      Assets/Fungus/Scripts/Components/DialogInput.cs
  3. 5
      Assets/Fungus/Scripts/Components/Writer.cs

1
Assets/Fungus/Docs/CHANGELOG.txt

@ -7,6 +7,7 @@ Unreleased
- Add missing VariableDrawer for ObjectVariable. Thanks to CG-Tespy. - Add missing VariableDrawer for ObjectVariable. Thanks to CG-Tespy.
- Fix double duplication of blocks in flowchart window. Thanks to ongjinwen. - Fix double duplication of blocks in flowchart window. Thanks to ongjinwen.
- Dialog ClickAnywhere not supports ignore click delay. Thanks to breadnone. - Dialog ClickAnywhere not supports ignore click delay. Thanks to breadnone.
- SetNextLineFlag only flags if Dialog is actually active/writing. Thanks to breadnone.
## Changed ## Changed
- Block will LogError when an exception is caught from a Command being Executed. - Block will LogError when an exception is caught from a Command being Executed.

7
Assets/Fungus/Scripts/Components/DialogInput.cs

@ -84,7 +84,7 @@ namespace Fungus
currentStandaloneInputModule = EventSystem.current.GetComponent<StandaloneInputModule>(); currentStandaloneInputModule = EventSystem.current.GetComponent<StandaloneInputModule>();
} }
if (writer != null && writer.IsWriting) if (writer != null)
{ {
if (Input.GetButtonDown(currentStandaloneInputModule.submitButton) || if (Input.GetButtonDown(currentStandaloneInputModule.submitButton) ||
(cancelEnabled && Input.GetButton(currentStandaloneInputModule.cancelButton))) (cancelEnabled && Input.GetButton(currentStandaloneInputModule.cancelButton)))
@ -149,7 +149,10 @@ namespace Fungus
/// </summary> /// </summary>
public virtual void SetNextLineFlag() public virtual void SetNextLineFlag()
{ {
nextLineInputFlag = true; if(writer.IsWaitingForInput || writer.IsWriting)
{
nextLineInputFlag = true;
}
} }
/// <summary> /// <summary>
/// Set the ClickAnywhere click flag. /// Set the ClickAnywhere click flag.

5
Assets/Fungus/Scripts/Components/Writer.cs

@ -1009,10 +1009,11 @@ namespace Fungus
public virtual void OnNextLineEvent() public virtual void OnNextLineEvent()
{ {
inputFlag = true;
if (isWriting) if (isWriting || isWaitingForInput)
{ {
inputFlag = true;
NotifyInput(); NotifyInput();
} }
} }

Loading…
Cancel
Save