mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
Add restoration for woodfall mountain cleared state (#765)
* Add restoration for woodfall mountain cleared state * enum
This commit is contained in:
@@ -656,6 +656,14 @@ void DrawEnhancementsMenu() {
|
||||
UIWidgets::CVarCheckbox("Tatl ISG", "gEnhancements.Restorations.TatlISG",
|
||||
{ .tooltip = "Restores Navi ISG from OOT, but now with Tatl." });
|
||||
|
||||
if (UIWidgets::CVarCheckbox(
|
||||
"Woodfall Mountain Appearance", "gEnhancements.Restorations.WoodfallMountainAppearance",
|
||||
{ .tooltip = "Restores the appearance of Woodfall mountain to not look poisoned "
|
||||
"when viewed from Termina Field after clearing Woodfall Temple\n\n"
|
||||
"Requires a scene reload to take effect" })) {
|
||||
RegisterWoodfallMountainAppearance();
|
||||
}
|
||||
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ void InitEnhancements() {
|
||||
RegisterSideRoll();
|
||||
RegisterTatlISG();
|
||||
RegisterVariableFlipHop();
|
||||
RegisterWoodfallMountainAppearance();
|
||||
|
||||
// Cutscenes
|
||||
RegisterCutscenes();
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "Cutscenes/Cutscenes.h"
|
||||
#include "Restorations/FlipHopVariable.h"
|
||||
#include "Restorations/PowerCrouchStab.h"
|
||||
#include "Restorations/Restorations.h"
|
||||
#include "Restorations/SideRoll.h"
|
||||
#include "Restorations/TatlISG.h"
|
||||
#include "Graphics/3DItemDrops.h"
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
#ifndef ENHANCEMENTS_RESTORATIONS_H
|
||||
#define ENHANCEMENTS_RESTORATIONS_H
|
||||
|
||||
void RegisterWoodfallMountainAppearance();
|
||||
|
||||
#endif // ENHANCEMENTS_RESTORATIONS_H
|
||||
@@ -0,0 +1,31 @@
|
||||
|
||||
#include <libultraship/bridge.h>
|
||||
#include "2s2h/Enhancements/GameInteractor/GameInteractor.h"
|
||||
|
||||
extern "C" {
|
||||
#include "z64save.h"
|
||||
#include "overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h"
|
||||
}
|
||||
|
||||
typedef enum {
|
||||
/* 2 */ BGBREAKWALL_F_2 = 3, // Poisoned Woodfall Mountain
|
||||
/* 3 */ BGBREAKWALL_F_3 = 3, // Spring Woodfall Mountain
|
||||
} BgBreakwallParamEx;
|
||||
|
||||
void RegisterWoodfallMountainAppearance() {
|
||||
static HOOK_ID breakwallInitID = 0;
|
||||
GameInteractor::Instance->UnregisterGameHookForID<GameInteractor::OnActorInit>(breakwallInitID);
|
||||
breakwallInitID = 0;
|
||||
|
||||
if (!CVarGetInteger("gEnhancements.Restorations.WoodfallMountainAppearance", 0)) {
|
||||
return;
|
||||
}
|
||||
|
||||
breakwallInitID = GameInteractor::Instance->RegisterGameHookForID<GameInteractor::OnActorInit>(
|
||||
ACTOR_BG_BREAKWALL, [](Actor* actor) {
|
||||
if (BGBREAKWALL_GET_F(actor) == BGBREAKWALL_F_2 &&
|
||||
CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE)) {
|
||||
actor->params = (actor->params & 0xFFF0) | BGBREAKWALL_F_3;
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user