Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ls- committed Dec 16, 2022
2 parents 99cafd7 + dfd883d commit efd7b3f
Show file tree
Hide file tree
Showing 16 changed files with 374 additions and 469 deletions.
560 changes: 204 additions & 356 deletions .luacheckrc

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions .luacheckrc_build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
$luacheckrc = ".\.luacheckrc"

$out = ""
foreach ($line in Get-Content $luacheckrc) {
if ($line -match "read_globals") { break }

$out += $line + "`n"
}

Set-Content $luacheckrc -Value $out.TrimEnd()

$out = @()
luacheck . | ForEach-Object {
if ($_ -match "accessing undefined variable '(.+?)'") {
if ($out -notcontains $matches[1]) {
$out += $matches[1]
}
}
}

Add-Content $luacheckrc ""
Add-Content $luacheckrc ("read_globals = {")

foreach ($arg in $out | Sort-Object) {
Add-Content $luacheckrc ("`t`"" + $arg + "`",")
}

Add-Content $luacheckrc ("}")
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# CHANGELOG

## Version 100002.04

### Action Bars

- Fixed an issue which sometimes would make the Edit Mode throw SetScale errors.

### 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.

## Version 100002.03

### Action Bars
Expand Down
8 changes: 7 additions & 1 deletion ls_UI/core/changelog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,11 @@ local _G = getfenv(0)
E.CHANGELOG = [[
### Action Bars
- Fixed an issue where the OOM indicator state wouldn't reset properly on config updates.
- Fixed an issue which sometimes would make the Edit Mode throw SetScale errors.
### 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.
]]
14 changes: 14 additions & 0 deletions ls_UI/core/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ local _G = getfenv(0)
local assert = _G.assert
local geterrorhandler = _G.geterrorhandler
local hooksecurefunc = _G.hooksecurefunc
local issecurevariable = _G.issecurevariable
local next = _G.next
local pairs = _G.pairs
local s_format = _G.string.format
local s_split = _G.string.split
local select = _G.select
local t_insert = _G.table.insert
local tonumber = _G.tonumber
local type = _G.type
local xpcall = _G.xpcall

Expand Down Expand Up @@ -297,3 +299,15 @@ function E:IsEqualTable(a, b)
return a == b
end
end

function E:PurgeKey(t, k)
t[k] = nil

local c = -42
repeat
if t[c] == nil then
t[c] = nil
end
c = c - 1
until issecurevariable(t, k)
end
1 change: 1 addition & 0 deletions ls_UI/core/defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1872,6 +1872,7 @@ D.profile = {
shape = "round", -- "round", "square"
flip = false,
rotate = false,
auto_zoom = 5,
color = {
border = false,
},
Expand Down
15 changes: 8 additions & 7 deletions ls_UI/core/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -744,8 +744,12 @@ end
function E:ForceHide(object, skipEvents)
if not object then return end

object:Hide(true)
object:SetParent(self.HIDDEN_PARENT)
-- EditMode bs
if object.HideBase then
object:HideBase(true)
else
object:Hide(true)
end

if object.EnableMouse then
object:EnableMouse(false)
Expand All @@ -756,18 +760,15 @@ function E:ForceHide(object, skipEvents)
object:UnregisterAllEvents()
end

if object:GetName() then
object.ignoreFramePositionManager = true
object:SetAttribute("ignoreFramePositionManager", true)
end

object:SetAttribute("statehidden", true)
end

if object.SetUserPlaced then
pcall(object.SetUserPlaced, object, true)
pcall(object.SetDontSavePosition, object, true)
end

object:SetParent(self.HIDDEN_PARENT)
end

function E:GetScreenQuadrant(frame)
Expand Down
2 changes: 1 addition & 1 deletion ls_UI/embeds/LibActionButton-1.0
3 changes: 3 additions & 0 deletions ls_UI/locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -499,3 +499,6 @@ L["Y_OFFSET"] = "yOffset"
L["YOUR_HEALING"] = "Your Healing"
L["YOURS_FIRST"] = "Yours First"
L["ZONE_ABILITY_BUTTON"] = "Zone Ability Button"

L["MINIMAP_AUTO_ZOOM_OUT"] = "Auto Zoom Out"
L["MINIMAP_AUTO_ZOOM_OUT_DESC"] = "The period (in seconds) after which the minimap will automatically zoom out. Set to 0 to disable."
2 changes: 1 addition & 1 deletion ls_UI/ls_UI.toc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Interface: 100002
## Author: lightspark
## Version: 100002.03
## Version: 100002.04
## 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
51 changes: 1 addition & 50 deletions ls_UI/modules/bars/actionbars.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,80 +43,40 @@ local ACTION_BARS = {
["bar1"] = {
name = "LSActionBar1",
type = "ACTIONBUTTON",
b_buttons = {
ActionButton1, ActionButton2, ActionButton3, ActionButton4,
ActionButton5, ActionButton6, ActionButton7, ActionButton8,
ActionButton9, ActionButton10, ActionButton11, ActionButton12,
},
},
["bar2"] = {
name = "LSActionBar2",
type = "MULTIACTIONBAR1BUTTON",
b_buttons = {
MultiBarBottomLeftButton1, MultiBarBottomLeftButton2, MultiBarBottomLeftButton3, MultiBarBottomLeftButton4,
MultiBarBottomLeftButton5, MultiBarBottomLeftButton6, MultiBarBottomLeftButton7, MultiBarBottomLeftButton8,
MultiBarBottomLeftButton9, MultiBarBottomLeftButton10, MultiBarBottomLeftButton11, MultiBarBottomLeftButton12,
},
page = 6,
},
["bar3"] = {
name = "LSActionBar3",
type = "MULTIACTIONBAR2BUTTON",
b_buttons = {
MultiBarBottomRightButton1, MultiBarBottomRightButton2, MultiBarBottomRightButton3, MultiBarBottomRightButton4,
MultiBarBottomRightButton5, MultiBarBottomRightButton6, MultiBarBottomRightButton7, MultiBarBottomRightButton8,
MultiBarBottomRightButton9, MultiBarBottomRightButton10, MultiBarBottomRightButton11, MultiBarBottomRightButton12,
},
page = 5,
},
["bar4"] = {
name = "LSActionBar4",
type = "MULTIACTIONBAR4BUTTON",
b_buttons = {
MultiBarLeftButton1, MultiBarLeftButton2, MultiBarLeftButton3, MultiBarLeftButton4,
MultiBarLeftButton5, MultiBarLeftButton6, MultiBarLeftButton7, MultiBarLeftButton8,
MultiBarLeftButton9, MultiBarLeftButton10, MultiBarLeftButton11, MultiBarLeftButton12,
},
page = 4,
},
["bar5"] = {
name = "LSActionBar5",
type = "MULTIACTIONBAR3BUTTON",
b_buttons = {
MultiBarRightButton1, MultiBarRightButton2, MultiBarRightButton3, MultiBarRightButton4,
MultiBarRightButton5, MultiBarRightButton6, MultiBarRightButton7, MultiBarRightButton8,
MultiBarRightButton9, MultiBarRightButton10, MultiBarRightButton11, MultiBarRightButton12,
},
page = 3,
},
["bar6"] = {
name = "LSActionBar6",
type = "MULTIACTIONBAR5BUTTON",
b_buttons = {
MultiBar5Button1, MultiBar5Button2, MultiBar5Button3, MultiBar5Button4,
MultiBar5Button5, MultiBar5Button6, MultiBar5Button7, MultiBar5Button8,
MultiBar5Button9, MultiBar5Button10, MultiBar5Button11, MultiBar5Button12,
},
page = 13,
},
["bar7"] = {
name = "LSActionBar7",
type = "MULTIACTIONBAR6BUTTON",
b_buttons = {
MultiBar6Button1, MultiBar6Button2, MultiBar6Button3, MultiBar6Button4,
MultiBar6Button5, MultiBar6Button6, MultiBar6Button7, MultiBar6Button8,
MultiBar6Button9, MultiBar6Button10, MultiBar6Button11, MultiBar6Button12,
},
page = 14,
},
["bar8"] = {
name = "LSActionBar8",
type = "MULTIACTIONBAR7BUTTON",
b_buttons = {
MultiBar7Button1, MultiBar7Button2, MultiBar7Button3, MultiBar7Button4,
MultiBar7Button5, MultiBar7Button6, MultiBar7Button7, MultiBar7Button8,
MultiBar7Button9, MultiBar7Button10, MultiBar7Button11, MultiBar7Button12,
},
page = 15,
},
}
Expand Down Expand Up @@ -278,7 +238,7 @@ function MODULE:CreateActionBars()
Mixin(bar, bar1_proto)
end

for i = 1, #data.b_buttons do
for i = 1, 12 do
local button = Mixin(LAB:CreateButton(i, "$parentButton" .. i, bar), button_proto)
button:SetState(0, "action", i)
button._parent = bar
Expand All @@ -292,15 +252,6 @@ function MODULE:CreateActionBars()
end

E:SkinActionButton(button)

-- for IconIntroTracker
data.b_buttons[i]:SetAllPoints(button)
data.b_buttons[i]:Hide()
data.b_buttons[i]:SetAttribute("statehidden", true)
data.b_buttons[i]:SetParent(E.HIDDEN_PARENT)
data.b_buttons[i]:SetScript("OnEvent", nil)
data.b_buttons[i]:SetScript("OnUpdate", nil)
data.b_buttons[i]:UnregisterAllEvents()
end

bar:SetAttribute("_onstate-page", [[
Expand Down
70 changes: 52 additions & 18 deletions ls_UI/modules/bars/junk.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ local MODULE = P:GetModule("Bars")
-- Lua
local _G = getfenv(0)
local hooksecurefunc = _G.hooksecurefunc
local pcall = _G.pcall

local isNPEHooked = false

Expand All @@ -21,30 +22,63 @@ local function disableNPE()
end
end

local function hideBar(object, skipEvents)
if not object then return end

E:ForceHide(object, skipEvents)

if object.system then
E:PurgeKey(object, "isShownExternal")
end
end

local function hidebutton(object)
if not object then return end

object:Hide(true)
object:UnregisterAllEvents()
object:SetAttribute("statehidden", true)
end

function MODULE:CleanUp()
E:ForceHide(MainMenuBar, true)
E:ForceHide(MultiBarBottomLeft)
E:ForceHide(MultiBarBottomRight)
E:ForceHide(MultiBarLeft)
E:ForceHide(MultiBarRight)
E:ForceHide(MultiBar5)
E:ForceHide(MultiBar6)
E:ForceHide(MultiBar7)

E:ForceHide(PetActionBar)
E:ForceHide(PossessActionBar)
E:ForceHide(StanceBar)
E:ForceHide(MultiCastActionBarFrame)

E:ForceHide(StatusTrackingBarManager)
hideBar(MainMenuBar, true)
hideBar(MultiBarBottomLeft)
hideBar(MultiBarBottomRight)
hideBar(MultiBarLeft)
hideBar(MultiBarRight)
hideBar(MultiBar5)
hideBar(MultiBar6)
hideBar(MultiBar7)
hideBar(PetActionBar)
hideBar(StanceBar)
hideBar(PossessActionBar)
hideBar(MultiCastActionBarFrame)

for i = 1, 12 do
hidebutton(_G["ActionButton" .. i])
hidebutton(_G["MultiBarBottomLeftButton" .. i])
hidebutton(_G["MultiBarBottomRightButton" .. i])
hidebutton(_G["MultiBarLeftButton" .. i])
hidebutton(_G["MultiBarRightButton" .. i])
hidebutton(_G["MultiBar5Button" .. i])
hidebutton(_G["MultiBar6Button" .. i])
hidebutton(_G["MultiBar7Button" .. i])
end

for i = 1, 10 do
hidebutton(_G["PetActionButton" .. i])
hidebutton(_G["StanceButton" .. i])
end

hideBar(StatusTrackingBarManager)

if NewPlayerExperience then
disableNPE()
else
E:AddOnLoadTask("Blizzard_NewPlayerExperience", disableNPE)
end

E:ForceHide(MicroButtonAndBagsBar)
hideBar(MicroButtonAndBagsBar)

QueueStatusButton:SetParent(UIParent)
QueueStatusButton:ClearAllPoints()
Expand All @@ -53,9 +87,9 @@ function MODULE:CleanUp()

E:ForceHide(SpellFlyout.Background)

E:ForceHide(MainMenuBarVehicleLeaveButton)
hidebutton(MainMenuBarVehicleLeaveButton)

E:ForceHide(ExtraAbilityContainer)
hideBar(ExtraAbilityContainer)
ExtraAbilityContainer:SetScript("OnShow", nil)
ExtraAbilityContainer:SetScript("OnHide", nil)
end
14 changes: 1 addition & 13 deletions ls_UI/modules/bars/petbar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ local LibKeyBound = LibStub("LibKeyBound-1.0")

local isInit = false

local BUTTONS = {
PetActionButton1, PetActionButton2, PetActionButton3, PetActionButton4, PetActionButton5,
PetActionButton6, PetActionButton7, PetActionButton8, PetActionButton9, PetActionButton10,
}

local BOTTOM_POINT = {"BOTTOM", "UIParent", "BOTTOM", 0, 127}
local TOP_POINT = {"BOTTOM", "UIParent", "BOTTOM", 0, 155}

Expand Down Expand Up @@ -242,7 +237,7 @@ function MODULE:CreatePetActionBar()
if not isInit then
local bar = Mixin(self:Create("pet", "LSPetBar"), bar_proto)

for i = 1, #BUTTONS do
for i = 1, 10 do
local button = Mixin(CreateFrame("CheckButton", "$parentButton" .. i, bar, "PetActionButtonTemplate"), button_proto)
button:SetID(i)
button:SetScript("OnEvent", nil)
Expand All @@ -255,13 +250,6 @@ function MODULE:CreatePetActionBar()
bar._buttons[i] = button

E:SkinPetActionButton(button)

BUTTONS[i]:SetAllPoints(button)
BUTTONS[i]:SetAttribute("statehidden", true)
BUTTONS[i]:SetParent(E.HIDDEN_PARENT)
BUTTONS[i]:SetScript("OnEvent", nil)
BUTTONS[i]:SetScript("OnUpdate", nil)
BUTTONS[i]:UnregisterAllEvents()
end

bar:SetScript("OnEvent", bar.OnEvent)
Expand Down
Loading

0 comments on commit efd7b3f

Please sign in to comment.