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

feat(resources/chat): Add toggleChat for RedM and extra parameter to set chat state #2152

Closed
wants to merge 6 commits into from

Conversation

outsider31000
Copy link

@outsider31000 outsider31000 commented Aug 8, 2023

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 resources
example:
ExecuteCommand("toggleChat hidden")

In summary:

  • use of toggleChat command for RedM users
  • extra parameter to allow resources to manipulate chat states
  • adds a chat suggestion so players are aware of what states are supported
  • smal optimisation on the look up for input for rdr gtav that was done inside the while loop
  • removed isRDR check in the future if RegisterKeymapping is implemented in RedM the check for if RegisterKeymapping should and is enough, and a future pr wont be needed here.

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
@thorium-cfx thorium-cfx changed the title feat(client): allow command params to define chat state feat(resources/chat): Add toggleChat parameter to set chat state Nov 3, 2023
@thorium-cfx thorium-cfx added the triage Needs a preliminary assessment to determine the urgency and required action label Nov 3, 2023
…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
@github-actions github-actions bot added invalid Requires changes before it's considered valid and can be (re)triaged and removed triage Needs a preliminary assessment to determine the urgency and required action labels May 19, 2024
@@ -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
Copy link
Author

@outsider31000 outsider31000 May 19, 2024

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.

@outsider31000 outsider31000 changed the title feat(resources/chat): Add toggleChat parameter to set chat state feat(resources/chat): Add toggleChat for RedM and extra parameter to set chat state May 19, 2024
@outsider31000
Copy link
Author

Closing this pr, as insignificant as it is, to allow RedM users to use toggleChat been here for months, makes no sense and basically due to the recente events of firing the only person that gave some hope for RedM users being fired the way he was fired.

@outsider31000
Copy link
Author

reopening this pr upon request.

@outsider31000 outsider31000 reopened this Jul 11, 2024
@outsider31000
Copy link
Author

#2618 this also needs to be merged, upon testing the messages dont update unless you press pageup or pagedown due to the latest commits.
In other words you cant see new messages.

Copy link
Contributor

@jakub-cfx jakub-cfx left a 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
@outsider31000
Copy link
Author

Should be good to go.

Thanks.

@jakub-cfx jakub-cfx added ready-to-merge This PR is enqueued for merging and removed invalid Requires changes before it's considered valid and can be (re)triaged labels Jul 25, 2024
@prikolium-cfx
Copy link
Contributor

8094e1e
Squashed and merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR is enqueued for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants