From eb78c4ca7ba0ee82e718b864c0e3be4765a8abd2 Mon Sep 17 00:00:00 2001 From: briaguya Date: Sun, 3 Jul 2022 07:04:23 -0400 Subject: [PATCH 1/2] this is all i did --- soh/soh/Enhancements/debugger/debugSaveEditor.cpp | 1 + soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp index 8ccd10ba523..a075bbadaea 100644 --- a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp +++ b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp @@ -196,6 +196,7 @@ std::map questMapping = { QUEST_MAP_ENTRY(QUEST_ZORA_SAPPHIRE, gZoraSapphireIconTex), QUEST_MAP_ENTRY(QUEST_STONE_OF_AGONY, gStoneOfAgonyIconTex), QUEST_MAP_ENTRY(QUEST_GERUDO_CARD, gGerudosCardIconTex), + QUEST_MAP_ENTRY(QUEST_SKULL_TOKEN, gGoldSkulltulaIconTex) }; typedef struct { diff --git a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp index 9cc7ddb16cb..c8c3db73d9b 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp @@ -818,7 +818,7 @@ if (ImGui::BeginTabBar("Item Tracker", ImGuiTabBarFlags_NoCloseWithMiddleMouseBu ImGui::SameLine(); ImGui::Dummy(ImVec2(0.0f, 5.0f)); ImGui::SameLine(); - // DrawQuest(QUEST_SKULL_TOKEN); + DrawQuest(QUEST_SKULL_TOKEN); ImGui::NewLine(); DrawEquip(ITEM_SHIELD_DEKU); ImGui::SameLine(); From 3512c2cd4536ac6b2937404e2c082996abd0d235 Mon Sep 17 00:00:00 2001 From: briaguya Date: Sun, 3 Jul 2022 07:30:00 -0400 Subject: [PATCH 2/2] not the cleanest code ever but it's working --- .../Enhancements/debugger/debugSaveEditor.cpp | 3 ++ .../randomizer/randomizer_item_tracker.cpp | 46 ++++++++++++++++++- 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp index a075bbadaea..9bf606df9af 100644 --- a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp +++ b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp @@ -130,6 +130,9 @@ std::map itemMapping = { ITEM_MAP_ENTRY(ITEM_COMPASS), ITEM_MAP_ENTRY(ITEM_DUNGEON_MAP), ITEM_MAP_ENTRY(ITEM_KEY_SMALL), + ITEM_MAP_ENTRY(ITEM_HEART_CONTAINER), + ITEM_MAP_ENTRY(ITEM_MAGIC_SMALL), + ITEM_MAP_ENTRY(ITEM_MAGIC_LARGE) }; // Maps entries in the GS flag array to the area name it represents diff --git a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp index c8c3db73d9b..01c93e815d6 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp @@ -438,12 +438,48 @@ std::unordered_map itemTrackerMap = { ITEM_TRACKER_MAP_ENTRY(ITEM_FROG, 0), ITEM_TRACKER_MAP_ENTRY(ITEM_EYEDROPS, 0), ITEM_TRACKER_MAP_ENTRY(ITEM_CLAIM_CHECK, 0), - + ITEM_TRACKER_MAP_ENTRY(ITEM_HEART_CONTAINER, 0), + ITEM_TRACKER_MAP_ENTRY(ITEM_MAGIC_SMALL, 0), + ITEM_TRACKER_MAP_ENTRY(ITEM_MAGIC_LARGE, 0), }; void DrawItem(uint32_t itemId) { uint32_t actualItemId = INV_CONTENT(itemId); + + if (itemId == ITEM_HEART_CONTAINER) { + actualItemId = itemId; + } + + if (itemId == ITEM_MAGIC_SMALL || + itemId == ITEM_MAGIC_LARGE) { + // todo make this large/small based on what upgrades we have + if (gSaveContext.magicLevel == 2) { + actualItemId = ITEM_MAGIC_LARGE; + } else { + actualItemId = ITEM_MAGIC_SMALL; + } + } + bool hasItem = actualItemId != ITEM_NONE; + + if (itemId == ITEM_HEART_CONTAINER) { + if (gSaveContext.doubleDefense) { + hasItem = true; + } else { + hasItem = false; + } + } + + if (itemId == ITEM_MAGIC_SMALL || + itemId == ITEM_MAGIC_LARGE) { + // todo make this large/small based on what upgrades we have + if (gSaveContext.magicLevel == 0) { + hasItem = false; + } else { + hasItem = true; + } + } + const ItemTrackerMapEntry& entry = itemTrackerMap[hasItem ? actualItemId : itemId]; int iconSize = CVar_GetS32("gRandoTrackIconSize", 0); @@ -853,6 +889,14 @@ if (ImGui::BeginTabBar("Item Tracker", ImGuiTabBarFlags_NoCloseWithMiddleMouseBu ImGui::SameLine(); ImGui::Dummy(ImVec2(0.0f, 5.0f)); ImGui::SameLine(); + DrawItem(ITEM_HEART_CONTAINER); + ImGui::SameLine(); + ImGui::Dummy(ImVec2(0.0f, 5.0f)); + ImGui::SameLine(); + DrawItem(ITEM_MAGIC_SMALL); + ImGui::SameLine(); + ImGui::Dummy(ImVec2(0.0f, 5.0f)); + ImGui::SameLine(); ImGui::NewLine(); DrawEquip(ITEM_BOOTS_KOKIRI); ImGui::SameLine();