Skip to content

Commit 1775b04

Browse files
committed
fix: minimized goals view shows compact summary
1 parent dd0e0bc commit 1775b04

File tree

5 files changed

+191
-17
lines changed

5 files changed

+191
-17
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## [1.1.11] - 2025-01-27
4+
5+
### Fixed
6+
- **Minimized Goals View**: Goals tab now shows compact summary when minimized
7+
- Displays goal count and overall progress percentage
8+
- Shows top goal icon and current honor on right
9+
- Switching between Stats/Goals tabs works correctly when minimized
10+
311
## [1.1.10] - 2025-01-27
412

513
### Fixed

HonorLog.toc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
## Title: HonorLog
33
## Notes: Battleground statistics tracker for BCC Anniversary - tracks wins, losses, honor, marks, and more
44
## Author: You
5-
## Version: 1.1.10
5+
## Version: 1.1.11
66
## SavedVariables: HonorLogDB
77
## SavedVariablesPerCharacter: HonorLogCharDB
88

ROADMAP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# HonorLog Roadmap
22

3-
## Current Version: 1.1.10
3+
## Current Version: 1.1.11
44

55
---
66

UI/GoalsPanel.lua

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,22 +1796,34 @@ function HonorLog:SwitchTab(tabName)
17961796

17971797
frame.currentView = tabName
17981798

1799+
-- Update tab visual states
17991800
if tabName == "stats" then
18001801
frame.statsTab:SetActive(true)
18011802
frame.goalsTab:SetActive(false)
1802-
frame.statsView:Show()
1803-
frame.goalsPanel:Hide()
18041803
else
18051804
frame.statsTab:SetActive(false)
18061805
frame.goalsTab:SetActive(true)
1807-
frame.statsView:Hide()
1808-
frame.goalsPanel:Show()
1809-
self:UpdateGoalsPanel()
18101806
end
18111807

1812-
-- Ensure frame is expanded when switching tabs
1813-
if not self.db.settings.frameExpanded then
1814-
self:SetExpanded(true)
1808+
-- Update compact view content
1809+
if self.UpdateCompactView then
1810+
self:UpdateCompactView()
1811+
end
1812+
1813+
-- Handle expanded views based on frame state
1814+
if self.db.settings.frameExpanded then
1815+
if tabName == "stats" then
1816+
frame.statsView:Show()
1817+
frame.goalsPanel:Hide()
1818+
else
1819+
frame.statsView:Hide()
1820+
frame.goalsPanel:Show()
1821+
self:UpdateGoalsPanel()
1822+
end
1823+
else
1824+
-- When minimized, both expanded views stay hidden
1825+
frame.statsView:Hide()
1826+
frame.goalsPanel:Hide()
18151827
end
18161828
end
18171829

UI/MainFrame.lua

Lines changed: 161 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ local function CreateMainFrame()
235235
-- Version badge
236236
local versionBadge = header:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
237237
versionBadge:SetPoint("LEFT", title, "RIGHT", 4, 0)
238-
versionBadge:SetText("v1.1.6")
238+
versionBadge:SetText("v1.1.11")
239239
versionBadge:SetTextColor(unpack(COLORS.accent))
240240

241241
-- View mode indicator (pill badge)
@@ -295,6 +295,33 @@ local function CreateMainFrame()
295295
sessionQuick:SetJustifyH("RIGHT")
296296
frame.sessionQuick = sessionQuick
297297

