Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ls- committed Jan 25, 2023
2 parents efd7b3f + df6301a commit 7c5eea0
Show file tree
Hide file tree
Showing 16 changed files with 193 additions and 144 deletions.
11 changes: 4 additions & 7 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
std = "none"
max_line_length = false
max_comment_line_length = 120
self = false

exclude_files = {
Expand Down Expand Up @@ -49,7 +50,7 @@ read_globals = {
"AutoCastShine_AutoCastStart",
"AutoCastShine_AutoCastStop",
"BACKPACK_TOOLTIP",
"BagBarExpandToggle",
"BagsBar",
"BLIZZARD_STORE",
"BreakUpLargeNumbers",
"BuffFrame",
Expand All @@ -73,10 +74,6 @@ read_globals = {
"CanInspect",
"CHARACTER_BUTTON",
"CharacterBackSlot",
"CharacterBag0Slot",
"CharacterBag1Slot",
"CharacterBag2Slot",
"CharacterBag3Slot",
"CharacterChestSlot",
"CharacterFeetSlot",
"CharacterFinger0Slot",
Expand All @@ -88,7 +85,6 @@ read_globals = {
"CharacterMainHandSlot",
"CharacterModelScene",
"CharacterNeckSlot",
"CharacterReagentBag0Slot",
"CharacterSecondaryHandSlot",
"CharacterShirtSlot",
"CharacterShoulderSlot",
Expand All @@ -108,7 +104,6 @@ read_globals = {
"DebuffFrame",
"DeleteInboxItem",
"DUNGEONS_BUTTON",
"DurabilityFrame",
"ENCHANTED_TOOLTIP_LINE",
"Enum",
"ExtraAbilityContainer",
Expand Down Expand Up @@ -240,6 +235,7 @@ read_globals = {
"MaxDps",
"MicroButtonAndBagsBar",
"MicroButtonTooltipText",
"MicroMenu",
"Minimap",
"MinimapButtonFrame",
"MinimapCluster",
Expand Down Expand Up @@ -319,6 +315,7 @@ read_globals = {
"TOOLTIP_UPDATE_TIME",
"TooltipDataProcessor",
"TooltipUtil",
"TotemFrame",
"UIParent",
"UnitAura",
"UnitBattlePetLevel",
Expand Down
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# CHANGELOG

## Version 100005.01

- Added 10.0.5 support.

### Action Bars

- Removed bag bar mover. Use Edit Mode to move it.
- The micro menu is unchanged.

### Auras

- Re-added an option to destroy totems by right-clicking the totem buttons.

### Blizzard

- Removed durability frame mover. Use Edit Mode to move it.

### Minimap

- Fixed an issue where mousing over the difficulty flag would throw errors while in the guild group.

## Version 100002.04

### Action Bars
Expand Down
17 changes: 13 additions & 4 deletions ls_UI/core/changelog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,22 @@ local _G = getfenv(0)

-- Mine
E.CHANGELOG = [[
- Added 10.0.5 support.
### Action Bars
- Fixed an issue which sometimes would make the Edit Mode throw SetScale errors.
- Removed bag bar mover. Use Edit Mode to move it.
- The micro menu is unchanged.
### Auras
- Re-added an option to destroy totems by right-clicking the totem buttons.
### Blizzard
- Removed durability frame mover. Use Edit Mode to move it.
### Minimap
- Added "Auto Zoom Out" option. Set to 5s by default.
- Improved compatibility with other minimap addons like FarmHud. There's still issues on the
FarmHud's end, but I already notified its dev about them.
- Fixed an issue where mousing over the difficulty flag would throw errors while in the guild group.
]]
10 changes: 10 additions & 0 deletions ls_UI/core/modernize.lua
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,16 @@ function P:Modernize(data, name, key)

data.version = 10000201
end

--> 100005.01
if data.version < 10000501 then
if data.movers then
data.movers.DurabilityFrameMover = nil
data.movers.LSBagBarMover = nil
end

data.version = 10000501
end
elseif key == "private" then
--> 90001.05
if data.version < 9000105 then
Expand Down
4 changes: 2 additions & 2 deletions ls_UI/ls_UI.toc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Interface: 100002
## Interface: 100005
## Author: lightspark
## Version: 100002.04
## Version: 100005.01
## Title: LS: |cff1a9fc0UI|r
## Notes: Yet another UI, but this one is a bit special...
## SavedVariables: LS_UI_GLOBAL_CONFIG, LS_UI_PRIVATE_CONFIG
Expand Down
86 changes: 48 additions & 38 deletions ls_UI/modules/auras/auras.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local MODULE = P:AddModule("Auras")

-- Lua
local _G = getfenv(0)
local hooksecurefunc = _G.hooksecurefunc
local next = _G.next
local type = _G.type
local unpack = _G.unpack
Expand Down Expand Up @@ -104,8 +105,6 @@ do

if self:GetAttribute("index") then
GameTooltip:SetUnitAura(self:GetParent():GetAttribute("unit"), self:GetID(), self:GetAttribute("filter"))
elseif self:GetAttribute("totem-slot") then
GameTooltip:SetTotem(self:GetID())
else
GameTooltip:SetInventoryItem("player", self:GetID())
end
Expand Down Expand Up @@ -322,55 +321,61 @@ do
self:UpdateCooldownConfig()
E.Layout:Update(self)
end

function totem_header_proto:OnEvent()
local activeTotems = 0

for i = 1, MAX_TOTEMS do
local hasTotem, _, startTime, duration, icon = GetTotemInfo(i)
if hasTotem then
activeTotems = activeTotems + 1

local button = self._buttons[activeTotems]
button.Icon:SetTexture(icon)
button:Show()

if duration and duration > 0 and startTime then
button.Cooldown:SetCooldown(startTime, duration)
button.Cooldown:Show()
else
button.Cooldown:Hide()
end
end
end

for i = activeTotems + 1, MAX_TOTEMS do
self._buttons[i]:Hide()
end
end
end

local function createHeader(filter)
local header
if filter == "TOTEM" then
header = Mixin(CreateFrame("Frame", "LSTotemHeader", UIParent), header_proto, totem_header_proto)
header:SetPoint(unpack(C.db.profile.auras[filter].point))
header:RegisterEvent("PLAYER_TOTEM_UPDATE")
header:RegisterEvent("PLAYER_ENTERING_WORLD")
header:SetScript("OnEvent", header.OnEvent)
header._buttons = {}

for i = 1, MAX_TOTEMS do
local button = Mixin(E:CreateButton(header, "$parentButton" .. i, false, true), button_proto)
button:SetPushedTexture(0)
button:SetHighlightTexture(0)
button:SetScript("OnEnter", button.OnEnter)
button:SetScript("OnLeave", button.OnLeave)
button:SetAttribute("totem-slot", i)
button:SetID(i)
button:Hide()
button._parent = header
header._buttons[i] = button
end

hooksecurefunc(TotemFrame, "Update", function()
local activeTotems = 0

for i = 1, MAX_TOTEMS do
local hasTotem, _, startTime, duration, icon = GetTotemInfo(i)
if hasTotem then
activeTotems = activeTotems + 1

local button = header._buttons[activeTotems]
button.Icon:SetTexture(icon)
button.slot = i
button:Show()

if duration and duration > 0 and startTime then
button.Cooldown:SetCooldown(startTime, duration)
button.Cooldown:Show()
else
button.Cooldown:Hide()
end

-- strangely enough, these buttons aren't protected which means I can use them to handle totem destruction
for totem in TotemFrame.totemPool:EnumerateActive() do
if totem.slot == i then
totem:ClearAllPoints()
totem:SetParent(button)
totem:SetAllPoints(button)
totem:SetAlpha(0)
totem:SetFrameLevel(button:GetFrameLevel() + 1)
end
end
end
end

for i = activeTotems + 1, MAX_TOTEMS do
header._buttons[i]:Hide()
end
end)
else
header = Mixin(CreateFrame("Frame", filter == "HELPFUL" and "LSBuffHeader" or "LSDebuffHeader", UIParent, "SecureAuraHeaderTemplate"), header_proto)
header:SetPoint(unpack(C.db.profile.auras[filter].point))
Expand Down Expand Up @@ -416,9 +421,14 @@ function MODULE:Init()
createHeader("HARMFUL")
createHeader("TOTEM")

E:ForceHide(BuffFrame)
E:ForceHide(DebuffFrame)
E:ForceHide(DeadlyDebuffFrame)
-- do it on PEW because numHideableBuffs will be nil otherwise
E:RegisterEvent("PLAYER_ENTERING_WORLD", function(isLogin, isReload)
if isLogin or isReload then
E:ForceHide(BuffFrame)
E:ForceHide(DebuffFrame)
E:ForceHide(DeadlyDebuffFrame)
end
end)

isInit = true

Expand Down
44 changes: 8 additions & 36 deletions ls_UI/modules/bars/bag.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local MODULE = P:GetModule("Bars")
-- Lua
local _G = getfenv(0)
local next = _G.next
local unpack = _G.unpack
local t_wipe = _G.table.wipe

-- Mine
local isInit = false
Expand All @@ -30,7 +30,7 @@ do
GameTooltip:SetText(self.tooltipText, 1, 1, 1, 1)
GameTooltip:AddLine(L["FREE_BAG_SLOTS_TOOLTIP"]:format(self.freeSlots))

if self._parent._config.tooltip then
if C.db.profile.bars.bag.tooltip then
GameTooltip:AddLine(" ")
GameTooltip:AddLine(L["CURRENCY_COLON"])

Expand Down Expand Up @@ -83,52 +83,21 @@ do
end
end

local bar_proto = {
UpdateCooldownConfig = E.NOOP,
UpdateLayout = E.NOOP,
ForEach = E.NOOP,
}
do
function bar_proto:UpdateConfig()
self._config = E:CopyTable(C.db.profile.bars.bag, self._config)
end

function bar_proto:Update()
self:UpdateConfig()
self:UpdateFading()
end
end

function MODULE:HasBag()
return isInit
end

function MODULE:CreateBag()
if not isInit then
local bar = Mixin(self:Create("bag", "LSBagBar"), bar_proto)
bar:SetSize(216, 44)

MainMenuBarBackpackButton:SetParent(bar)
BagBarExpandToggle:SetParent(bar)
CharacterBag0Slot:SetParent(bar)
CharacterBag1Slot:SetParent(bar)
CharacterBag2Slot:SetParent(bar)
CharacterBag3Slot:SetParent(bar)
CharacterReagentBag0Slot:SetParent(bar)

bar:SetPoint(unpack(C.db.profile.bars.bag.point))
E.Movers:Create(bar)

Mixin(MainMenuBarBackpackButton, button_proto)
MainMenuBarBackpackButton:SetPoint("TOPRIGHT", 4, 2)
MainMenuBarBackpackButton:SetScript("OnEnter", MainMenuBarBackpackButton.OnEnter)
MainMenuBarBackpackButton:HookScript("OnEvent", MainMenuBarBackpackButton.OnEventHook)
MainMenuBarBackpackButton:RegisterEvent("UPDATE_BINDINGS")
MainMenuBarBackpackButton:RegisterEvent("TOKEN_MARKET_PRICE_UPDATED")

MainMenuBarBackpackButton._parent = bar
MainMenuBarBackpackButton.tooltipText = MicroButtonTooltipText(BACKPACK_TOOLTIP, "TOGGLEBACKPACK")
MainMenuBarBackpackButton.UpdateTooltip = MainMenuBarBackpackButton.OnEnter

E:SetUpFading(BagsBar)

isInit = true

Expand All @@ -138,6 +107,9 @@ end

function MODULE:UpdateBag()
if isInit then
self:For("bag", "Update")
BagsBar._config = t_wipe(BagsBar._config or {})
BagsBar._config.fade = E:CopyTable(C.db.profile.bars.bag.fade, BagsBar._config.fade)

BagsBar:UpdateFading()
end
end
1 change: 1 addition & 0 deletions ls_UI/modules/bars/junk.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ function MODULE:CleanUp()
E:AddOnLoadTask("Blizzard_NewPlayerExperience", disableNPE)
end

hideBar(MicroMenu)
hideBar(MicroButtonAndBagsBar)

QueueStatusButton:SetParent(UIParent)
Expand Down
2 changes: 0 additions & 2 deletions ls_UI/modules/bars/micromenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -911,8 +911,6 @@ function MODULE:CreateMicroMenu()
buttons[idToIndex[id]] = button
end

hooksecurefunc("UpdateMicroButtonsParent", updateMicroButtonsParent)
hooksecurefunc("MoveMicroButtons", moveMicroButtons)
hooksecurefunc("UpdateMicroButtons", updateMicroButtons)
hooksecurefunc("MainMenuMicroButton_ShowAlert", repositionAlert)

Expand Down
1 change: 0 additions & 1 deletion ls_UI/modules/blizzard/_blizzard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<Script file="characterframe.lua"/>
<Script file="commandbar.lua"/>
<Script file="digsitebar.lua"/>
<Script file="durability.lua"/>
<Script file="gm.lua"/>
<Script file="mail.lua"/>
<Script file="mawbuffs.lua"/>
Expand Down
1 change: 0 additions & 1 deletion ls_UI/modules/blizzard/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ function BLIZZARD:Init()
self:SetUpCharacterFrame()
self:SetUpCommandBar()
self:SetUpDigsiteBar()
self:SetUpDurabilityFrame()
self:SetUpGMFrame()
self:SetUpMail()
self:SetUpMawBuffs()
Expand Down
Loading

0 comments on commit 7c5eea0

Please sign in to comment.