mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-21 17:05:04 -05:00
Item Tracker Text Size Slider (#3856)
* Adds Slider and Functionality * prefix * Changed values * HELLO --------- Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
This commit is contained in:
parent
961b2626ad
commit
f88343839e
@ -412,6 +412,7 @@ ItemTrackerNumbers GetItemCurrentAndMax(ItemTrackerItem item) {
|
||||
|
||||
void DrawItemCount(ItemTrackerItem item) {
|
||||
int iconSize = CVarGetInteger("gItemTrackerIconSize", 36);
|
||||
int textSize = CVarGetInteger("gTrackers.ItemTracker.ItemTrackerTextSize", 13);
|
||||
ItemTrackerNumbers currentAndMax = GetItemCurrentAndMax(item);
|
||||
ImVec2 p = ImGui::GetCursorScreenPos();
|
||||
int32_t trackerNumberDisplayMode = CVarGetInteger("gItemTrackerCapacityTrack", ITEM_TRACKER_NUMBER_CURRENT_CAPACITY_ONLY);
|
||||
@ -428,13 +429,15 @@ void DrawItemCount(ItemTrackerItem item) {
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::SetWindowFontScale(textSize / 13.0f);
|
||||
|
||||
if (item.id == ITEM_KEY_SMALL && IsValidSaveFile()) {
|
||||
std::string currentString = "";
|
||||
std::string maxString = std::to_string(currentAndMax.maxCapacity);
|
||||
@ -689,7 +692,7 @@ void DrawDungeonItem(ItemTrackerItem item) {
|
||||
|
||||
ImVec2 p = ImGui::GetCursorScreenPos();
|
||||
std::string dungeonName = itemTrackerDungeonShortNames[item.data];
|
||||
ImGui::SetCursorScreenPos(ImVec2(p.x + (iconSize / 2) - (ImGui::CalcTextSize(dungeonName.c_str()).x / 2), p.y - (iconSize + 16)));
|
||||
ImGui::SetCursorScreenPos(ImVec2(p.x + (iconSize / 2) - (ImGui::CalcTextSize(dungeonName.c_str()).x / 2), p.y - (iconSize + CVarGetInteger("gTrackers.ItemTracker.ItemTrackerTextSize", 13) + 3)));
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, dungeonColor);
|
||||
ImGui::Text("%s", dungeonName.c_str());
|
||||
ImGui::PopStyleColor();
|
||||
@ -1145,6 +1148,7 @@ void ItemTrackerSettingsWindow::DrawElement() {
|
||||
UIWidgets::PaddedSeparator();
|
||||
UIWidgets::EnhancementSliderInt("Icon size : %dpx", "##ITEMTRACKERICONSIZE", "gItemTrackerIconSize", 25, 128, "", 36);
|
||||
UIWidgets::EnhancementSliderInt("Icon margins : %dpx", "##ITEMTRACKERSPACING", "gItemTrackerIconSpacing", -5, 50, "", 12);
|
||||
UIWidgets::EnhancementSliderInt("Text size : %dpx", "##ITEMTRACKERTEXTSIZE", "gTrackers.ItemTracker.ItemTrackerTextSize", 1, 30, "", 13);
|
||||
|
||||
UIWidgets::Spacer(0);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user