Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ls- committed Jun 13, 2024
2 parents 51b986a + e269f0c commit ddb6c93
Show file tree
Hide file tree
Showing 24 changed files with 360 additions and 92 deletions.
36 changes: 16 additions & 20 deletions .compressor.ps1
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Set-Location $PSScriptRoot

if (-Not (Test-Path "C:\PROGRA~1\7-Zip\7z.exe")) {
if (-Not (Test-Path "$env:ProgramFiles\7-Zip\7z.exe")) {
Write-Host "7z.exe not found"

return Read-Host
}

Set-Alias 7z "C:\PROGRA~1\7-Zip\7z.exe"
Set-Alias 7z "$env:ProgramFiles\7-Zip\7z.exe"

$name = (Get-Item .).Name

Expand All @@ -24,39 +24,35 @@ if (Get-Content (".\" + $name + "\" + $name + ".toc") | Where-Object { $_ -match
return Read-Host
}

$includedItems = @(
$foldersToInclude = @(
".\ls_UI\",
".\ls_UI_Options\"
)

$filesToRemove = @(
$filesToExclude = @(
"*.doc*"
"*.editorconfig",
"*.git*",
"*.luacheck*",
"*.pkg*",
"*.ps1",
"*.sh",
"*.yml"
)

$foldersToRemove = @(
".\temp\ls_UI\embeds\oUF\utils"
".github",
"utils"
)

if (Test-Path ".\temp\") {
Remove-Item ".\temp\" -Recurse -Force
}

New-Item -Path (".\temp\") -ItemType Directory | Out-Null
Copy-Item $includedItems -Destination (".\temp\") -Recurse
Remove-Item ".\temp" -Include $filesToRemove -Recurse -Force
Remove-Item $foldersToRemove -Recurse -Force

Set-Location ".\temp\"
$temp = ".\temp\"

7z a -tzip -mx9 ($name + "-" + $version + ".zip") (Get-ChildItem -Path "..\temp")

Set-Location "..\"
if (Test-Path $temp) {
Remove-Item $temp -Recurse -Force
}

Move-Item ".\temp\*.zip" -Destination "..\" -Force
Remove-Item ".\temp" -Recurse -Force
New-Item -Path $temp -ItemType Directory | Out-Null
Copy-Item $foldersToInclude -Destination $temp -Exclude $filesToExclude -Recurse
Get-ChildItem $temp -Recurse | Where-Object { $_.PSIsContainer -and $_.Name -cin $foldersToRemove } | Remove-Item -Recurse -Force
7z a -tzip -mx9 "..\$name-$version.zip" (Get-ChildItem $temp)
Remove-Item $temp -Recurse -Force
12 changes: 12 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ globals = {

read_globals = {
"ACHIEVEMENT_BUTTON",
"AchievementMicroButton",
"AddonCompartmentFrame",
"AdiButtonAuras",
"ADVENTURE_JOURNAL",
Expand Down Expand Up @@ -89,6 +90,7 @@ read_globals = {
"CharacterHeadSlot",
"CharacterLegsSlot",
"CharacterMainHandSlot",
"CharacterMicroButton",
"CharacterModelScene",
"CharacterNeckSlot",
"CharacterSecondaryHandSlot",
Expand All @@ -103,6 +105,7 @@ read_globals = {
"ClearOverrideBindings",
"CLOSE",
"COLLECTIONS",
"CollectionsMicroButton",
"ColorMixin",
"CooldownFrame_Set",
"CreateFrame",
Expand All @@ -112,6 +115,7 @@ read_globals = {
"DeleteInboxItem",
"DifficultyUtil",
"DUNGEONS_BUTTON",
"EJMicroButton",
"ENCHANTED_TOOLTIP_LINE",
"Enum",
"ExpansionLandingPageMinimapButton",
Expand Down Expand Up @@ -202,7 +206,9 @@ read_globals = {
"GetWeaponEnchantInfo",
"GetXPExhaustion",
"GUILD_AND_COMMUNITIES",
"GuildMicroButton",
"HELP_BUTTON",
"HelpMicroButton",
"HelpTip",
"HideUIPanel",
"HybridMinimap",
Expand All @@ -227,13 +233,15 @@ read_globals = {
"Kiosk",
"LE_REALM_RELATION_VIRTUAL",
"LE_TOKEN_RESULT_ERROR_DISABLED",
"LFDMicroButton",
"LFG_ROLE_NUM_SHORTAGE_TYPES",
"LibStub",
"MailFrameInset",
"MAINMENU_BUTTON",
"MainMenuBar",
"MainMenuBarBackpackButton",
"MainMenuBarVehicleLeaveButton",
"MainMenuMicroButton",
"MAX_REPUTATION_REACTION",
"MAX_TOTEMS",
"MaxDps",
Expand Down Expand Up @@ -286,6 +294,7 @@ read_globals = {
"PossessActionBar",
"PVPQueueFrame",
"QUESTLOG_BUTTON",
"QuestLogMicroButton",
"QueueStatusButton",
"RANGE_INDICATOR",
"RegisterAttributeDriver",
Expand All @@ -308,9 +317,12 @@ read_globals = {
"SetWatchedFactionIndex",
"SetWatchingHonorAsXP",
"SPELLBOOK_ABILITIES_BUTTON",
"SpellbookMicroButton",
"SpellFlyout",
"StanceBar",
"StatusTrackingBarManager",
"StoreMicroButton",
"TalentMicroButton",
"TALENTS_BUTTON",
"TalkingHeadFrame",
"TaxiRequestEarlyLanding",
Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# CHANGELOG

## Version 100207.01

- Added 10.2.7 support.
- Fixed an issue where the addon would fail to create a mover if the parent object it's supposed to be attached to was
no longer available. Now such a mover will be reset to its default state.

### Action Bars

- Added an option to wipe the list of tracked currencies to remove retired inaccessible currencies from previous
seasons. Can be found at /LSUI > Action Bars > Backpack > Restore Defaults button in the Currency panel.
- Fixed micro menu help tip hiding. Blizz keep changing how this stuff works, so it'll get broken again eventually.
- Fixed an issue where the reputation bar wouldn't display reputation gains past the renown cap.

### Tooltips

- Fixed an issue where names would appear as blank for players in another zone.

### Unit Frames

- Added proper empowered cast support. Better late than never T_T

![Imgur](https://i.imgur.com/mJjDEJ8.gif)

## Version 100206.01

- Added 10.2.6 support.
Expand Down
19 changes: 18 additions & 1 deletion ls_UI/core/changelog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,22 @@ local _G = getfenv(0)

-- Mine
E.CHANGELOG = [[
- Added 10.2.6 support.
- Added 10.2.7 support.
- Fixed an issue where the addon would fail to create a mover if the parent object it's supposed to be attached to was
no longer available. Now such a mover will be reset to its default state.
### Action Bars
- Added an option to wipe the list of tracked currencies to remove retired inaccessible currencies from previous
seasons. Can be found at /LSUI > Action Bars > Backpack > Restore Defaults button in the Currency panel.
- Fixed micro menu help tip hiding. Blizz keep changing how this stuff works, so it'll get broken again eventually.
- Fixed an issue where the reputation bar wouldn't display reputation gains past the renown cap.
### Tooltips
- Fixed an issue where names would appear as blank for players in another zone.
### Unit Frames
- Added proper empowered cast support. Better late than never T_T
]]
3 changes: 2 additions & 1 deletion ls_UI/core/defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ D.global = {
castbar = {
casting = rgb(246, 196, 66), -- #F6C442 (2.5Y 8/10)
empowering = rgb(246, 196, 66), -- #F6C442 (2.5Y 8/10)
empowering_full = rgb(28, 174, 158), -- #1CAE9E (5BG 6/8)
channeling = rgb(46, 172, 52), -- #2EAC34 (10GY 6/12)
failed = rgb(220, 68, 54), -- #DC4436 (7.5R 5/14)
notinterruptible = rgb(136, 137, 135), -- #888987 (N5)
Expand Down Expand Up @@ -244,7 +245,7 @@ D.global = {
},
statusbar = {
font = defaultFont,
outline = false,
outline = false,
shadow = true,
},
blizzard = {},
Expand Down
58 changes: 46 additions & 12 deletions ls_UI/core/mover.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ local _G = getfenv(0)
local assert = _G.assert
local hooksecurefunc = _G.hooksecurefunc
local m_atan2 = _G.math.atan2
local m_ceil = _G.math.ceil
local m_cos = _G.math.cos
local m_floor = _G.math.floor
local m_rad = _G.math.rad
Expand Down Expand Up @@ -394,7 +395,7 @@ end
local settings
do
settings = CreateFrame("Frame", "LSMoverSettings", UIParent)
settings:SetSize(320, 320)
settings:SetSize(320, 512)
settings:SetPoint("CENTER")
settings:SetMovable(true)
settings:EnableMouse(true)
Expand All @@ -415,7 +416,7 @@ do
.. "\n\n"
.. L["MOVER_RELATION_DESTROY_DESC"])
self.LockButton.Text:SetText(L["LOCK"])
self:SetHeight(m_floor(self.UsageText:GetStringHeight() + 50))
self:SetHeight(m_ceil(self.UsageText:GetStringHeight() + 56))
end)
settings:Hide()

Expand Down Expand Up @@ -469,7 +470,7 @@ do

local usageText = settings:CreateFontString(nil, "OVERLAY")
usageText:SetFontObject("GameFontNormal")
usageText:SetPoint("TOPLEFT", 4, -24)
usageText:SetPoint("TOPLEFT", 4, -28)
usageText:SetPoint("BOTTOMRIGHT", -4, 26)
usageText:SetJustifyH("LEFT")
usageText:SetJustifyV("MIDDLE")
Expand Down Expand Up @@ -627,11 +628,14 @@ local function updatePosition(self, p, anchor, rP, x, y)
end

if not x then
self:ResetPosition()
return
return self:ResetPosition()
end
end

if not _G[anchor] then
return self:ResetPosition()
end

self:ClearAllPoints()
self:SetPoint(p, anchor, rP, x, y)

Expand Down Expand Up @@ -731,6 +735,8 @@ function mover_proto:ResetPosition()
end

self:PostSaveUpdatePosition()

return p, anchor, rP, x, y
end

function mover_proto:UpdatePosition(xOffset, yOffset)
Expand Down Expand Up @@ -1039,15 +1045,20 @@ local callback_meta = {
end,
}

local knownObjects = {}
local orphanedMovers = {}

E.Movers = {}

function E.Movers:Create(object, isSimple, offsetX, offsetY)
if not object then return end
if not object or knownObjects[object] then return end

local objectName = object:GetName()

assert(objectName, (s_format("Failed to create a mover, object '%s' has no name", object:GetDebugName())))

knownObjects[object] = true

hooksecurefunc(object, "SetPoint", resetObjectPoint)

local name = objectName .. "Mover"
Expand Down Expand Up @@ -1144,13 +1155,16 @@ function E.Movers:Create(object, isSimple, offsetX, offsetY)
onCreateCallbacks[parentName] = setmetatable({}, callback_meta)
end

orphanedMovers[mover] = parentName

-- print(mover:GetDebugName(), "|cffff0000==>|r", parentName)
t_insert(onCreateCallbacks[parentName], function(self)
-- print(mover:GetDebugName(), "|cff00ff00==late=>|r", parentName)
if not self:HasInHierarchy(mover) then
mover:AddToHive(self)
end

orphanedMovers[mover] = nil
enabledMovers[name] = mover

mover:UpdateSize()
Expand All @@ -1167,6 +1181,8 @@ function E.Movers:Create(object, isSimple, offsetX, offsetY)

if onCreateCallbacks[objectName] then
onCreateCallbacks[objectName](mover)

onCreateCallbacks[objectName] = nil
end

return mover
Expand Down Expand Up @@ -1290,16 +1306,34 @@ E:RegisterEvent("PLAYER_REGEN_DISABLED", function()
controller:Hide()
end)

E:RegisterEvent("FIRST_FRAME_RENDERED", function()
if not InCombatLockdown() then
for object in next, dirtyObjects do
resetObjectPoint(object)
local function verifyAndReset()
for mover, parentName in next, orphanedMovers do
if not _G[parentName] or not E.Movers:Get(parentName, true) then
onCreateCallbacks[parentName] = nil
enabledMovers[mover:GetDebugName()] = mover

mover:UpdateSize()
mover:ResetPosition()
end

orphanedMovers[mover] = nil
end

for objectName, callback in next, onCreateCallbacks do
callback(E.Movers:Get(objectName))

onCreateCallbacks[objectName] = nil
end
end)

E:RegisterEvent("PLAYER_REGEN_ENABLED", function()
for object in next, dirtyObjects do
resetObjectPoint(object)
end
end

E:RegisterEvent("FIRST_FRAME_RENDERED", function()
if not InCombatLockdown() then
verifyAndReset()
end
end)

E:RegisterEvent("PLAYER_REGEN_ENABLED", verifyAndReset)
Loading

0 comments on commit ddb6c93

Please sign in to comment.