298+
-- Goals compact view (shown when goals tab is active and minimized)
299+
local goalsCompactContainer = CreateFrame("Frame", nil, compact)
300+
goalsCompactContainer:SetAllPoints()
301+
goalsCompactContainer:Hide()
302+
frame.goalsCompact = goalsCompactContainer
303+
304+
-- Goals icon
305+
local goalsIcon = goalsCompactContainer:CreateTexture(nil, "ARTWORK")
306+
goalsIcon:SetSize(12, 12)
307+
goalsIcon:SetPoint("LEFT", PADDING, 0)
308+
goalsIcon:SetTexture("Interface\\Icons\\INV_Misc_Token_HonorHold")
309+
goalsIcon:SetTexCoord(0.08, 0.92, 0.08, 0.92)
310+
goalsIcon:SetAlpha(0.8)
311+
frame.goalsCompactIcon = goalsIcon
312+
313+
-- Goals summary text (left side)
314+
local goalsSummary = goalsCompactContainer:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
315+
goalsSummary:SetPoint("LEFT", goalsIcon, "RIGHT", 4, 0)
316+
goalsSummary:SetJustifyH("LEFT")
317+
frame.goalsCompactSummary = goalsSummary
318+
319+
-- Goals currency text (right side)
320+
local goalsCurrency = goalsCompactContainer:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
321+
goalsCurrency:SetPoint("RIGHT", -PADDING, 0)
322+
goalsCurrency:SetJustifyH("RIGHT")
323+
frame.goalsCompactCurrency = goalsCurrency
324+
298325
----------------------------------------------------------------------------
299326
-- EXPANDED VIEW (with scroll support)
300327
----------------------------------------------------------------------------
@@ -720,15 +747,32 @@ end
720747

721748
function HonorLog:SetExpanded(expanded)
722749
self.db.settings.frameExpanded = expanded
750+
local frame = self.mainFrame
723751

724752
-- Get saved width or use default
725753
local savedSize = self.db.settings.frameSize
726754
local width = (savedSize and savedSize[1]) or FRAME_WIDTH
727755

756+
-- Determine which view is active (default to stats if not set)
757+
local currentView = frame.currentView or "stats"
758+
728759
if expanded then
729-
self.mainFrame.expanded:Show()
730-
self.mainFrame:SetSize(width, FRAME_HEIGHT_EXPANDED)
731-
self.mainFrame.expandBtn.icon:SetTexture("Interface\\Buttons\\UI-MinusButton-UP")
760+
frame:SetSize(width, FRAME_HEIGHT_EXPANDED)
761+
frame.expandBtn.icon:SetTexture("Interface\\Buttons\\UI-MinusButton-UP")
762+
763+
-- Show the appropriate expanded view based on current tab
764+
if currentView == "goals" then
765+
frame.expanded:Hide()
766+
if frame.goalsPanel then
767+
frame.goalsPanel:Show()
768+
self:UpdateGoalsPanel()
769+
end
770+
else
771+
frame.expanded:Show()
772+
if frame.goalsPanel then
773+
frame.goalsPanel:Hide()
774+
end
775+
end
732776

733777
-- Update scroll bar visibility after showing
734778
C_Timer.After(0, function()
@@ -737,9 +781,42 @@ function HonorLog:SetExpanded(expanded)
737781
end
738782
end)
739783
else
740-
self.mainFrame.expanded:Hide()
741-
self.mainFrame:SetSize(width, FRAME_HEIGHT_COMPACT)
742-
self.mainFrame.expandBtn.icon:SetTexture("Interface\\Buttons\\UI-PlusButton-UP")
784+
-- Minimized state - hide all expanded views
785+
frame.expanded:Hide()
786+
if frame.goalsPanel then
787+
frame.goalsPanel:Hide()
788+
end
789+
frame:SetSize(width, FRAME_HEIGHT_COMPACT)
790+
frame.expandBtn.icon:SetTexture("Interface\\Buttons\\UI-PlusButton-UP")
791+
end
792+
793+
-- Update compact view to show appropriate content
794+
self:UpdateCompactView()
795+
end
796+
797+
function HonorLog:UpdateCompactView()
798+
local frame = self.mainFrame
799+
if not frame then return end
800+
801+
local currentView = frame.currentView or "stats"
802+
803+
if currentView == "goals" then
804+
-- Show goals compact, hide stats compact
805+
frame.statusIcon:Hide()
806+
frame.statusLine:Hide()
807+
frame.sessionQuick:Hide()
808+
if frame.goalsCompact then
809+
frame.goalsCompact:Show()
810+
self:UpdateGoalsCompact()
811+
end
812+
else
813+
-- Show stats compact, hide goals compact
814+
frame.statusIcon:Show()
815+
frame.statusLine:Show()
816+
frame.sessionQuick:Show()
817+
if frame.goalsCompact then
818+
frame.goalsCompact:Hide()
819+
end
743820
end
744821
end
745822

