Skip to content

Commit

Permalink
Merge branch 'develop' into customAudio2
Browse files Browse the repository at this point in the history
  • Loading branch information
louist103 authored Dec 19, 2024
2 parents bc38f2e + b1cbf80 commit 2987de8
Show file tree
Hide file tree
Showing 121 changed files with 2,158 additions and 1,659 deletions.
100 changes: 48 additions & 52 deletions mm/2s2h/BenGui/BenMenuBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <unordered_map>
#include <string>
#include "2s2h/Enhancements/Enhancements.h"
#include "2s2h/Enhancements/Graphics/Graphics.h"
#include "2s2h/Enhancements/GfxPatcher/AuthenticGfxPatches.h"
#include "2s2h/DeveloperTools/DeveloperTools.h"
#include "2s2h/Enhancements/Cheats/Cheats.h"
Expand Down Expand Up @@ -71,6 +72,12 @@ static const std::unordered_map<int32_t, const char*> timeStopOptions = {
{ TIME_STOP_TEMPLES_DUNGEONS, "Temples + Mini Dungeons" },
};

static const std::unordered_map<int32_t, const char*> dekuGuardSearchBallsOptions = {
{ DEKU_GUARD_SEARCH_BALLS_NEVER, "Never" },
{ DEKU_GUARD_SEARCH_BALLS_NIGHT_ONLY, "Night Only" },
{ DEKU_GUARD_SEARCH_BALLS_ALWAYS, "Always" },
};

