-
Notifications
You must be signed in to change notification settings - Fork 56
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
Merge hook-docs branch #430
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Using the Hook library, all ACF hooks have been loaded onto the gamemode table.
- Replaced use of hook.Call with hook.Run
- Added serverside ACF_PlayerChangedZone and ACF_ProtectionModeChanged hooks to the gamemode table.
- Removed ACF_OnReceivedModelData and ACF_OnRequestedModelData hooks as they had pretty much no use outside of their niche. - Renamed ModelData.QueueRefresh to ModelData.CallOnReceive for better understanding of what the function does. - Added ModelData.RunCallbacks function.
- The hook has been renamed to ACF_OnRepositoryFetch
- Renamed ACF_AllowMenuOption to ACF_OnMenuOptionEnable. - Renamed ACF_AllowMenuItem to ACF_OnMenuItemEnable. - Both hooks will no longer receive the order index as the first argument as it served no use.
- All hooks used by ACF will have to follow the pattern: ACF_[Pre/On/Post][Action in present tense][Affected]. - Added clientside ACF_PreLoadClientSettings hook. - Added clientside ACF_PreLoadServerSettings hook. - Added clientside ACF_PostLoadClientSettings. - Added ACF_PostLoadServerSettings hook. - Renamed ACF_OnRepositoryFetch to ACF_OnFetchRepository. - Renamed ACF_OnMenuOptionEnable to ACF_OnEnableMenuOption. - Renamed ACF_OnMenuItemEnable to ACF_OnEnableMenuItem. - Renamed ACF_OnClientSettingsLoaded to ACF_OnLoadClientSettings. - Renamed ACF_OnServerSettingsLoaded to ACF_OnLoadServerSettings.
- Updated all existing menu creation hooks to the current naming convention standard. - ACF.CreateAmmoMenu and ACF.UpdateAmmoMenu functions will no longer have a second argument for Settings, as the functionality of these has been replaced with hooks. - Added clientside “ACF_OnCreateAmmoMenu” hook. - Added clientside “ACF_PreCreateAmmoPreview” hook. - Added clientside “ACF_PreCreateTracerControls” hook. - Added clientside “ACF_OnCreateTracerControls” hook. - Added clientside “ACF_PreCreateAmmoInformation” hook. - Added clientside “ACF_PreCreateCrateInformation” hook. - Renamed clientside “ACF_SetupAmmoMenuSettings” hook to “ACF_PreCreateAmmoMenu”. - Renamed clientside “ACF_AddAmmoPreview” hook to “ACF_OnCreateAmmoPreview”. - Renamed clientside “ACF_OnAmmoControlsCreate” hook to “ACF_OnCreateAmmoControls”. - Renamed clientside “ACF_AddCrateDataTrackers” hook to “ACF_OnCreateCrateInformation”. - Renamed clientside “ACF_AddAmmoInformation” hook to “ACF_OnCreateAmmoInformation”.
- Renamed ACF_BulletEffect hook to ACF_OnCreateBulletEffect. - The hook will no longer receive the ammo type as the only argument, instead it'll receive the effect itself and the bullet data used by it. - The hook will no longer have to return a function to override EFFECT.ApplyMovement, since it can now do it within itself.
- Renamed ACF_DrawBoxes hook to ACF_OnDrawBoxes.
- Renamed ACF_OnAddonLoaded hook to ACF_OnLoadAddon
- Renamed ACF_OnRequestedModelData to ACF_OnRequestModelData - Renamed ACF_OnReceivedModelData to ACF_OnReceiveModelData
- ACF_OnNewGroup => ACF_OnCreateGroup - ACF_OnNewGroupItem => ACF_OnCreateGroupItem - ACF_OnNewItem => ACF_OnCreateItem - ACF_OnClassLoaded => ACF_OnLoadClass - ACF_OnServerDataUpdate => ACF_OnUpdateServerData - ACF_OnClientDataUpdate => ACF_OnUpdateClientData - ACF_OnClock => ACF_OnTick - ACF_GetDisplayData => ACF_OnGetDisplayData - ACF_UpdateRoundData => ACF_OnUpdateRound - ACF_OnEntityResized => ACF_OnResizeEntity
- ACF_OnPlayerLoaded => ACF_OnLoadPlayer - ACF_IsLegal => ACF_OnCheckLegal - ACF_KEShove => ACF_OnPushEntity
Also added documentation for a few hooks that have been added in the meantime
- Changed some hooks explicitly comparing to boolean values despite they now have an explicit default value if unused/none given.
thecraftianman
approved these changes
Sep 23, 2024
Closes #159 |
- Removed GM:ACF_CanUpdateEntity as GM:ACF_PreUpdateEntity does the exact same except with more arguments. - Removed GM:ACF_CanCreateEntity as it serves a similar purpose than GM:PlayerSpawnSENT.
Also added docs for ACF_OnLoadPersistedData
ACF_OnGetDisplayData -> ACF_OnRequestDisplayData ACF_[Pre/On]Entity[Spawn/Update] -> ACF_[Pre/On][Spawn/Update]Entity
Everything finally appears to be relatively in order with both this branch and the corresponding one on the Missiles repo, so I'm pushing this to dev so that we can verify this doesn't contain any (internally) breaking changes before the final release. |
thecraftianman
added a commit
that referenced
this pull request
Jan 22, 2025
Fixes the weapons menus being broken after merging #430
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Besides testing any possible issues we might have overlooked, this pull request is meant to be used as an announcement for this upcoming change.
TLDR: Most, if not all, hooks were renamed to follow a strict naming convention:
ACF_[Pre/On/Post][ACTION][ACTOR]
.To go a little bit more in-depth, we want to make sure hooks remain consistent in both the way they're written and the way they're employed. All our hooks will use
PascalCase
for the capitalization and begin with theACF_
prefix.After that, you have to choose between
Pre
,On
andPost
for the moment in which this hook is being called.Pre
implies the action hasn't happened yet, as such you should be able to stop it from happening with this hook.On
means the action is about to happen, you shouldn't be able to stop it by now.Post
means the action has already happened.Following that, you need to add your
ACTION
, this needs to be a verb in present tense.You end up with the
ACTOR
of the hook, this will be the thing affected by the action.