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

Pause Menu Event #597

Closed
wants to merge 2 commits into from
Closed

Conversation

AfterLifeStudio
Copy link

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

@@ -1,5 +1,6 @@
local statusInterval = require 'config.client'.statusIntervalSeconds
local playerState = LocalPlayer.state
local Active = false
Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

@Manason Manason left a 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?

@AfterLifeStudio
Copy link
Author

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

@Manason
Copy link
Member

Manason commented Oct 20, 2024

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?

@AfterLifeStudio
Copy link
Author

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

client/loops.lua Show resolved Hide resolved
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.

4 participants