Skip to content

Commit

Permalink
Bomb Arrows: Add enhancement checkbutton
Browse files Browse the repository at this point in the history
  • Loading branch information
lilDavid committed Dec 14, 2023
1 parent f4a22ce commit df01a29
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
1 change: 1 addition & 0 deletions soh/soh/Enhancements/presets.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ const std::vector<const char*> enhancementsCvars = {
"gAddTraps.Speed",
"gAddTraps.Tele",
"gAddTraps.Void",
"gBombArrows",
};

const std::vector<const char*> cheatCvars = {
Expand Down
28 changes: 15 additions & 13 deletions soh/soh/SohMenuBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ void DrawSettingsMenu() {
UIWidgets::Tooltip("Changes the scaling of the ImGui menu elements.");

UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f);

static std::unordered_map<LUS::WindowBackend, const char*> windowBackendNames = {
{ LUS::WindowBackend::DX11, "DirectX" },
{ LUS::WindowBackend::SDL_OPENGL, "OpenGL"},
Expand Down Expand Up @@ -468,17 +468,17 @@ void DrawSettingsMenu() {
}
ImGui::EndMenu();
}

UIWidgets::Spacer(0);

if (ImGui::BeginMenu("Accessibility")) {
#if defined(_WIN32) || defined(__APPLE__)
UIWidgets::PaddedEnhancementCheckbox("Text to Speech", "gA11yTTS");
UIWidgets::Tooltip("Enables text to speech for in game dialog");
#endif
UIWidgets::PaddedEnhancementCheckbox("Disable Idle Camera Re-Centering", "gA11yDisableIdleCam");
UIWidgets::Tooltip("Disables the automatic re-centering of the camera when idle.");

ImGui::EndMenu();
}
ImGui::EndMenu();
Expand Down Expand Up @@ -606,6 +606,8 @@ void DrawEnhancementsMenu() {
UIWidgets::Tooltip("After completing the mask trading sub-quest, press A and any direction on the mask slot to change masks");
UIWidgets::PaddedEnhancementCheckbox("Nuts explode bombs", "gNutsExplodeBombs", true, false);
UIWidgets::Tooltip("Makes nuts explode bombs, similar to how they interact with bombchus. This does not affect bombflowers.");
UIWidgets::PaddedEnhancementCheckbox("Bomb Arrows", "gBombArrows", true, false);
UIWidgets::Tooltip("Equip bombs onto the same button as your bow to shoot arrows that explode on impact");
UIWidgets::PaddedEnhancementCheckbox("Equip Multiple Arrows at Once", "gSeparateArrows", true, false);
UIWidgets::Tooltip("Allow the bow and magic arrows to be equipped at the same time on different slots. (Note this will disable the behaviour of the 'Equip Dupe' glitch)");
UIWidgets::PaddedEnhancementCheckbox("Bow as Child/Slingshot as Adult", "gBowSlingShotAmmoFix", true, false);
Expand Down Expand Up @@ -878,7 +880,7 @@ void DrawEnhancementsMenu() {
OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_BLUE_FIRE_ARROWS);
static const char* forceEnableBlueFireArrowsText =
"This setting is forcefully enabled because a savefile\nwith \"Blue Fire Arrows\" is loaded.";
UIWidgets::PaddedEnhancementCheckbox("Blue Fire Arrows", "gBlueFireArrows", true, false,
UIWidgets::PaddedEnhancementCheckbox("Blue Fire Arrows", "gBlueFireArrows", true, false,
forceEnableBlueFireArrows, forceEnableBlueFireArrowsText, UIWidgets::CheckboxGraphics::Checkmark);
UIWidgets::Tooltip("Allows Ice Arrows to melt red ice.\nMay require a room reload if toggled during gameplay.");

Expand All @@ -887,7 +889,7 @@ void DrawEnhancementsMenu() {
OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SUNLIGHT_ARROWS);
static const char* forceEnableSunLightArrowsText =
"This setting is forcefully enabled because a savefile\nwith \"Sunlight Arrows\" is loaded.";
UIWidgets::PaddedEnhancementCheckbox("Sunlight Arrows", "gSunlightArrows", true, false,
UIWidgets::PaddedEnhancementCheckbox("Sunlight Arrows", "gSunlightArrows", true, false,
forceEnableSunLightArrows, forceEnableSunLightArrowsText, UIWidgets::CheckboxGraphics::Checkmark);
UIWidgets::Tooltip("Allows Light Arrows to activate sun switches.\nMay require a room reload if toggled during gameplay.");

Expand Down Expand Up @@ -1062,8 +1064,8 @@ void DrawEnhancementsMenu() {
"Fixes an incorrect calculation that acted like water underneath ground was above it.");
UIWidgets::PaddedEnhancementCheckbox("Fix Bush Item Drops", "gBushDropFix", true, false);
UIWidgets::Tooltip("Fixes the bushes to drop items correctly rather than spawning undefined items.");
UIWidgets::PaddedEnhancementCheckbox("Fix falling from vine edges", "gFixVineFall", true, false);
UIWidgets::Tooltip("Prevents immediately falling off climbable surfaces if climbing on the edges.");
UIWidgets::PaddedEnhancementCheckbox("Fix falling from vine edges", "gFixVineFall", true, false);
UIWidgets::Tooltip("Prevents immediately falling off climbable surfaces if climbing on the edges.");
UIWidgets::PaddedEnhancementCheckbox("Fix Link's eyes open while sleeping", "gFixEyesOpenWhileSleeping", true, false);
UIWidgets::Tooltip("Fixes Link's eyes being open in the opening cutscene when he is supposed to be sleeping.");
UIWidgets::PaddedEnhancementCheckbox("Fix Darunia dancing too fast", "gEnhancements.FixDaruniaDanceSpeed",
Expand Down Expand Up @@ -1396,12 +1398,12 @@ void DrawCheatsMenu() {
if (ImGui::Button("Change Age")) {
CVarSetInteger("gSwitchAge", 1);
}
UIWidgets::Tooltip("Switches Link's age and reloads the area.");
UIWidgets::Tooltip("Switches Link's age and reloads the area.");

if (ImGui::Button("Clear Cutscene Pointer")) {
GameInteractor::RawAction::ClearCutscenePointer();
}
UIWidgets::Tooltip("Clears the cutscene pointer to a value safe for wrong warps.");
UIWidgets::Tooltip("Clears the cutscene pointer to a value safe for wrong warps.");

ImGui::EndDisabled();

Expand Down Expand Up @@ -1581,12 +1583,12 @@ void DrawRandomizerMenu() {
OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_BOSS_KEYSANITY) == RO_DUNGEON_ITEM_LOC_ANYWHERE ||
(OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_GANONS_BOSS_KEY) != RO_GANON_BOSS_KEY_VANILLA &&
OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_GANONS_BOSS_KEY) != RO_GANON_BOSS_KEY_OWN_DUNGEON &&
OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_GANONS_BOSS_KEY) != RO_GANON_BOSS_KEY_STARTWITH) ||
OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_GANONS_BOSS_KEY) != RO_GANON_BOSS_KEY_STARTWITH) ||
!IS_RANDO) {
disableKeyColors = false;
}

