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

The current target is not refreshed when options in nearby zones hidden states are changed #177

Open
FrazzIe opened this issue Jan 12, 2025 · 0 comments

Comments

@FrazzIe
Copy link

FrazzIe commented Jan 12, 2025

Overview

I was making use of a box zone through addBoxZone export that had options that would control the state of other options such as:

Option 1. Allow Feature X
Option 2. Disable Feature X

using canInteract to only show allow when its disabled and vice versa to emulate toggling an option.
(If there is supported way of using an option as a toggle with a dynamic label, please let me know but it didn't look like it).

Expected outcome

I would expect that when clicking "Allow Feature X" it is then hidden and replaced with "Disable Feature X"

Actual outcome

Nothing happens, the option is selected and the attached functionality runs but the shown options aren't refreshed.

Potential fix

I've dug around the codebase and I've noticed there is builtin checks for shouldHide for nearbyZones and when debugging those changes are applied it's just the menu that is not refreshed.

newOptions gets set to true.

This logic block seems to control if the options should be refreshed or not:

Go to

if hasTarget == 1 and options.size > 1 then
    hasTarget = true
end

Which only checks the home menu? or the "main" options and not the zones.

I've made this change locally and it has resolved my problem but has not been tested further than that:

if hasTarget == 1 and (totalOptions - hidden) > 1 then
    hasTarget = true
 end

Where only total visible options are taken into account, as we don't want to refresh if there is nothing to show.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant