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(phone/photo): emit an event when exiting/entering photo mode #403

Merged
merged 1 commit into from
Dec 6, 2021

Conversation

TasoOneAsia
Copy link
Contributor

Pull Request Description

Implements and closes #384

Pull Request Checklist:

  • Have you followed the guidelines in our Contributing document and Code of Conduct?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you built and tested NPWD in-game after the relevant change?

@TasoOneAsia TasoOneAsia changed the base branch from master to develop December 3, 2021 00:17
resources/client/cl_photo.ts Outdated Show resolved Hide resolved
resources/client/cl_photo.ts Outdated Show resolved Hide resolved
@TasoOneAsia
Copy link
Contributor Author

Actually thinking about this PR and your comments more, I feel that it would be best to leave this to third party scripts through just the event. Otherwise, no matter what, edge cases may appear regarding HUD management.

@RockySouthpaw
Copy link
Contributor

Actually thinking about this PR and your comments more, I feel that it would be best to leave this to third party scripts through just the event. Otherwise, no matter what, edge cases may appear regarding HUD management.

Sg2m, will test shortly

@RockySouthpaw
Copy link
Contributor

Would it be bad to just pass a bool instead of using 2 events?

Idk if you can help it but waiting on image uploading before showing hud components may not be the best idea imo as image uploading can get hung then the components will never show.

Otherwise, this works well in testing.

AddEventHandler('npwd:PhotoModeStarted', function()
    LocalPlayer.state:set('pictureMode', true, true)
    DisplayRadar(false)
    RemoveMultiplayerHudCash()
    RemoveMultiplayerBankCash()
    TriggerEvent('WH:hideHud')
end)

AddEventHandler('npwd:PhotoModeEnded', function ()
    LocalPlayer.state:set('pictureMode', false, true)
    if not Config.hideRadar then DisplayRadar(true) end
    TriggerEvent('WH:showHud')
end)

https://i.imgur.com/bxqTwIR.jpg

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

Successfully merging this pull request may close these issues.

Enhancement: Event for hiding ui components on picture taken
2 participants