mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-21 23:58:51 -05:00
[GameInteractor] Update Naming Modhooks (#2543)
This commit is contained in:
parent
c1ddeec02a
commit
448b4e49d3
@ -260,7 +260,7 @@ set(Header_Files__soh__Enhancements__item_tables
|
||||
source_group("Header Files\\soh\\Enhancements\\item-tables" FILES ${Header_Files__soh__Enhancements__item_tables})
|
||||
|
||||
set(Header_Files__soh__Enhancements__mods
|
||||
"soh/Enhancements/mods/modhooks.h"
|
||||
"soh/Enhancements/mods.h"
|
||||
)
|
||||
source_group("Header Files\\soh\\Enhancements\\mods" FILES ${Header_Files__soh__Enhancements__mods})
|
||||
|
||||
@ -618,7 +618,7 @@ set(Source_Files__soh__Enhancements__item_tables
|
||||
source_group("Source Files\\soh\\Enhancements\\item-tables" FILES ${Source_Files__soh__Enhancements__item_tables})
|
||||
|
||||
set(Source_Files__soh__Enhancements__mods
|
||||
"soh/Enhancements/mods/modhooks.cpp"
|
||||
"soh/Enhancements/mods.cpp"
|
||||
)
|
||||
source_group("Source Files\\soh\\Enhancements\\mods" FILES ${Source_Files__soh__Enhancements__mods})
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||
#include "mods.h"
|
||||
#include <libultraship/bridge.h>
|
||||
#include "game-interactor/GameInteractor.h"
|
||||
|
||||
extern "C" {
|
||||
#include <z64.h>
|
||||
@ -8,7 +9,7 @@ extern PlayState* gPlayState;
|
||||
extern void Play_PerformSave(PlayState* play);
|
||||
}
|
||||
|
||||
void RegisterAutoSaveOnReceiveItem() {
|
||||
void RegisterAutoSaveOnReceiveItemHook() {
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnReceiveItem>([](u8 item) {
|
||||
if (CVarGetInteger("gAutosave", 0) && (gPlayState != NULL) && (gPlayState->sceneNum != SCENE_KENJYANOMA) && (gSaveContext.pendingSale == ITEM_NONE) && (gPlayState->sceneNum != SCENE_GANON_DEMO)) {
|
||||
if (CVarGetInteger("gAutosaveAllItems", 0)) {
|
||||
@ -63,6 +64,6 @@ void RegisterAutoSaveOnReceiveItem() {
|
||||
});
|
||||
}
|
||||
|
||||
extern "C" void RegisterModHooks() {
|
||||
RegisterAutoSaveOnReceiveItem();
|
||||
void InitMods() {
|
||||
RegisterAutoSaveOnReceiveItemHook();
|
||||
}
|
14
soh/soh/Enhancements/mods.h
Normal file
14
soh/soh/Enhancements/mods.h
Normal file
@ -0,0 +1,14 @@
|
||||
#ifndef MODS_H
|
||||
#define MODS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void InitMods();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,5 +0,0 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
void RegisterModHooks(void);
|
||||
}
|
||||
#endif
|
@ -74,7 +74,7 @@
|
||||
CrowdControl* CrowdControl::Instance;
|
||||
#endif
|
||||
|
||||
#include "Enhancements/mods/modhooks.h"
|
||||
#include "Enhancements/mods.h"
|
||||
#include "Enhancements/game-interactor/GameInteractor.h"
|
||||
#include <libultraship/libultraship.h>
|
||||
|
||||
@ -588,7 +588,7 @@ extern "C" void InitOTR() {
|
||||
OTRExtScanner();
|
||||
VanillaItemTable_Init();
|
||||
|
||||
RegisterModHooks();
|
||||
InitMods();
|
||||
|
||||
time_t now = time(NULL);
|
||||
tm *tm_now = localtime(&now);
|
||||
|
Loading…
Reference in New Issue
Block a user