From ff64bc42fb986ab6a0384c22051ebaa07ce82ee1 Mon Sep 17 00:00:00 2001 From: aMannus Date: Fri, 12 Aug 2022 18:21:28 +0200 Subject: [PATCH 1/5] First pass fixes item tracker save loading --- .../randomizer/randomizer_item_tracker.cpp | 43 ++++++++++++------- .../randomizer/randomizer_item_tracker.h | 3 +- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp index ac4bcfdd65..59f24951c5 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp @@ -34,6 +34,8 @@ typedef struct { } \ } +bool validSaveFile = false; + // Maps items ids to info for use in ImGui std::map itemMappingSSS = { ITEM_MAP_ENTRY(ITEM_STICK), @@ -243,8 +245,8 @@ void DrawEquip(uint32_t itemId) { const ItemTrackerMapEntry& entry = equipTrackerMap[itemId]; bool hasEquip = (entry.bitMask & gSaveContext.inventory.equipment) != 0; int iconSize = CVar_GetS32("gRandoTrackIconSize", 0); - ImGui::Image(SohImGui::GetTextureByName(hasEquip ? entry.name : entry.nameFaded), ImVec2(iconSize, iconSize), - ImVec2(0, 0), ImVec2(1, 1)); + ImGui::Image(SohImGui::GetTextureByName(hasEquip && validSaveFile ? entry.name : entry.nameFaded), + ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); SetLastItemHoverText(SohUtils::GetItemName(entry.id)); } @@ -451,14 +453,25 @@ void DrawItem(uint32_t itemId) { int iconSize = CVar_GetS32("gRandoTrackIconSize", 0); ImGui::BeginGroup(); - ImGui::Image(SohImGui::GetTextureByName(hasItem ? entry.name : entry.nameFaded), ImVec2(iconSize, iconSize), + ImGui::Image(SohImGui::GetTextureByName(hasItem && validSaveFile ? entry.name : entry.nameFaded), ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); ImVec2 p = ImGui::GetCursorScreenPos(); int estimatedTextWidth = 10; int estimatedTextHeight = 10; ImGui::SetCursorScreenPos(ImVec2(p.x - 5 + (iconSize / 2) - estimatedTextWidth, p.y - estimatedTextHeight)); - switch (actualItemId) { + if (validSaveFile) { + DrawItemAmmo(actualItemId); + } else { + ImGui::Text(" "); + } + ImGui::EndGroup(); + + SetLastItemHoverText(SohUtils::GetItemName(entry.id)); +} + +void DrawItemAmmo(int itemId) { + switch (itemId) { case ITEM_STICK: if (CVar_GetS32("gItemTrackerAmmoDisplay", 0) == 1) { if (AMMO(ITEM_STICK) == CUR_CAPACITY(UPG_STICKS)) { @@ -667,9 +680,6 @@ void DrawItem(uint32_t itemId) { ImGui::Text(" "); break; } - ImGui::EndGroup(); - - SetLastItemHoverText(SohUtils::GetItemName(entry.id)); } void DrawBottle(uint32_t itemId, uint32_t bottleSlot) { @@ -677,8 +687,8 @@ void DrawBottle(uint32_t itemId, uint32_t bottleSlot) { bool hasItem = actualItemId != ITEM_NONE; const ItemTrackerMapEntry& entry = itemTrackerMap[hasItem ? actualItemId : itemId]; int iconSize = CVar_GetS32("gRandoTrackIconSize", 0); - ImGui::Image(SohImGui::GetTextureByName(hasItem ? entry.name : entry.nameFaded), ImVec2(iconSize, iconSize), - ImVec2(0, 0), ImVec2(1, 1)); + ImGui::Image(SohImGui::GetTextureByName(hasItem && validSaveFile ? entry.name : entry.nameFaded), + ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); SetLastItemHoverText(SohUtils::GetItemName(entry.id)); }; @@ -691,12 +701,12 @@ void DrawDungeonItem(uint32_t itemId, uint32_t scene) { bool hasSmallKey = (gSaveContext.inventory.dungeonKeys[scene]) >= 0; ImGui::BeginGroup(); if (itemId == ITEM_KEY_SMALL) { - ImGui::Image(SohImGui::GetTextureByName(hasSmallKey ? entry.name : entry.nameFaded), ImVec2(iconSize, iconSize), - ImVec2(0, 0), ImVec2(1, 1)); + ImGui::Image(SohImGui::GetTextureByName(hasSmallKey && validSaveFile ? entry.name : entry.nameFaded), + ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); } else { - ImGui::Image(SohImGui::GetTextureByName(hasItem ? entry.name : entry.nameFaded), ImVec2(iconSize, iconSize), - ImVec2(0, 0), ImVec2(1, 1)); + ImGui::Image(SohImGui::GetTextureByName(hasItem && validSaveFile ? entry.name : entry.nameFaded), + ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); } ImVec2 p = ImGui::GetCursorScreenPos(); @@ -763,7 +773,7 @@ std::unordered_map> upgradeTracker void DrawUpgrade(int32_t categoryId) { int iconSize = CVar_GetS32("gRandoTrackIconSize", 0); - if (CUR_UPG_VALUE(categoryId) == 0) { + if (CUR_UPG_VALUE(categoryId) == 0 && validSaveFile) { const ItemTrackerUpgradeEntry& entry = upgradeTrackerMap[categoryId][0]; ImGui::Image(SohImGui::GetTextureByName(entry.nameFaded), ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); @@ -822,8 +832,8 @@ void DrawSong(int32_t songId) { CVar_GetS32("gItemTrackeSongColor", 0) ? songTrackerMap[songId] : vanillaSongTrackerMap[songId]; uint32_t bitMask = 1 << entry.id; bool hasSong = (bitMask & gSaveContext.inventory.questItems) != 0; - ImGui::Image(SohImGui::GetTextureByName(hasSong ? entry.name : entry.nameFaded), ImVec2(iconSize / 1.5, iconSize), - ImVec2(0, 0), ImVec2(1, 1)); + ImGui::Image(SohImGui::GetTextureByName(hasSong && validSaveFile ? entry.name : entry.nameFaded), + ImVec2(iconSize / 1.5, iconSize), ImVec2(0, 0), ImVec2(1, 1)); SetLastItemHoverText(SohUtils::GetQuestItemName(entry.id)); } @@ -1455,6 +1465,7 @@ void DrawItemTracker(bool& open) { } int Icon_Cells_Size = CVar_GetS32("gRandoTrackIconSize", 0); int Icon_Spacing = CVar_GetS32("gRandoTrackIconSpacing", 0); + validSaveFile = gSaveContext.fileNum >= 0 && gSaveContext.fileNum <= 3; if (CVar_GetS32("gItemTrackerEnabled", 0)) { int ImGui_DefaultMargin = 0; diff --git a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.h b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.h index b67a939fb8..1397c3d589 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.h +++ b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.h @@ -1,4 +1,5 @@ #pragma once void InitItemTracker(); -void DrawItemTracker(bool& open); \ No newline at end of file +void DrawItemTracker(bool& open); +void DrawItemAmmo(int itemId); From 4d7982911e4addb01cdc5eadc697bffe7860c6f6 Mon Sep 17 00:00:00 2001 From: aMannus Date: Fri, 12 Aug 2022 22:08:10 +0200 Subject: [PATCH 2/5] More fixes and code cleanup --- .../randomizer/randomizer_item_tracker.cpp | 57 ++++++++++++------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp index 59f24951c5..f1f52a4c1a 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp @@ -34,8 +34,6 @@ typedef struct { } \ } -bool validSaveFile = false; - // Maps items ids to info for use in ImGui std::map itemMappingSSS = { ITEM_MAP_ENTRY(ITEM_STICK), @@ -241,12 +239,17 @@ std::unordered_map equipTrackerMap = { ITEM_TRACKER_MAP_ENTRY(ITEM_BOOTS_HOVER, 14), }; +bool IsValidSaveFile() { + bool validSave = gSaveContext.fileNum >= 0 && gSaveContext.fileNum <= 3; + return validSave; +} + void DrawEquip(uint32_t itemId) { const ItemTrackerMapEntry& entry = equipTrackerMap[itemId]; bool hasEquip = (entry.bitMask & gSaveContext.inventory.equipment) != 0; int iconSize = CVar_GetS32("gRandoTrackIconSize", 0); - ImGui::Image(SohImGui::GetTextureByName(hasEquip && validSaveFile ? entry.name : entry.nameFaded), - ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); + ImGui::Image(SohImGui::GetTextureByName(hasEquip && IsValidSaveFile() ? entry.name : entry.nameFaded), + ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); SetLastItemHoverText(SohUtils::GetItemName(entry.id)); } @@ -266,7 +269,8 @@ void DrawQuest(uint32_t itemId) { bool hasQuestItem = (entry.bitMask & gSaveContext.inventory.questItems) != 0; int iconSize = CVar_GetS32("gRandoTrackIconSize", 0); ImGui::BeginGroup(); - ImGui::Image(SohImGui::GetTextureByName(hasQuestItem ? entry.name : entry.nameFaded), ImVec2(iconSize, iconSize), + ImGui::Image(SohImGui::GetTextureByName(hasQuestItem && IsValidSaveFile() ? entry.name : entry.nameFaded), + ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); ImVec2 p = ImGui::GetCursorScreenPos(); @@ -449,18 +453,18 @@ void DrawItem(uint32_t itemId) { } } - const ItemTrackerMapEntry& entry = itemTrackerMap[hasItem ? actualItemId : itemId]; + const ItemTrackerMapEntry& entry = itemTrackerMap[hasItem && IsValidSaveFile() ? actualItemId : itemId]; int iconSize = CVar_GetS32("gRandoTrackIconSize", 0); ImGui::BeginGroup(); - ImGui::Image(SohImGui::GetTextureByName(hasItem && validSaveFile ? entry.name : entry.nameFaded), ImVec2(iconSize, iconSize), - ImVec2(0, 0), ImVec2(1, 1)); + ImGui::Image(SohImGui::GetTextureByName(hasItem && IsValidSaveFile() ? entry.name : entry.nameFaded), + ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); ImVec2 p = ImGui::GetCursorScreenPos(); int estimatedTextWidth = 10; int estimatedTextHeight = 10; ImGui::SetCursorScreenPos(ImVec2(p.x - 5 + (iconSize / 2) - estimatedTextWidth, p.y - estimatedTextHeight)); - if (validSaveFile) { + if (IsValidSaveFile()) { DrawItemAmmo(actualItemId); } else { ImGui::Text(" "); @@ -685,9 +689,9 @@ void DrawItemAmmo(int itemId) { void DrawBottle(uint32_t itemId, uint32_t bottleSlot) { uint32_t actualItemId = gSaveContext.inventory.items[SLOT(itemId) + bottleSlot]; bool hasItem = actualItemId != ITEM_NONE; - const ItemTrackerMapEntry& entry = itemTrackerMap[hasItem ? actualItemId : itemId]; + const ItemTrackerMapEntry& entry = itemTrackerMap[hasItem && IsValidSaveFile() ? actualItemId : itemId]; int iconSize = CVar_GetS32("gRandoTrackIconSize", 0); - ImGui::Image(SohImGui::GetTextureByName(hasItem && validSaveFile ? entry.name : entry.nameFaded), + ImGui::Image(SohImGui::GetTextureByName(hasItem && IsValidSaveFile() ? entry.name : entry.nameFaded), ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); SetLastItemHoverText(SohUtils::GetItemName(entry.id)); @@ -701,11 +705,11 @@ void DrawDungeonItem(uint32_t itemId, uint32_t scene) { bool hasSmallKey = (gSaveContext.inventory.dungeonKeys[scene]) >= 0; ImGui::BeginGroup(); if (itemId == ITEM_KEY_SMALL) { - ImGui::Image(SohImGui::GetTextureByName(hasSmallKey && validSaveFile ? entry.name : entry.nameFaded), + ImGui::Image(SohImGui::GetTextureByName(hasSmallKey && IsValidSaveFile() ? entry.name : entry.nameFaded), ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); } else { - ImGui::Image(SohImGui::GetTextureByName(hasItem && validSaveFile ? entry.name : entry.nameFaded), + ImGui::Image(SohImGui::GetTextureByName(hasItem && IsValidSaveFile() ? entry.name : entry.nameFaded), ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); } @@ -715,7 +719,7 @@ void DrawDungeonItem(uint32_t itemId, uint32_t scene) { ImGui::SetCursorScreenPos(ImVec2(p.x - 5 + (iconSize / 2) - estimatedTextWidth, p.y - estimatedTextHeight)); if (itemId == ITEM_KEY_SMALL) { // This check there for small key is necessary to get the text position properly and can't be on the same ITEM_KEY chack from the top - if (gSaveContext.inventory.dungeonKeys[scene] <= 0) { + if (gSaveContext.inventory.dungeonKeys[scene] <= 0 || !IsValidSaveFile()) { ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(155, 155, 155, 255)); ImGui::Text("0"); ImGui::PopStyleColor(); @@ -773,7 +777,7 @@ std::unordered_map> upgradeTracker void DrawUpgrade(int32_t categoryId) { int iconSize = CVar_GetS32("gRandoTrackIconSize", 0); - if (CUR_UPG_VALUE(categoryId) == 0 && validSaveFile) { + if (CUR_UPG_VALUE(categoryId) == 0 || !IsValidSaveFile()) { const ItemTrackerUpgradeEntry& entry = upgradeTrackerMap[categoryId][0]; ImGui::Image(SohImGui::GetTextureByName(entry.nameFaded), ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); @@ -832,7 +836,7 @@ void DrawSong(int32_t songId) { CVar_GetS32("gItemTrackeSongColor", 0) ? songTrackerMap[songId] : vanillaSongTrackerMap[songId]; uint32_t bitMask = 1 << entry.id; bool hasSong = (bitMask & gSaveContext.inventory.questItems) != 0; - ImGui::Image(SohImGui::GetTextureByName(hasSong && validSaveFile ? entry.name : entry.nameFaded), + ImGui::Image(SohImGui::GetTextureByName(hasSong && IsValidSaveFile() ? entry.name : entry.nameFaded), ImVec2(iconSize / 1.5, iconSize), ImVec2(0, 0), ImVec2(1, 1)); SetLastItemHoverText(SohUtils::GetQuestItemName(entry.id)); } @@ -1290,7 +1294,7 @@ void DrawFloatingDungeons(int Icon_Cells_Size, int Icon_Spacing) { DrawDungeonItem(ITEM_KEY_SMALL, SCENE_HAKADAN); ImGui::SameLine(Icon_Cells_Size * 5); ImGui::SetCursorPosX(ImGui::GetCursorPosX() + Icon_Spacing * 5); - DrawDungeonItem(ITEM_KEY_SMALL, SCENE_GANON); + DrawDungeonItem(ITEM_KEY_SMALL, SCENE_GANONTIKA); ImGui::EndGroup(); // BOSS KEYS FOR FOREST TO GANON ImGui::BeginGroup(); @@ -1357,7 +1361,7 @@ void DrawFloatingDungeons(int Icon_Cells_Size, int Icon_Spacing) { DrawDungeonItem(ITEM_KEY_SMALL, SCENE_MEN); ImGui::SameLine(Icon_Cells_Size * 5); ImGui::SetCursorPosX(ImGui::GetCursorPosX() + Icon_Spacing * 5); - DrawDungeonItem(ITEM_KEY_SMALL, SCENE_GANON); + DrawDungeonItem(ITEM_KEY_SMALL, SCENE_GANONTIKA); ImGui::EndGroup(); ImGui::BeginGroup(); DrawDungeonItem(ITEM_COMPASS, SCENE_JYASINZOU); @@ -1372,7 +1376,7 @@ void DrawFloatingDungeons(int Icon_Cells_Size, int Icon_Spacing) { DrawDungeonItem(ITEM_COMPASS, SCENE_ICE_DOUKUTO); ImGui::SameLine(Icon_Cells_Size * 5); ImGui::SetCursorPosX(ImGui::GetCursorPosX() + Icon_Spacing * 5); - DrawDungeonItem(ITEM_KEY_BOSS, SCENE_GANONTIKA); + DrawDungeonItem(ITEM_KEY_BOSS, SCENE_GANON); ImGui::EndGroup(); } ImGui::BeginGroup(); @@ -1465,7 +1469,6 @@ void DrawItemTracker(bool& open) { } int Icon_Cells_Size = CVar_GetS32("gRandoTrackIconSize", 0); int Icon_Spacing = CVar_GetS32("gRandoTrackIconSpacing", 0); - validSaveFile = gSaveContext.fileNum >= 0 && gSaveContext.fileNum <= 3; if (CVar_GetS32("gItemTrackerEnabled", 0)) { int ImGui_DefaultMargin = 0; @@ -1588,6 +1591,10 @@ void DrawItemTrackerOptions(bool& open) { ImGui::Text("Chroma Key"); auto flags = ImGuiColorEditFlags_AlphaPreview | ImGuiColorEditFlags_AlphaBar | ImGuiColorEditFlags_NoLabel; ImGui::ColorEdit4("Chroma Key Selection", (float*)&ChromaKeyBackground, flags); + CVar_SetFloat("gTrackerBgColorR", ChromaKeyBackground.x); + CVar_SetFloat("gTrackerBgColorG", ChromaKeyBackground.y); + CVar_SetFloat("gTrackerBgColorB", ChromaKeyBackground.z); + CVar_SetFloat("gTrackerBgColorA", ChromaKeyBackground.w); const char* ItemsTrackerTheme[3] = { "One Block", "Grouped style n.1", "Grouped style n.2" }; ImGui::Text("Using theme :"); @@ -1664,4 +1671,14 @@ void InitItemTracker() { CVar_RegisterS32("gRandoTrackIconSize", 32); SohImGui::AddWindow("Randomizer", "Item Tracker", DrawItemTracker); SohImGui::AddWindow("Randomizer", "Item Tracker Settings", DrawItemTrackerOptions); + float trackerBgR = CVar_GetFloat("gTrackerBgColorR", 0); + float trackerBgG = CVar_GetFloat("gTrackerBgColorG", 0); + float trackerBgB = CVar_GetFloat("gTrackerBgColorB", 0); + float trackerBgA = CVar_GetFloat("gTrackerBgColorA", 1); + ChromaKeyBackground = { + trackerBgR, + trackerBgG, + trackerBgB, + trackerBgA + }; // Float value, 1 = 255 in rgb value. } From 5f2bcb39c9d8c5f867e8afe10113dfa3e32b807b Mon Sep 17 00:00:00 2001 From: aMannus Date: Fri, 12 Aug 2022 22:16:23 +0200 Subject: [PATCH 3/5] Small code cleanup --- soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp index f1f52a4c1a..3331b92c99 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp @@ -240,7 +240,7 @@ std::unordered_map equipTrackerMap = { }; bool IsValidSaveFile() { - bool validSave = gSaveContext.fileNum >= 0 && gSaveContext.fileNum <= 3; + bool validSave = gSaveContext.fileNum >= 0 && gSaveContext.fileNum <= 2; return validSave; } From 3689abd01f321840755fdee73993a49498907e7b Mon Sep 17 00:00:00 2001 From: aMannus Date: Fri, 12 Aug 2022 22:39:12 +0200 Subject: [PATCH 4/5] One more small code cleanup --- soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp index 3331b92c99..a2afc6ae4f 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp @@ -270,8 +270,7 @@ void DrawQuest(uint32_t itemId) { int iconSize = CVar_GetS32("gRandoTrackIconSize", 0); ImGui::BeginGroup(); ImGui::Image(SohImGui::GetTextureByName(hasQuestItem && IsValidSaveFile() ? entry.name : entry.nameFaded), - ImVec2(iconSize, iconSize), - ImVec2(0, 0), ImVec2(1, 1)); + ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); ImVec2 p = ImGui::GetCursorScreenPos(); int estimatedTextWidth = 10; From 4c9f2493d73b1fdbdc9274ae913b386655e0fb68 Mon Sep 17 00:00:00 2001 From: aMannus Date: Fri, 12 Aug 2022 22:51:40 +0200 Subject: [PATCH 5/5] Brought CVar naming in line with others --- .../randomizer/randomizer_item_tracker.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp index a2afc6ae4f..ed26e90783 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp @@ -1590,10 +1590,10 @@ void DrawItemTrackerOptions(bool& open) { ImGui::Text("Chroma Key"); auto flags = ImGuiColorEditFlags_AlphaPreview | ImGuiColorEditFlags_AlphaBar | ImGuiColorEditFlags_NoLabel; ImGui::ColorEdit4("Chroma Key Selection", (float*)&ChromaKeyBackground, flags); - CVar_SetFloat("gTrackerBgColorR", ChromaKeyBackground.x); - CVar_SetFloat("gTrackerBgColorG", ChromaKeyBackground.y); - CVar_SetFloat("gTrackerBgColorB", ChromaKeyBackground.z); - CVar_SetFloat("gTrackerBgColorA", ChromaKeyBackground.w); + CVar_SetFloat("gItemTrackerBgColorR", ChromaKeyBackground.x); + CVar_SetFloat("gItemTrackerBgColorG", ChromaKeyBackground.y); + CVar_SetFloat("gItemTrackerBgColorB", ChromaKeyBackground.z); + CVar_SetFloat("gItemTrackerBgColorA", ChromaKeyBackground.w); const char* ItemsTrackerTheme[3] = { "One Block", "Grouped style n.1", "Grouped style n.2" }; ImGui::Text("Using theme :"); @@ -1670,10 +1670,10 @@ void InitItemTracker() { CVar_RegisterS32("gRandoTrackIconSize", 32); SohImGui::AddWindow("Randomizer", "Item Tracker", DrawItemTracker); SohImGui::AddWindow("Randomizer", "Item Tracker Settings", DrawItemTrackerOptions); - float trackerBgR = CVar_GetFloat("gTrackerBgColorR", 0); - float trackerBgG = CVar_GetFloat("gTrackerBgColorG", 0); - float trackerBgB = CVar_GetFloat("gTrackerBgColorB", 0); - float trackerBgA = CVar_GetFloat("gTrackerBgColorA", 1); + float trackerBgR = CVar_GetFloat("gItemTrackerBgColorR", 0); + float trackerBgG = CVar_GetFloat("gItemTrackerBgColorG", 0); + float trackerBgB = CVar_GetFloat("gItemTrackerBgColorB", 0); + float trackerBgA = CVar_GetFloat("gItemTrackerBgColorA", 1); ChromaKeyBackground = { trackerBgR, trackerBgG,