static const char* disableKeyColorsText =
static const char* disableKeyColorsText =
"This setting is disabled because a savefile is loaded without any key\n"
"shuffle settings set to \"Any Dungeon\", \"Overworld\" or \"Anywhere\"";

Expand Down Expand Up @@ -1642,4 +1644,4 @@ void SohMenuBar::DrawElement() {
ImGui::EndMenuBar();
}
}
} // namespace SohGui
} // namespace SohGui
7 changes: 4 additions & 3 deletions soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c
Original file line number Diff line number Diff line change
Expand Up @@ -1034,9 +1034,10 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) {
otherSlotIndex++) {
int slot_item = gSaveContext.equips.buttonItems[targetButtonIndex];
// Don't check for bomb arrows so you can replace bomb arrow equip with just bombs
if ((slot_item == ITEM_BOW || slot_item == ITEM_BOW_ARROW_FIRE ||
slot_item == ITEM_BOW_ARROW_ICE || slot_item == ITEM_BOW_ARROW_LIGHT)
&& pauseCtx->equipTargetItem == ITEM_BOMB) {
if (CVarGetInteger("gBombArrows", 0) &&
(slot_item == ITEM_BOW || slot_item == ITEM_BOW_ARROW_FIRE ||
slot_item == ITEM_BOW_ARROW_ICE || slot_item == ITEM_BOW_ARROW_LIGHT) &&
pauseCtx->equipTargetItem == ITEM_BOMB) {
pauseCtx->equipTargetItem = ITEM_BOW_ARROW_BOMB;
pauseCtx->equipTargetSlot = SLOT_BOW;
}
Expand Down

0 comments on commit df01a29

Please sign in to comment.