Skip to content
Open
Show file tree
Hide file tree
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
18 changes: 18 additions & 0 deletions WoWUI.toc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Interface: 100206
## Title: WoWUI
## Notes: Minimalist unit frames and action bars using oUF and LibActionButton
## Author: Jules
## Version: 1.0.0
## SavedVariables: WoWUI_DB

libs/LibActionButton-1.0/LibStub/LibStub.lua
libs/LibActionButton-1.0/CallbackHandler-1.0/CallbackHandler-1.0.lua
libs/LibActionButton-1.0/LibButtonGlow-1.0/LibButtonGlow-1.0.lua
libs/LibActionButton-1.0/LibActionButton-1.0.lua

libs/oUF/oUF.xml

core.lua
settings.lua
unitframes.lua
actionbars.lua
130 changes: 130 additions & 0 deletions actionbars.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
local addonName, ns = ...
local LAB = LibStub("LibActionButton-1.0")

ns.WoWUI.actionBars = {}
local buttonSpacing = 4

local function CreateBar(name, numButtons, point, x, y, rows)
-- Inherit SecureHandlerStateTemplate to use FrameRefs, WrapScript, and StateDrivers safely
local bar = CreateFrame("Frame", "WoWUIActionBar_" .. name, UIParent, "SecureHandlerStateTemplate")
bar.numButtons = numButtons
bar.rows = rows
table.insert(ns.WoWUI.actionBars, bar)

local cols = math.ceil(numButtons / rows)

bar:SetPoint(point, x, y)

bar.buttons = {}

for i = 1, numButtons do
local btn = LAB:CreateButton(i, "WoWUIButton_" .. name .. "_" .. i, bar, nil)


local col = (i - 1) % cols
local row = math.floor((i - 1) / cols)



table.insert(bar.buttons, btn)
end

ns.WoWUI:RegisterMovable(bar, "ActionBar_" .. name)

return bar
end

local MainBar = CreateBar("Main", 12, "BOTTOM", 0, 50, 1)
local BottomLeftBar = CreateBar("BottomLeft", 12, "BOTTOM", 0, 90, 1)
local BottomRightBar = CreateBar("BottomRight", 12, "BOTTOM", 0, 130, 1)
local RightBar1 = CreateBar("Right1", 12, "RIGHT", -50, 0, 12)
local RightBar2 = CreateBar("Right2", 12, "RIGHT", -10, 0, 12)

function ns.WoWUI:UpdateActionBarSizes()
local w = WoWUI_DB.settings.abWidth
local h = WoWUI_DB.settings.abHeight
for _, bar in ipairs(ns.WoWUI.actionBars) do
local cols = math.ceil(bar.numButtons / bar.rows)
bar:SetSize((w + buttonSpacing) * cols - buttonSpacing, (h + buttonSpacing) * bar.rows - buttonSpacing)
for i, btn in ipairs(bar.buttons) do
btn:SetSize(w, h)
local col = (i - 1) % cols
local row = math.floor((i - 1) / cols)
btn:ClearAllPoints()
btn:SetPoint("TOPLEFT", bar, "TOPLEFT", col * (w + buttonSpacing), -row * (h + buttonSpacing))
end
end
end



-- Setup State Drivers for paging (Stance/Form/Stealth/Vehicle)
local pageDriver = "[vehicleui] 12; [possessbar] 12; [overridebar] 14; [shapeshift] 13; [bar:2] 2; [bar:3] 3; [bar:4] 4; [bar:5] 5; [bar:6] 6; [bonusbar:1] 7; [bonusbar:2] 8; [bonusbar:3] 9; [bonusbar:4] 10; 1"

MainBar:RegisterEvent("PLAYER_LOGIN")
MainBar:SetScript("OnEvent", function(self, event)
if event == "PLAYER_LOGIN" then
-- Apply state driver to the main bar
for i, btn in ipairs(MainBar.buttons) do
btn:SetState(0, "action", i)
for state = 1, 14 do
btn:SetState(state, "action", (state - 1) * 12 + i)
end
end
RegisterStateDriver(MainBar, "page", pageDriver)
MainBar:SetAttribute("_onstate-page", [[
self:ChildUpdate("state", newstate)
]])

-- Setup child updates
for i, btn in ipairs(MainBar.buttons) do
MainBar:SetFrameRef("Button"..i, btn)
btn:SetAttribute("frameref-MainBar", MainBar)
end

-- Add button state script mapping (so they react to ChildUpdate)
for i, btn in ipairs(MainBar.buttons) do
SecureHandlerWrapScript(btn, "OnAttributeChanged", btn, [[
if name == "state-page" then
self:SetAttribute("state", value)
end
]])
end

-- Static Action Bars
local staticOffset = {
[BottomLeftBar] = 6, -- Action Page 6 (BottomLeft)
[BottomRightBar] = 5, -- Action Page 5 (BottomRight)
[RightBar1] = 3, -- Action Page 3 (Right 1)
[RightBar2] = 4, -- Action Page 4 (Right 2)
}

for bar, page in pairs(staticOffset) do
for i, btn in ipairs(bar.buttons) do
btn:SetState(0, "action", (page - 1) * 12 + i)
end
end

-- Hide default Blizzard action bars robustly
local hiddenFrame = CreateFrame("Frame")
hiddenFrame:Hide()

local framesToHide = {
MainMenuBar,
MultiBarBottomLeft,
MultiBarBottomRight,
MultiBarLeft,
MultiBarRight,
StanceBarFrame,
PossessBarFrame,
PetActionBarFrame,
}

for _, frame in ipairs(framesToHide) do
if frame then
frame:SetParent(hiddenFrame)
frame:UnregisterAllEvents()
end
end
end
end)
110 changes: 110 additions & 0 deletions core.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
local addonName, ns = ...

