You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 7, 2023. It is now read-only.
So once the chat:removeSuggestion method is called, trying to re-add the same suggestion later basically does nothing as there is a check to avoid adding the same suggestion back (since it was never removed from the this.backingSuggestions array).
This case prevents being able to set up "context sensitive" suggestions based on some state.
I would recommend one of the following:
rename the current method to something more akin to what it's currently doing (blacklist?) and add a chat:removeSuggestion that would work as described in the docs
change the current method to work as described in the docs
IMHO, I don't think anyone has a need for "blacklisting" a chat command so I would go with the second option.
Let me know what you think.
Happy to make a PR once we agree on something.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
As seen here:
cfx-server-data/resources/[system]/chat/html/App.js
Lines 82 to 86 in 9914752
and here:
cfx-server-data/resources/[system]/chat/html/App.js
Lines 45 to 49 in 9914752
this method actually blacklists a chat command suggestion, it doesn't remove it as mentioned in the docs: https://docs.fivem.net/events/client-events/#chat-events-resource-events
So once the
chat:removeSuggestion
method is called, trying to re-add the same suggestion later basically does nothing as there is a check to avoid adding the same suggestion back (since it was never removed from thethis.backingSuggestions
array).This case prevents being able to set up "context sensitive" suggestions based on some state.
I would recommend one of the following:
chat:removeSuggestion
that would work as described in the docsIMHO, I don't think anyone has a need for "blacklisting" a chat command so I would go with the second option.
Let me know what you think.
Happy to make a PR once we agree on something.
The text was updated successfully, but these errors were encountered: