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

[GameInteractor] Game Hooks #2481

Merged
merged 8 commits into from
Feb 15, 2023
Merged

Conversation

dcvz
Copy link
Contributor

@dcvz dcvz commented Feb 15, 2023

Add game hooks for:

  • OnItemReceive
  • OnSceneInit
  • OnSaveFile
  • OnLoadFile
  • OnDeleteFile

As an example migrates autosave functionality to the new hooks API

Build Artifacts

Copy link
Contributor

@briaguya-ai briaguya-ai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one little question about why "OnSaveFile" is being called on save load, otherwise looking great!

@@ -754,6 +756,7 @@ void SaveManager::LoadFile(int fileNum) {
break;
}
InitMeta(fileNum);
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnSaveFile>(fileNum);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why call "OnSaveFile" when we're loading a file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo :( fixed!

@dcvz dcvz merged commit 8934274 into HarbourMasters:develop Feb 15, 2023
@dcvz dcvz deleted the feature/gi-game-hooks branch February 15, 2023 19:30
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.

2 participants