forked from HarbourMasters/Shipwright
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed9692c
commit bfd54ab
Showing
6 changed files
with
58 additions
and
48 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#include "Holiday.hpp" | ||
#include <libultraship/libultraship.h> | ||
#include "soh/UIWidgets.hpp" | ||
#include "soh/Enhancements/game-interactor/GameInteractor.h" | ||
#include "soh/Enhancements/custom-message/CustomMessageManager.h" | ||
#include "include/message_data_fmt.h" | ||
#include "soh/OTRGlobals.h" | ||
|
||
extern "C" { | ||
#include "macros.h" | ||
#include "functions.h" | ||
#include "variables.h" | ||
extern PlayState* gPlayState; | ||
} | ||
|
||
static void ConfigurationChanged() { | ||
COND_ID_HOOK(OnOpenText, 0x406B, IS_RANDO, [](u16 * textId, bool* loadFromMessageTable) { | ||
if (gPlayState->sceneNum != SCENE_KAKARIKO_VILLAGE) { | ||
return; | ||
} | ||
|
||
std::string message; | ||
uint8_t current = gSaveContext.triforcePiecesCollected; | ||
uint8_t required = OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT_PIECES_REQUIRED); | ||
|
||
if (current < required) { | ||
message = "The %yChristmas tree%w seems to be&missing some of %gits magic%w... Find all&ornaments to save %rChristmas%w!"; | ||
} else { | ||
message = "The tree's magic has been fully&restored. %gMerry %rChristmas%w!"; | ||
} | ||
|
||
auto messageEntry = CustomMessage(message); | ||
messageEntry.Format(); | ||
messageEntry.LoadIntoFont(); | ||
*loadFromMessageTable = false; | ||
}); | ||
} | ||
|
||
static void RegisterMod() { | ||
// #region Leave this alone unless you know what you are doing | ||
ConfigurationChanged(); | ||
// #endregion | ||
|
||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnLoadGame>([](int16_t fileNum) { | ||
ConfigurationChanged(); | ||
}); | ||
} | ||
|
||
static Holiday holiday([]() {}, RegisterMod); |
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
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
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
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
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