Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When a Menu leads to a block that starts with Menu commands, you submit the next Menu with the same click #1057

Open
TheEmbracedOne opened this issue Jun 26, 2022 · 1 comment
Labels
bug Doing something it's not meant to, or not doing something it's meant to.

Comments

@TheEmbracedOne
Copy link

Describe the bug
I swear I had this issue in the past and I remember talking to people about it but I'm either amnesiac or imagined it or some other thing. I have a problem where if I have a set of Menu commands leading to a block that start with Menu commands, the mouseUp from the click that interacted with the first set of Menu commands will interact with the next Menus.

1) Current behaviour:
Menu "AAAAA" appears, I click it, Menu "AAAAA" disappears, Menu "BBBBB" appears, and the same click "submits" it.

2) Same setup but with an added 0.5s Wait command at the start of each Block:
there is now a minor delay before Menu "BBBBB" appears, so the same click, if the mouse wasnt held down after the click, will not "submit" the newly appearing "BBBBB" Menu, however:

3) Holding Mouse Down Problem:
If I hold down the mouse after clicking a Menu then releasing it after "BBBBB" Menu appears, it will still "submit" the next menu, even with the 0.5s Wait before it.

To Reproduce
Create a new Fungus Flowchart with just two blocks, each with at least one Menu dialogue, leading to the other block. Make sure the Menu commands display different text so it's easy to see the change. Enter play mode and click the menu appearing, and you'll observe the next set of menus will quickly appear, get clicked and disappear.

Expected behavior
When a Menu is interacted with and the next Block starts with Menu commands, there should be a minor delay before they either
A) appear
B) become interactive (probably not ideal because the player would see greyed out options before they become interactive)

Versions & Platform (please complete the following information):

  • Unity version 2020.3.3f1
  • Fungus Version v3.13.6 + some cherrypicked and custom stuff that shouldnt interfere with/cause the issue described
  • Editor OS: Win8.1
@TheEmbracedOne TheEmbracedOne added the bug Doing something it's not meant to, or not doing something it's meant to. label Jun 26, 2022
@TheEmbracedOne
Copy link
Author

TheEmbracedOne commented Jun 26, 2022

Upon further investigation I found that the culprit is button.onClick.AddListener(action);, because it, unbeknownst to me, circumvents my custom button event handler on every button in the game. I am using Rewired and I fire input events on button released, so it was very odd that upon further testing, Fungus Menu buttons kept submitting on mouse down, not up. Disabling my custom button event handler, the Menu buttons kept being interactive and submit-able, so I knew what I was looking for.

I replaced the button.onClick.AddListener(action); bit with a SendMessage that passes the UnityAction Fungus makes to my custom button event handler, so now the button successfully only submits on MouseUp (as I had intended) and the action goes through my custom button event handler.

I'm not sure if this is a problem for someone not using a custom event handler, so I'll leave my issue open for now in case anyone else with this problem stumbles upon it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Doing something it's not meant to, or not doing something it's meant to.
Projects
None yet
Development

No branches or pull requests

1 participant