Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Item Tracker Hookshot/Longshot Identifiers #3848

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,25 @@ void DrawItemCount(ItemTrackerItem item) {
ImVec2 p = ImGui::GetCursorScreenPos();
int32_t trackerNumberDisplayMode = CVarGetInteger("gItemTrackerCapacityTrack", ITEM_TRACKER_NUMBER_CURRENT_CAPACITY_ONLY);
int32_t trackerKeyNumberDisplayMode = CVarGetInteger("gItemTrackerKeyTrack", KEYS_COLLECTED_MAX);
float textScalingFactor = static_cast<float>(iconSize) / 36.0f;
uint32_t actualItemId = INV_CONTENT(item.id);
bool hasItem = actualItemId != ITEM_NONE;

if (CVarGetInteger("gTrackers.ItemTracker.HookshotIdentifier", 0)) {
if ((actualItemId == ITEM_HOOKSHOT || actualItemId == ITEM_LONGSHOT) && hasItem) {

// Calculate the scaled position for the text
ImVec2 textPos = ImVec2(p.x + (iconSize / 2) - (ImGui::CalcTextSize(item.id == ITEM_HOOKSHOT ? "H" : "L").x *
textScalingFactor / 2) + 8 * textScalingFactor, p.y - 22 * textScalingFactor);

ImGui::SetCursorScreenPos(textPos);

ImGui::SetWindowFontScale(textScalingFactor);

ImGui::Text(item.id == ITEM_HOOKSHOT ? "H" : "L");
ImGui::SetWindowFontScale(1.0f); // Reset font scale to the original state
}
}
if (item.id == ITEM_KEY_SMALL && IsValidSaveFile()) {
std::string currentString = "";
std::string maxString = std::to_string(currentAndMax.maxCapacity);
Expand Down Expand Up @@ -1200,6 +1218,10 @@ void ItemTrackerSettingsWindow::DrawElement() {
shouldUpdateVectors = true;
}
}
UIWidgets::EnhancementCheckbox("Show Hookshot Identifiers", "gTrackers.ItemTracker.HookshotIdentifier");
UIWidgets::InsertHelpHoverText("Shows an 'H' or an 'L' to more easiely distinguish between Hookshot and Longshot.");

UIWidgets::Spacer(0);

ImGui::PopStyleVar(1);
ImGui::EndTable();
Expand Down
Loading