-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
feat(resources/chat): Add toggleChat
for RedM and extra parameter to set chat state
#2152
Conversation
eventually we could allow arguments to hide a chat for example when players have left with it in whenactive since it uses ResourceKvp for example when they comeback if on a character selection the chat will be active. `ExecuteCommand("toggleChat hidden") ` this allows to manipulate clients chat window state in other resources
for some reason it needs a wait for this suggestion to be available in the chat resource
…mmand this pr is basically same as this https://github.com/citizenfx/fivem/pull/2151/files but this one allows an extra parameter to be passed through the toggleChat command allowing resources to execute players chat states it also optimisises the look up for isRdr or not input by doing the check outside of the while loop
@@ -227,34 +227,30 @@ local CHAT_HIDE_STATES = { | |||
local kvpEntry = GetResourceKvpString('hideState') | |||
local chatHideState = kvpEntry and tonumber(kvpEntry) or CHAT_HIDE_STATES.SHOW_WHEN_ACTIVE | |||
local isFirstHide = true | |||
|
|||
if not isRDR then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this check is redundante since we are already checking for if RegisterKeyMapping exists, so best to remove it.
This allows to one day if it is implemented to RedM to work with no modifications needed in the future.
toggleChat
for RedM and extra parameter to set chat state
Closing this pr, as insignificant as it is, to allow RedM users to use |
reopening this pr upon request. |
#2618 this also needs to be merged, upon testing the messages dont update unless you press pageup or pagedown due to the latest commits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable, one small request I'd have is to fix the indents to match the rest of the file. The new code seems to unintentionally be indented twice.
fix identation to match rest of the file isFristHide variable order back to original order
Should be good to go. Thanks. |
8094e1e |
This pr aims to allow the use of toggleChat command for RedM users.
It also allows an extra argument to use for chat states, for example when players have left session with state as
visible
since it uses ResourceKvp when they re enter it shows visble, this extra parameter allows to manipulate chat state in other resourcesexample:
ExecuteCommand("toggleChat hidden")
In summary:
if RegisterKeymapping
should and is enough, and a future pr wont be needed here.