Skip to content

Commit e328b89

Browse files
committed
feat: add hourly rate to minimized stats view, fix hourly rate initialization
1 parent 1775b04 commit e328b89

File tree

6 files changed

+42
-7
lines changed

6 files changed

+42
-7
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,25 @@ jobs:
2020
rsync -av --exclude='.git*' --exclude='.github' --exclude='release' --exclude='*.md' --exclude='ROADMAP.md' ./ release/HonorLog/
2121
cd release && zip -r HonorLog-${{ github.ref_name }}.zip HonorLog
2222
23+
- name: Extract changelog
24+
id: changelog
25+
run: |
26+
# Use full changelog (skip the "# Changelog" header line)
27+
CHANGELOG=$(tail -n +3 CHANGELOG.md)
28+
# Handle multi-line output for GitHub Actions
29+
echo "content<<EOF" >> $GITHUB_OUTPUT
30+
echo "$CHANGELOG" >> $GITHUB_OUTPUT
31+
echo "EOF" >> $GITHUB_OUTPUT
32+
2333
- name: Upload to CurseForge
2434
uses: itsmeow/curseforge-upload@v3
2535
with:
2636
token: ${{ secrets.CURSEFORGE_TOKEN }}
2737
project_id: 1442154 # Replace with your actual CurseForge project ID
2838
game_endpoint: wow
2939
file_path: release/HonorLog-${{ github.ref_name }}.zip
30-
changelog: "See CHANGELOG.md for details"
31-
changelog_type: text
40+
changelog: ${{ steps.changelog.outputs.content }}
41+
changelog_type: markdown
3242
display_name: HonorLog ${{ github.ref_name }}
3343
game_versions: "WoW Burning Crusade Classic,2.5.4"
3444
release_type: release

CHANGELOG.md

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

3+
## [1.1.12] - 2025-01-28
4+
5+
### Added
6+
- **Minimized Hourly Rate**: Stats compact view now shows honor/hr alongside win-loss record
7+
8+
### Fixed
9+
- **Hourly Rate Display**: Fixed hourly rate not showing after updating addon
10+
- sessionStartTime was not initialized during migration from older versions
11+
- Added safety check to ensure sessionStartTime is always valid
12+
313
## [1.1.11] - 2025-01-27
414

515
### Fixed

Data.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ function HonorLog:InitializeDB()
148148
if not lastSessionDate then
149149
HonorLogCharDB.sessionDate = today
150150
lastSessionDate = today
151+
-- Also set sessionStartTime if missing (needed for hourly rate calculation)
152+
if not HonorLogCharDB.sessionStartTime or HonorLogCharDB.sessionStartTime == 0 then
153+
HonorLogCharDB.sessionStartTime = now
154+
end
151155
self.isReload = true
152156
-- Reset if it's a new day
153157
elseif lastSessionDate ~= today then
@@ -176,6 +180,12 @@ function HonorLog:InitializeDB()
176180
HonorLogCharDB.lastUpdateTime = now
177181
end
178182

183+
-- Safety: Ensure sessionStartTime is valid for hourly rate calculation
184+
-- This handles edge cases where sessionStartTime was never set
185+
if not HonorLogCharDB.sessionStartTime or HonorLogCharDB.sessionStartTime == 0 then
186+
HonorLogCharDB.sessionStartTime = now
187+
end
188+
179189
-- Update tracking values
180190
HonorLogCharDB.lastGameTime = currentGameTime
181191

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.11
5+
## Version: 1.1.12
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.11
3+
## Current Version: 1.1.12
44

55
---
66

UI/MainFrame.lua

Lines changed: 8 additions & 3 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.11")
238+
versionBadge:SetText("v1.1.12")
239239
versionBadge:SetTextColor(unpack(COLORS.accent))
240240

241241
-- View mode indicator (pill badge)
@@ -870,8 +870,13 @@ function HonorLog:UpdateMainFrame()
870870
local totalSession = self:GetTotalSessionStats()
871871
if totalSession.played > 0 then
872872
local color = totalSession.winrate >= 50 and COLORS.win or COLORS.loss
873-
frame.sessionQuick:SetText(string.format("%d-%d %.0f%%",
874-
totalSession.wins, totalSession.losses, totalSession.winrate))
873+
local quickText = string.format("%d-%d %.0f%%",
874+
totalSession.wins, totalSession.losses, totalSession.winrate)
875+
-- Add hourly rate if available
876+
if totalSession.hourlyRate > 0 then
877+
quickText = quickText .. string.format(" |cffffd700%d/hr|r", totalSession.hourlyRate)
878+
end
879+
frame.sessionQuick:SetText(quickText)
875880
frame.sessionQuick:SetTextColor(unpack(color))
876881
else
877882
frame.sessionQuick:SetText("--")

0 commit comments

Comments
 (0)