From 34e91a4500b26f4022295c412360081f39d22003 Mon Sep 17 00:00:00 2001 From: Caladius Date: Mon, 4 Mar 2024 19:47:16 -0500 Subject: [PATCH] Forgot Magic like a peasant! --- .../Enhancements/timesplits/TimeSplits.cpp | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/soh/soh/Enhancements/timesplits/TimeSplits.cpp b/soh/soh/Enhancements/timesplits/TimeSplits.cpp index 80391e66c..396e790d6 100644 --- a/soh/soh/Enhancements/timesplits/TimeSplits.cpp +++ b/soh/soh/Enhancements/timesplits/TimeSplits.cpp @@ -236,7 +236,7 @@ std::vector inventoryObjects = { { ITEM_BOMB, "Bombs", "ITEM_BOMB"}, { ITEM_BOMBCHU, "Bombchu", "ITEM_BOMBCHU"}, { ITEM_BEAN, "Magic Bean", "ITEM_BEAN"}, - { ITEM_FISHING_POLE, "Fishing Pole", "ITEM_FISHING_POLE"}, + { ITEM_MAGIC_SMALL, "Magic Meter", "ITEM_MAGIC_SMALL"}, { ITEM_BOW, "Fairy Bow", "ITEM_BOW"}, { ITEM_HOOKSHOT, "Hookshot", "ITEM_HOOKSHOT"}, { ITEM_HAMMER, "Megaton Hammer", "ITEM_HAMMER"}, @@ -834,6 +834,8 @@ void DrawTimeSplitListManager() { ImGui::OpenPopup("Hookshot"); } else if (obj.itemID == ITEM_BOTTLE) { ImGui::OpenPopup("Bottles"); + } else if (obj.itemID == ITEM_MAGIC_SMALL) { + ImGui::OpenPopup("Magic"); } else if (obj.itemID == ITEM_WALLET_ADULT) { ImGui::OpenPopup("Wallet"); } else if (obj.itemID == ITEM_POCKET_EGG) { @@ -1078,6 +1080,22 @@ void DrawTimeSplitListManager() { } ImGui::EndPopup(); } + if (ImGui::BeginPopupContextItem("Magic")) { + if (ImGui::ImageButton(std::to_string(ITEM_MAGIC_SMALL).c_str(), + LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("ITEM_MAGIC_SMALL"), + ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, 1))) { + TimeSplitAddToSplits(ITEM_MAGIC_SMALL); + ImGui::CloseCurrentPopup(); + } + ImGui::SameLine(); + if (ImGui::ImageButton(std::to_string(ITEM_MAGIC_LARGE).c_str(), + LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("ITEM_MAGIC_LARGE"), + ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, 1))) { + TimeSplitAddToSplits(ITEM_MAGIC_LARGE); + ImGui::CloseCurrentPopup(); + } + ImGui::EndPopup(); + } if (ImGui::BeginPopupContextItem("Wallet")) { if (ImGui::ImageButton(std::to_string(ITEM_WALLET_ADULT).c_str(), LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("ITEM_WALLET_ADULT"),