namespace BenGui {
std::shared_ptr<std::vector<Ship::WindowBackend>> availableWindowBackends;
std::unordered_map<Ship::WindowBackend, const char*> availableWindowBackendsMap;
Expand Down Expand Up @@ -407,13 +414,11 @@ void DrawEnhancementsMenu() {
}

ImGui::SeparatorText("Free Look");
if (UIWidgets::CVarCheckbox(
"Free Look", "gEnhancements.Camera.FreeLook.Enable",
{ .tooltip = "Enables free look camera control\nNote: You must remap C buttons off of the right "
"stick in the controller config menu, and map the camera stick to the right stick.",
.disabled = CVarGetInteger("gEnhancements.Camera.DebugCam.Enable", 0) != 0 })) {
RegisterCameraFreeLook();
}
UIWidgets::CVarCheckbox(
"Free Look", "gEnhancements.Camera.FreeLook.Enable",
{ .tooltip = "Enables free look camera control\nNote: You must remap C buttons off of the right "
"stick in the controller config menu, and map the camera stick to the right stick.",
.disabled = CVarGetInteger("gEnhancements.Camera.DebugCam.Enable", 0) != 0 });

if (CVarGetInteger("gEnhancements.Camera.FreeLook.Enable", 0)) {
UIWidgets::CVarCheckbox("Invert Camera X Axis", "gEnhancements.Camera.RightStick.InvertXAxis",
Expand All @@ -440,12 +445,9 @@ void DrawEnhancementsMenu() {
}

ImGui::SeparatorText("'Debug' Camera");
if (UIWidgets::CVarCheckbox(
"Debug Camera", "gEnhancements.Camera.DebugCam.Enable",
{ .tooltip = "Enables free camera control.",
.disabled = CVarGetInteger("gEnhancements.Camera.FreeLook.Enable", 0) != 0 })) {
RegisterDebugCam();
}
UIWidgets::CVarCheckbox("Debug Camera", "gEnhancements.Camera.DebugCam.Enable",
{ .tooltip = "Enables free camera control.",
.disabled = CVarGetInteger("gEnhancements.Camera.FreeLook.Enable", 0) != 0 });

if (CVarGetInteger("gEnhancements.Camera.DebugCam.Enable", 0)) {
UIWidgets::CVarCheckbox("Invert Camera X Axis", "gEnhancements.Camera.RightStick.InvertXAxis",
Expand Down Expand Up @@ -646,10 +648,8 @@ void DrawEnhancementsMenu() {
"model and texture on the boot logo start screen" });
UIWidgets::CVarCheckbox("Bow Reticle", "gEnhancements.Graphics.BowReticle",
{ .tooltip = "Gives the bow a reticle when you draw an arrow" });
if (UIWidgets::CVarCheckbox("3D Item Drops", "gEnhancements.Graphics.3DItemDrops",
{ .tooltip = "Makes item drops 3D" })) {
Register3DItemDrops();
}
UIWidgets::CVarCheckbox("3D Item Drops", "gEnhancements.Graphics.3DItemDrops",
{ .tooltip = "Makes item drops 3D" });
UIWidgets::CVarCheckbox(
"Disable Black Bar Letterboxes", "gEnhancements.Graphics.DisableBlackBars",
{ .tooltip = "Disables Black Bar Letterboxes during cutscenes and Z-targeting\nNote: there may be "
Expand Down Expand Up @@ -683,11 +683,9 @@ void DrawEnhancementsMenu() {
UIWidgets::CVarCheckbox("Fierce Deity's Mask Anywhere", "gEnhancements.Masks.FierceDeitysAnywhere",
{ .tooltip = "Allow using Fierce Deity's mask outside of boss rooms." });
UIWidgets::CVarCheckbox("No Blast Mask Cooldown", "gEnhancements.Masks.NoBlastMaskCooldown", {});
if (UIWidgets::CVarCheckbox("Persistent Bunny Hood", "gEnhancements.Masks.PersistentBunnyHood.Enabled",
{ .tooltip = "Permanently toggle a speed boost from the bunny hood by pressing "
"'A' on it in the mask menu." })) {
UpdatePersistentMasksState();
}
UIWidgets::CVarCheckbox("Persistent Bunny Hood", "gEnhancements.Masks.PersistentBunnyHood.Enabled",
{ .tooltip = "Permanently toggle a speed boost from the bunny hood by pressing "
"'A' on it in the mask menu." });

ImGui::EndMenu();
}
Expand All @@ -711,9 +709,10 @@ void DrawEnhancementsMenu() {
if (UIWidgets::BeginMenu("Modes")) {
UIWidgets::CVarCheckbox("Play As Kafei", "gModes.PlayAsKafei",
{ .tooltip = "Requires scene reload to take effect." });
if (UIWidgets::CVarCheckbox("Time Moves When You Move", "gModes.TimeMovesWhenYouMove")) {
RegisterTimeMovesWhenYouMove();
}
UIWidgets::CVarCheckbox("Hyrule Warriors Young Link", "gModes.HyruleWarriorsStyledLink",
{ .tooltip = "When acquired, places the Keaton and Fierce Deity masks on Link "
"similarly to how he wears them in Hyrule Warriors" });
UIWidgets::CVarCheckbox("Time Moves When You Move", "gModes.TimeMovesWhenYouMove");
if (UIWidgets::CVarCheckbox("Mirrored World", "gModes.MirroredWorld.Mode")) {
if (CVarGetInteger("gModes.MirroredWorld.Mode", 0)) {
CVarSetInteger("gModes.MirroredWorld.State", 1);
Expand All @@ -728,12 +727,9 @@ void DrawEnhancementsMenu() {
if (UIWidgets::BeginMenu("Player")) {
UIWidgets::CVarSliderInt("Climb speed", "gEnhancements.Player.ClimbSpeed", 1, 5, 1,
{ .tooltip = "Increases the speed at which Link climbs vines and ladders." });
if (UIWidgets::CVarCheckbox("Fast Deku Flower Launch", "gEnhancements.Player.FastFlowerLaunch",
{ .tooltip =
"Speeds up the time it takes to be able to get maximum height from "
"launching out of a deku flower" })) {
RegisterFastFlowerLaunch();
}
UIWidgets::CVarCheckbox("Fast Deku Flower Launch", "gEnhancements.Player.FastFlowerLaunch",
{ .tooltip = "Speeds up the time it takes to be able to get maximum height from "
"launching out of a deku flower" });
UIWidgets::CVarCheckbox("Instant Putaway", "gEnhancements.Player.InstantPutaway",
{ .tooltip = "Allows Link to instantly puts away held item without waiting." });
UIWidgets::CVarCheckbox("Fierce Deity Putaway", "gEnhancements.Player.FierceDeityPutaway",
Expand All @@ -754,13 +750,11 @@ 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();
}
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" });

ImGui::EndMenu();
}
Expand All @@ -787,11 +781,17 @@ void DrawEnhancementsMenu() {
}

if (UIWidgets::BeginMenu("Difficulty Options")) {
if (UIWidgets::CVarCheckbox("Disable Takkuri Steal", "gEnhancements.Cheats.DisableTakkuriSteal",
{ .tooltip = "Prevents the Takkuri from stealing key items like bottles and "
"swords. It may still steal other items." })) {
RegisterDisableTakkuriSteal();
}
UIWidgets::CVarCheckbox("Disable Takkuri Steal", "gEnhancements.Cheats.DisableTakkuriSteal",
{ .tooltip = "Prevents the Takkuri from stealing key items like bottles and "
"swords. It may still steal other items." });

UIWidgets::CVarCombobox(
"Deku Guard Search Balls", "gEnhancements.Cheats.DekuGuardSearchBalls", dekuGuardSearchBallsOptions,
{ .tooltip = "Choose when to show the Deku Palace Guards' search balls\n"
"- Never: Never show the search balls. This matches Majora's Mask 3D behaviour\n"
"- Night Only: Only show the search balls at night. This matches original N64 behaviour.\n"
"- Always: Always show the search balls.",
.defaultIndex = DEKU_GUARD_SEARCH_BALLS_NIGHT_ONLY });
ImGui::EndMenu();
}

Expand Down Expand Up @@ -819,21 +819,17 @@ void DrawCheatsMenu() {
UIWidgets::CVarCheckbox("Infinite Magic", "gCheats.InfiniteMagic");
UIWidgets::CVarCheckbox("Infinite Rupees", "gCheats.InfiniteRupees");
UIWidgets::CVarCheckbox("Infinite Consumables", "gCheats.InfiniteConsumables");
if (UIWidgets::CVarCheckbox(
"Longer Deku Flower Glide", "gCheats.LongerFlowerGlide",
{ .tooltip = "Allows Deku Link to glide longer, no longer dropping after a certain distance" })) {
RegisterLongerFlowerGlide();
}
UIWidgets::CVarCheckbox(
"Longer Deku Flower Glide", "gCheats.LongerFlowerGlide",
{ .tooltip = "Allows Deku Link to glide longer, no longer dropping after a certain distance" });
UIWidgets::CVarCheckbox("No Clip", "gCheats.NoClip");
UIWidgets::CVarCheckbox("Unbreakable Razor Sword", "gCheats.UnbreakableRazorSword");
UIWidgets::CVarCheckbox("Unrestricted Items", "gCheats.UnrestrictedItems");
UIWidgets::CVarCheckbox("Hookshot Anywhere", "gCheats.HookshotAnywhere",
{ .tooltip = "Allows most surfaces to be hookshot-able" });

if (UIWidgets::CVarCheckbox("Moon Jump on L", "gCheats.MoonJumpOnL",
{ .tooltip = "Holding L makes you float into the air" })) {
RegisterMoonJumpOnL();
}
UIWidgets::CVarCheckbox("Moon Jump on L", "gCheats.MoonJumpOnL",
{ .tooltip = "Holding L makes you float into the air" });
UIWidgets::CVarCheckbox("Elegy of Emptiness Anywhere", "gCheats.ElegyAnywhere",
{ .tooltip = "Allows Elegy of Emptiness outside of Ikana" });
UIWidgets::CVarCombobox(
Expand Down
9 changes: 9 additions & 0 deletions mm/2s2h/BenGui/Menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,15 @@ void BenMenu::DrawElement() {
}
if (UIWidgets::Button(ICON_FA_TIMES_CIRCLE, { .size = UIWidgets::Sizes::Inline, .tooltip = "Close Menu (Esc)" })) {
ToggleVisibility();

// Update gamepad navigation after close based on if other menus are still visible
auto mImGuiIo = &ImGui::GetIO();
if (CVarGetInteger(CVAR_IMGUI_CONTROLLER_NAV, 0) &&
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetMenuOrMenubarVisible()) {
mImGuiIo->ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad;
} else {
mImGuiIo->ConfigFlags &= ~ImGuiConfigFlags_NavEnableGamepad;
}
}
ImGui::SameLine();
ImGui::SetNextWindowSizeConstraints({ 0, headerHeight }, { headerWidth, headerHeight });
Expand Down
Loading

0 comments on commit 2987de8

Please sign in to comment.