-- Global table for saving positions
WoWUI_DB = WoWUI_DB or {}


local WoWUI = CreateFrame("Frame")
ns.WoWUI = WoWUI

local movableFrames = {}

WoWUI:RegisterEvent("ADDON_LOADED")
WoWUI:SetScript("OnEvent", function(self, event, loadedAddon)
if loadedAddon == addonName then
WoWUI_DB.positions = WoWUI_DB.positions or {}
WoWUI_DB.settings = WoWUI_DB.settings or { abWidth = 36, abHeight = 36, ufWidth = 200, ufHeight = 40 }

self:UnregisterEvent("ADDON_LOADED")

-- Restore saved positions now that the DB is loaded
if ns.WoWUI.UpdateActionBarSizes then ns.WoWUI:UpdateActionBarSizes() end
if ns.WoWUI.UpdateUnitFrameSizes then ns.WoWUI:UpdateUnitFrameSizes() end

for _, frame in ipairs(movableFrames) do
local name = frame.dbKey
if WoWUI_DB.positions[name] then
local pos = WoWUI_DB.positions[name]
frame:ClearAllPoints()
frame:SetPoint(pos[1], UIParent, pos[2], pos[3], pos[4])
end
end
end
end)

-- Movability system
local unlocked = false

function WoWUI:RegisterMovable(frame, name)
frame.dbKey = name
table.insert(movableFrames, frame)

local mover = CreateFrame("Frame", nil, frame, "BackdropTemplate")
mover:SetAllPoints(frame)
mover:SetFrameStrata("TOOLTIP")
mover:EnableMouse(true)
mover:RegisterForDrag("LeftButton")

mover:SetScript("OnDragStart", function(self)
frame:StartMoving()
end)

mover:SetScript("OnDragStop", function(self)
frame:StopMovingOrSizing()
local point, _, relativePoint, x, y = frame:GetPoint()
WoWUI_DB.positions[frame.dbKey] = { point, relativePoint, x, y }
end)

-- Simple background to show it's unlocked
local tex = mover:CreateTexture(nil, "BACKGROUND")
tex:SetAllPoints()
tex:SetColorTexture(0, 1, 0, 0.4)

local text = mover:CreateFontString(nil, "OVERLAY", "GameFontNormal")
text:SetPoint("CENTER")
text:SetText(name)

mover:Hide()
frame.mover = mover

-- If the frame is registered after ADDON_LOADED has fired, try to load it now
if WoWUI_DB and WoWUI_DB.positions and WoWUI_DB.positions[name] then
local pos = WoWUI_DB.positions[name]
frame:ClearAllPoints()
frame:SetPoint(pos[1], UIParent, pos[2], pos[3], pos[4])
end
end

SLASH_WOWUI1 = "/wowui"
SlashCmdList["WOWUI"] = function(msg)
if msg == "unlock" then
unlocked = true
for _, frame in ipairs(movableFrames) do
frame:SetMovable(true)
frame:SetUserPlaced(true)
frame.mover:Show()
end
print("WoWUI: Frames unlocked.")
elseif msg == "settings" then
if not WoWUI.settingsFrame then
WoWUI:CreateSettingsFrame()
end
if WoWUI.settingsFrame:IsShown() then
WoWUI.settingsFrame:Hide()
else
WoWUI.settingsFrame:Show()
end
elseif msg == "lock" then
unlocked = false
for _, frame in ipairs(movableFrames) do
frame:SetMovable(false)
frame.mover:Hide()
end
print("WoWUI: Frames locked.")
else
print("WoWUI Commands:")
print(" /wowui unlock - Unlock frames to move them")
print(" /wowui settings - Open settings menu")
print(" /wowui lock - Lock frames")
end
end
109 changes: 109 additions & 0 deletions libs/LibActionButton-1.0/CHANGES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
tag 69904d18f5834df9ee3d7bc820348cf19cfa750e 0.60
Author: Hendrik Leppkes <h.leppkes@gmail.com>
Date: Tue Mar 24 19:44:34 2026 +0100

