[Enhancement] Un-patch side rolls (#290)

This commit is contained in:
inspectredc 2024-05-03 18:34:11 +01:00 committed by Garrett Cox
parent 6fca358aa2
commit 44ded41793
7 changed files with 36 additions and 3 deletions

View File

@ -316,6 +316,14 @@ void DrawEnhancementsMenu() {
ImGui::EndMenu();
}
if (UIWidgets::BeginMenu("Restorations")) {
UIWidgets::CVarCheckbox("Side Rolls", "gEnhancements.Restorations.SideRoll", {
.tooltip = "Restores side rolling from OOT."
});
ImGui::EndMenu();
}
if (UIWidgets::BeginMenu("Graphics")) {
MotionBlur_RenderMenuOptions();
ImGui::EndMenu();

View File

@ -10,6 +10,9 @@ void InitEnhancements() {
// Masks
RegisterFierceDeityAnywhere();
// Restorations
RegisterSideRoll();
// Time Savers
RegisterTimeSaversHooks();

View File

@ -5,6 +5,7 @@
#include "Cheats/Infinite.h"
#include "Cycle/EndOfCycle.h"
#include "Masks/FierceDeityAnywhere.h"
#include "Restorations/SideRoll.h"
#include "TimeSavers/TimeSavers.h"
#ifdef __cplusplus

View File

@ -31,7 +31,8 @@ typedef enum {
// Vanilla condition: gSaveContext.showTitleCard
GI_VB_SHOW_TITLE_CARD,
GI_VB_PLAY_ENTRANCE_CS,
GI_VB_DISABLE_FD_MASK
GI_VB_DISABLE_FD_MASK,
GI_VB_PATCH_SIDEROLL,
} GIVanillaBehavior;
#ifdef __cplusplus

View File

@ -0,0 +1,10 @@
#include <libultraship/bridge.h>
#include "Enhancements/GameInteractor/GameInteractor.h"
void RegisterSideRoll() {
REGISTER_VB_SHOULD(GI_VB_PATCH_SIDEROLL, {
if (CVarGetInteger("gEnhancements.Restorations.SideRoll", 0)) {
*should = false;
}
});
}

View File

@ -0,0 +1,6 @@
#ifndef RESTORATIONS_SIDEROLL_H
#define RESTORATIONS_SIDEROLL_H
void RegisterSideRoll();
#endif // RESTORATIONS_SIDEROLL_H

View File

@ -45,6 +45,8 @@
#include "objects/object_link_nuts/object_link_nuts.h"
#include "objects/object_link_child/object_link_child.h"
#include "2s2h/Enhancements/GameInteractor/GameInteractor.h"
#define THIS ((Player*)thisx)
void Player_Init(Actor* thisx, PlayState* play);
@ -6615,8 +6617,10 @@ void func_80836AD8(PlayState* play, Player* this) {
}
void func_80836B3C(PlayState* play, Player* this, f32 arg2) {
this->currentYaw = this->actor.shape.rot.y;
this->actor.world.rot.y = this->actor.shape.rot.y;
if (GameInteractor_Should(GI_VB_PATCH_SIDEROLL, true, NULL)) {
this->currentYaw = this->actor.shape.rot.y;
this->actor.world.rot.y = this->actor.shape.rot.y;
}
if (this->transformation == PLAYER_FORM_GORON) {
func_80836AD8(play, this);