-
Notifications
You must be signed in to change notification settings - Fork 158
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
Pause Menu Event #597
Pause Menu Event #597
Conversation
@@ -1,5 +1,6 @@ | |||
local statusInterval = require 'config.client'.statusIntervalSeconds | |||
local playerState = LocalPlayer.state | |||
local Active = false |
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.
The Active
variable isn't really necessary as IsPauseMenuActive()
already returns a boolean value. Additionally, local variables should be camelCase.
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.
The variable is needed to capture the old state to understand if there is a change.
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.
Will multiple resources be consuming this event? What are some of the use cases?
yes multiple resources will be using this event to check if the pausemenu is active so they can hide the ui on the screen or to cancel some action the player is performing |
Why should core own the pause menu event rather than hud? |
because its not just for hiding ui its for other stuff like to cancel the player action it opens pausemenu or just not hud ui for other ui elements in server too to check if the player opens the pausemenu so it just hide the ui,and if the hud handles this event all the other scripts that are using this event not just to hide ui but to limit actions or cancel the action if it gets activated will be dependent on the hud resource |
i was working on the hud and thought this event can be good in the core cause the dev will not have to create the pause menu logic in every script he want to use and also because i have seen it in other frameworks so i thought this could be a nice little pull request in the core, let me know if we can have something similar or anything like this in the core