Tag as 0.60

commit 4b6b13af72da5eca2e7784b0e8eb614648e8b31f
Author: Hendrik Leppkes <h.leppkes@gmail.com>
Date: Tue Mar 24 16:13:43 2026 +0100

Update cooldown handling for 12.0.1.66562 hotfix

commit fbcc6ec6ad744df7e3436773c39fadbf13e5f9c3
Author: Hendrik Leppkes <h.leppkes@gmail.com>
Date: Tue Mar 24 15:34:27 2026 +0100

Update level link lock handling to match latest Blizzard changes

commit 004f030840fb367f05a458e4e3d3619f02df2186
Author: Hendrik Leppkes <h.leppkes@gmail.com>
Date: Thu Jan 22 20:48:48 2026 +0100

Use C_Spell.GetSpellDisplayCount when appropriate

Fixes a secret comparison error for spell buttons

commit d437febf91703c7e9817af1c564d39232c06b28e
Author: Hendrik Leppkes <h.leppkes@gmail.com>
Date: Thu Jan 22 20:48:07 2026 +0100

Factor display count computation into the button type prototype

commit ef7d8c7cf98c0a221a16974eb917dbf963221124
Author: Hendrik Leppkes <h.leppkes@gmail.com>
Date: Tue Jan 20 16:59:05 2026 +0100

Check cooldown info for sanity before using them with ApplyCooldown

commit c2cf2990ed1ddc907ddfa80a046ff60f859b3261
Author: Hendrik Leppkes <h.leppkes@gmail.com>
Date: Sat Jan 17 15:55:02 2026 +0100

Remove button state override on mouse up

The issue this was designed to fix has seemingly been fixed in the game,
and it ended up causing issues with button clicks when keybindings and
mouse clicks are combined in certain ways.

commit 4fc8d919def3fd96d26c6a248e1c28d16f825ba4
Author: Hendrik Leppkes <h.leppkes@gmail.com>
Date: Fri Jan 16 09:49:45 2026 +0100

Disable use of vanilla overlay glow for now

commit 90c63511a0bcb28364219a61492f7e9a098d353a
Author: Hendrik Leppkes <h.leppkes@gmail.com>
Date: Fri Jan 16 00:11:44 2026 +0100

Limit using ActionButtonSpellAlertManager to retail

Its broken, but present, on TBC Anniversary. Thanks Blizzard.

commit 72510e09490fa2aa7c4f19a720d77e85452e84fd
Author: Hendrik Leppkes <h.leppkes@gmail.com>
Date: Wed Jan 14 15:18:07 2026 +0100

Update click handling for BCC Annivesary

commit d0baa26997e9b3b85e96fdba3971cdfd07569f97
Author: Hendrik Leppkes <h.leppkes@gmail.com>
Date: Mon Dec 15 09:53:27 2025 +0100

Update event registration for TBC Classic 2.5.5

commit 11d3e2b6a424a1114080cd4db78f1b2e88c79516
Author: Hendrik Leppkes <h.leppkes@gmail.com>
Date: Mon Dec 15 09:27:24 2025 +0100

Use ActionButtonSpellAlertManager for proc glow

commit dad6203f1295bc5ebf60c7ae7dad86f8dd312f4d
Author: Hendrik Leppkes <h.leppkes@gmail.com>
Date: Mon Dec 15 08:41:21 2025 +0100

Fix pre-12 charge info handling

commit f600a42d4ad3a2d9e00ec4f94232a2a603c0254e
Author: Hendrik Leppkes <h.leppkes@gmail.com>
Date: Fri Dec 12 14:03:55 2025 +0100

Update TOC for recent releases and Midnight

commit 50fabf9e37377b3ace8c7e4566b0e4a337428e56
Author: Hendrik Leppkes <h.leppkes@gmail.com>
Date: Fri Dec 12 14:01:13 2025 +0100

Use GetActionDisplayCount if available in Midnight

commit 046186d19b24fe93b2a72b09a7f35f9498d5768b
Author: Hendrik Leppkes <h.leppkes@gmail.com>
Date: Fri Dec 12 14:00:39 2025 +0100

Update Cooldown API for Midnight

commit d3ac3d3d324c7cb9b8dab17ea555aab5da7e33d0
Author: Hendrik Leppkes <h.leppkes@gmail.com>
Date: Fri Dec 12 13:58:26 2025 +0100

Update event registration for Midnight
Loading