-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Customizable action bar overlay position, font size, and number format #38
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
Merged
+197
−5
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: Xerrion/PhDamage
Length of output: 89
🏁 Script executed:
Repository: Xerrion/PhDamage
Length of output: 91
🏁 Script executed:
Repository: Xerrion/PhDamage
Length of output: 1327
🏁 Script executed:
Repository: Xerrion/PhDamage
Length of output: 645
🏁 Script executed:
Repository: Xerrion/PhDamage
Length of output: 2188
🏁 Script executed:
Repository: Xerrion/PhDamage
Length of output: 410
🏁 Script executed:
Repository: Xerrion/PhDamage
Length of output: 4084
🏁 Script executed:
Repository: Xerrion/PhDamage
Length of output: 78
🏁 Script executed:
Repository: Xerrion/PhDamage
Length of output: 6678
🏁 Script executed:
Repository: Xerrion/PhDamage
Length of output: 1474
🏁 Script executed:
Repository: Xerrion/PhDamage
Length of output: 260
🏁 Script executed:
Repository: Xerrion/PhDamage
Length of output: 1004
Harden persisted overlay values before calling frame APIs.
cfg.anchor,cfg.offsetX,cfg.offsetY, andcfg.fontSizeare consumed directly from SavedVariables. The fallback operators (orpattern) don't protect against type mismatches—corrupted data (e.g.,cfg.anchor = 123orcfg.offsetX = "abc") will be truthy and passed toSetPoint/SetFont, causing errors. If a profile has invalid/stale values, overlay updates break. Add runtime normalization: anchor allowlist validation, numeric coercion for offsets,fontSizeclamp to 6–24.Proposed fix
local function ApplyOverlayAppearance(fontString, button) local cfg = ns.Addon and ns.Addon.db and ns.Addon.db.profile and ns.Addon.db.profile.overlay or {} - local anchor = cfg.anchor or "BOTTOM" - local offsetX = cfg.offsetX or 0 - local offsetY = cfg.offsetY or 2 - local fontSize = cfg.fontSize or 10 + local VALID_ANCHORS = { + BOTTOM = true, TOP = true, CENTER = true, + LEFT = true, RIGHT = true, + BOTTOMLEFT = true, BOTTOMRIGHT = true, + TOPLEFT = true, TOPRIGHT = true, + } + + local anchor = type(cfg.anchor) == "string" and strupper(cfg.anchor) or "BOTTOM" + if not VALID_ANCHORS[anchor] then + anchor = "BOTTOM" + end + + local offsetX = tonumber(cfg.offsetX) or 0 + local offsetY = tonumber(cfg.offsetY) or 2 + local fontSize = tonumber(cfg.fontSize) or 10 + if fontSize < 6 then fontSize = 6 end + if fontSize > 24 then fontSize = 24 end fontString:ClearAllPoints() fontString:SetPoint(anchor, button, anchor, offsetX, offsetY) fontString:SetFont("Fonts\\ARIALN.TTF", fontSize, "OUTLINE") end🤖 Prompt for AI Agents