@@ -874,6 +951,83 @@ function HonorLog:UpdateMainFrame()
874951
frame.sessionRate:SetText("")
875952
frame.sessionRewards:SetText("")
876953
end
954+
955+
-- Update goals compact if in goals view
956+
if frame.currentView == "goals" and self.UpdateGoalsCompact then
957+
self:UpdateGoalsCompact()
958+
end
959+
end
960+
961+
--------------------------------------------------------------------------------
962+
-- GOALS COMPACT VIEW UPDATE
963+
--------------------------------------------------------------------------------
964+
function HonorLog:UpdateGoalsCompact()
965+
if not self.mainFrame then return end
966+
local frame = self.mainFrame
967+
968+
local goalCount = self:GetGoalCount()
969+
if goalCount == 0 then
970+
frame.goalsCompactSummary:SetText("No goals set")
971+
frame.goalsCompactSummary:SetTextColor(unpack(COLORS.textTertiary))
972+
frame.goalsCompactIcon:SetTexture("Interface\\Icons\\INV_Misc_Token_HonorHold")
973+
frame.goalsCompactIcon:SetVertexColor(0.5, 0.5, 0.5, 0.7)
974+
frame.goalsCompactCurrency:SetText("")
975+
else
976+
-- Get top goal info
977+
local goals = self:GetAllGoalsProgress()
978+
if goals and #goals > 0 then
979+
local topGoal = goals[1]
980+
981+
-- Update icon to match top goal
982+
local _, _, _, _, _, _, _, _, _, itemTexture = GetItemInfo(topGoal.itemID)
983+
if itemTexture then
984+
frame.goalsCompactIcon:SetTexture(itemTexture)
985+
else
986+
frame.goalsCompactIcon:SetTexture("Interface\\Icons\\INV_Misc_Token_HonorHold")
987+
end
988+
frame.goalsCompactIcon:SetTexCoord(0.08, 0.92, 0.08, 0.92)
989+
frame.goalsCompactIcon:SetVertexColor(1, 1, 1, 0.9)
990+
991+
-- Calculate overall progress
992+
local totalProgress = 0
993+
for _, goal in ipairs(goals) do
994+
local percent = 100
995+
if goal.honor.needed > 0 then
996+
percent = math.min(percent, goal.honor.percent)
997+
end
998+
if goal.arena.needed > 0 then
999+
percent = math.min(percent, goal.arena.percent)
1000+
end
1001+
for _, markData in pairs(goal.marks) do
1002+
percent = math.min(percent, markData.percent)
1003+
end
1004+
totalProgress = totalProgress + percent
1005+
end
1006+
local avgProgress = totalProgress / #goals
1007+
1008+
-- Summary text
1009+
local summaryText
1010+
if #goals == 1 then
1011+
summaryText = string.format("%s · %.0f%%", topGoal.name or "Goal", avgProgress)
1012+
else
1013+
summaryText = string.format("%d goals · %.0f%%", #goals, avgProgress)
1014+
end
1015+
frame.goalsCompactSummary:SetText(summaryText)
1016+
1017+
-- Color based on progress
1018+
if avgProgress >= 100 then
1019+
frame.goalsCompactSummary:SetTextColor(unpack(COLORS.progressFull))
1020+
elseif avgProgress >= 50 then
1021+
frame.goalsCompactSummary:SetTextColor(unpack(COLORS.progressPartial))
1022+
else
1023+
frame.goalsCompactSummary:SetTextColor(unpack(COLORS.textPrimary))
1024+
end
1025+
1026+
-- Currency display (current honor)
1027+
local currentHonor = self:GetCurrentHonor()
1028+
frame.goalsCompactCurrency:SetText(string.format("|cffffd700%s|r Honor", BreakUpLargeNumbers(currentHonor)))
1029+
end
1030+
end
8771031
end
8781032

8791033
--------------------------------------------------------------------------------

0 commit comments

Comments
 (0)