Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ls- committed May 9, 2023
2 parents 4f8e134 + 88af096 commit c0c42f5
Show file tree
Hide file tree
Showing 30 changed files with 200 additions and 150 deletions.
6 changes: 5 additions & 1 deletion .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ read_globals = {
"C_AzeriteItem",
"C_CurrencyInfo",
"C_GossipInfo",
"C_Item",
"C_Mail",
"C_MajorFactions",
"C_Map",
"C_MountJournal",
"C_PaperDollInfo",
"C_PetBattles",
"C_PetJournal",
"C_PlayerInfo",
Expand Down Expand Up @@ -101,6 +104,7 @@ read_globals = {
"ColorMixin",
"CooldownFrame_Set",
"CreateFrame",
"CreateVector2D",
"DeadlyDebuffFrame",
"DebuffFrame",
"DeleteInboxItem",
Expand Down Expand Up @@ -140,7 +144,6 @@ read_globals = {
"GetCurrentBindingSet",
"GetCursorPosition",
"GetCVarBool",
"GetDetailedItemLevelInfo",
"GetDifficultyInfo",
"GetFlyoutInfo",
"GetFrameHandleFrame",
Expand Down Expand Up @@ -360,6 +363,7 @@ read_globals = {
"UnitOnTaxi",
"UnitPhaseReason",
"UnitPlayerControlled",
"UnitPosition",
"UnitPVPName",
"UnitQuestTrivialLevelRange",
"UnitRace",
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# CHANGELOG

## Version 100100.03

### Action Bars

- Removed main bar specific "Scale" option.
- Added "Scale" options to all action bars.
- Added an option to change the number of main bar buttons.
- Fixed an issue where the xp bar would sometimes disappear.

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

## Version 100100.02

### Minimap
Expand Down
Binary file modified ls_UI/assets/border-thin.TGA
Binary file not shown.
Binary file added ls_UI/assets/logo-128.TGA
Binary file not shown.
Binary file added ls_UI/assets/logo-64.TGA
Binary file not shown.
2 changes: 1 addition & 1 deletion ls_UI/core/button.lua
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ do
local button = self:GetParent()

if button:IsEquipped() then
button.Border_:SetVertexColor(C.db.global.colors.green:GetRGB())
button.Border_:SetVertexColor(C.db.global.colors.button.equipped:GetRGB())
else
button.Border_:SetVertexColor(1, 1, 1)
end
Expand Down
12 changes: 5 additions & 7 deletions ls_UI/core/changelog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ local _G = getfenv(0)

-- Mine
E.CHANGELOG = [[
### Minimap
### Action Bars
- Added minimap coordinates. Disabled by default.
- Adjusted minimap border textures to make zone colouring more pronounced.
### Unit Frames
- Readded fading options for pet, target of focus, and target of target frames.
- Removed main bar specific "Scale" option.
- Added "Scale" options to all action bars.
- Added an option to change the number of main bar buttons.
- Fixed an issue where the xp bar would sometimes disappear.
]]
21 changes: 20 additions & 1 deletion ls_UI/core/defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ D.global = {
unusable = rgb(181, 182, 181), -- #B5B6B5 (N7)
mana = rgb(32, 98, 165), -- #2062A5 (5PB 4/10)
range = rgb(140, 29, 30), -- #8C1D1E (7.5R 3/10)
equipped = rgb(46, 172, 52), -- #2EAC34 (10GY 6/12)
},
castbar = {
casting = rgb(246, 196, 66), -- #F6C442 (2.5Y 8/10)
Expand Down Expand Up @@ -520,6 +521,12 @@ D.global = {
[396364] = true, -- Thundering (Mark of Wind)
[396369] = true, -- Thundering (Mark of Lightning)
[396411] = true, -- Thundering (Primal Overload)
-- DRAGONFLIGHT SEASON 2
[408556] = true, -- Entangling (Entangled)
[408805] = true, -- Incorporeal (Destabilize)
[409465] = true, -- Afflicted (Cursed Spirit)
[409470] = true, -- Afflicted (Poisoned Spirit)
[409472] = true, -- Afflicted (Diseased Spirit)
},
},
textures = {
Expand Down Expand Up @@ -1926,7 +1933,6 @@ D.profile = {
lock = true,
rightclick_selfcast = false,
blizz_vehicle = false,
scale = 1,
endcaps = "BOTH", -- "LEFT", "RIGHT", "NONE"
cooldown = {
exp_threshold = 5,
Expand All @@ -1948,6 +1954,7 @@ D.profile = {
width = 32,
height = 0,
spacing = 4,
scale = 1,
visibility = "[petbattle] hide; show",
visible = true,
x_growth = "RIGHT",
Expand Down Expand Up @@ -1998,6 +2005,7 @@ D.profile = {
width = 32,
height = 0,
spacing = 4,
scale = 1,
visibility = "[vehicleui][petbattle][overridebar][possessbar] hide; show",
visible = true,
x_growth = "RIGHT",
Expand Down Expand Up @@ -2048,6 +2056,7 @@ D.profile = {
width = 32,
height = 0,
spacing = 4,
scale = 1,
visibility = "[vehicleui][petbattle][overridebar][possessbar] hide; show",
visible = true,
x_growth = "RIGHT",
Expand Down Expand Up @@ -2098,6 +2107,7 @@ D.profile = {
width = 32,
height = 0,
spacing = 4,
scale = 1,
visibility = "[vehicleui][petbattle][overridebar][possessbar] hide; show",
visible = true,
x_growth = "LEFT",
Expand Down Expand Up @@ -2148,6 +2158,7 @@ D.profile = {
width = 32,
height = 0,
spacing = 4,
scale = 1,
visibility = "[vehicleui][petbattle][overridebar][possessbar] hide; show",
visible = true,
x_growth = "LEFT",
Expand Down Expand Up @@ -2198,6 +2209,7 @@ D.profile = {
width = 32,
height = 0,
spacing = 4,
scale = 1,
visibility = "[vehicleui][petbattle][overridebar][possessbar] hide; show",
visible = false,
x_growth = "RIGHT",
Expand Down Expand Up @@ -2248,6 +2260,7 @@ D.profile = {
width = 32,
height = 0,
spacing = 4,
scale = 1,
visibility = "[vehicleui][petbattle][overridebar][possessbar] hide; show",
visible = false,
x_growth = "RIGHT",
Expand Down Expand Up @@ -2298,6 +2311,7 @@ D.profile = {
width = 32,
height = 0,
spacing = 4,
scale = 1,
visibility = "[vehicleui][petbattle][overridebar][possessbar] hide; show",
visible = false,
x_growth = "RIGHT",
Expand Down Expand Up @@ -2348,6 +2362,7 @@ D.profile = {
width = 24,
height = 0,
spacing = 4,
scale = 1,
visibility = "[pet,nopetbattle,novehicleui,nooverridebar,nopossessbar] show; hide",
visible = true,
x_growth = "RIGHT",
Expand Down Expand Up @@ -2384,6 +2399,7 @@ D.profile = {
width = 24,
height = 0,
spacing = 4,
scale = 1,
visibility = "[vehicleui][petbattle][overridebar][possessbar] hide; show",
visible = true,
x_growth = "RIGHT",
Expand Down Expand Up @@ -2419,6 +2435,7 @@ D.profile = {
width = 32,
height = 0,
spacing = 4,
scale = 1,
visibility = "[petbattle] show; hide",
visible = true,
x_growth = "RIGHT",
Expand All @@ -2445,6 +2462,7 @@ D.profile = {
extra = { -- ExtraAction
width = 40,
height = 0,
scale = 1,
visibility = "[vehicleui][petbattle][overridebar][possessbar] hide; show",
visible = true,
artwork = false,
Expand Down Expand Up @@ -2477,6 +2495,7 @@ D.profile = {
zone = { -- ZoneAbility
width = 40,
height = 0,
scale = 1,
visibility = "[vehicleui][petbattle][overridebar][possessbar] hide; show",
visible = true,
artwork = false,
Expand Down
2 changes: 2 additions & 0 deletions ls_UI/core/layout.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ function E.Layout:Update(frame, config)
frame:SetSize(widthMult * width + (widthMult - 1) * config.spacing + 4,
heightMult * height + (heightMult - 1) * config.spacing + 4)

frame:SetScale(config.scale or 1)

local mover = E.Movers:Get(frame, true)
if mover then
mover:UpdateSize()
Expand Down
9 changes: 9 additions & 0 deletions ls_UI/core/modernize.lua
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,15 @@ function P:Modernize(data, name, key)

data.version = 10010001
end

--> 100100.03
if data.version < 10010003 then
if data.bars then
data.bars.scale = nil
end

data.version = 10010003
end
elseif key == "private" then
--> 90001.05
if data.version < 9000105 then
Expand Down
16 changes: 10 additions & 6 deletions ls_UI/core/mover.lua
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,6 @@ local function calculatePosition(self, xOffset, yOffset, forceUIParent)
end
end


return p, parent:GetName(), rP, x, y
end

Expand All @@ -643,10 +642,11 @@ local function resetObjectPoint(self, _, _, _, _, _, shouldIgnore)
local mover = E.Movers:Get(self)
if mover and not shouldIgnore then
if not InCombatLockdown() or not self:IsProtected() then
local scale = self:GetScale()
self:ClearAllPoints()

if mover.isSimple then
self:SetPoint("TOPRIGHT", mover, "TOPRIGHT", -mover.offsetX, -mover.offsetY, true)
self:SetPoint("TOPRIGHT", mover, "TOPRIGHT", E:Round(-mover.offsetX / scale), E:Round(-mover.offsetY / scale), true)
else
local p, anchor, rP, x, y = mover:GetCurrentPosition()
if anchor ~= "UIParent" then
Expand All @@ -656,15 +656,15 @@ local function resetObjectPoint(self, _, _, _, _, _, shouldIgnore)
if p then
dirtyObjects[self] = nil

self:SetPoint(p, anchor, rP, x - mover.offsetX, y - mover.offsetY, true)
self:SetPoint(p, anchor, rP, E:Round((x - mover.offsetX) / scale), E:Round((y - mover.offsetY) / scale), true)
else
-- I need to do this because some of the frames I move around are managed by Blizz
-- layout manager, so I can't have my movers as anchors since they're created after
-- their layout manager positions the frames, so I want all frames to be anchored to
-- UIParent
dirtyObjects[self] = true

self:SetPoint("TOPRIGHT", mover, "TOPRIGHT", -mover.offsetX, -mover.offsetY, true)
self:SetPoint("TOPRIGHT", mover, "TOPRIGHT", E:Round(-mover.offsetX / scale), E:Round(-mover.offsetY / scale), true)
end
end
else
Expand Down Expand Up @@ -969,8 +969,12 @@ function mover_proto:Disable()
end

function mover_proto:UpdateSize(width, height)
self:SetWidth(width or (self.object:GetWidth() + self.offsetX * 2))
self:SetHeight(height or (self.object:GetHeight() + self.offsetY * 2))
local newScale = self.object:GetScale()

self:SetWidth(E:Round((width or (self.object:GetWidth() + self.offsetX * 2)) * newScale))
self:SetHeight(E:Round((height or (self.object:GetHeight() + self.offsetY * 2)) * newScale))

resetObjectPoint(self.object)
end

function mover_proto:GetObject()
Expand Down
4 changes: 3 additions & 1 deletion ls_UI/core/statusbar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ do
object:SetValue_(new)
object._value = new

if isCloseEnough(new, target, object._max - object._min) then
if not object:IsVisible() or isCloseEnough(new, target, object._max - object._min) then
remove(object)
end
end
Expand Down Expand Up @@ -522,6 +522,8 @@ do

local function bar_SetValue(self, new)
if not self:IsVisible() or isCloseEnough(self._value, new, self._max - self._min) then
activeObjects[self] = nil

self:SetValue_(new)
self._value = new

Expand Down
71 changes: 5 additions & 66 deletions ls_UI/core/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -485,72 +485,11 @@ do
end
end

do
local ARMOR_SLOTS = {1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}
local X2_INVTYPES = {
INVTYPE_2HWEAPON = true,
INVTYPE_RANGEDRIGHT = true,
INVTYPE_RANGED = true,
}
local X2_EXCEPTIONS = {
[2] = 19, -- wands, use INVTYPE_RANGEDRIGHT, but are 1H
}

function E:GetUnitAverageItemLevel(unit)
if UnitIsUnit(unit, "player") then
return m_floor(select(2, GetAverageItemLevel()))
else
local isOK, total, link = true, 0

-- Armour
for _, id in next, ARMOR_SLOTS do
link = GetInventoryItemLink(unit, id)
if link then
local cur = GetDetailedItemLevelInfo(link)
if cur and cur > 0 then
total = total + cur
end
elseif GetInventoryItemTexture(unit, id) then
isOK = false
end
end

-- Main hand
local mainItemLevel, mainQuality, mainEquipLoc, mainItemClass, mainItemSubClass, _ = 0
link = GetInventoryItemLink(unit, 16)
if link then
mainItemLevel = GetDetailedItemLevelInfo(link)
_, _, mainQuality, _, _, _, _, _, mainEquipLoc, _, _, mainItemClass, mainItemSubClass = GetItemInfo(link)
elseif GetInventoryItemTexture(unit, 16) then
isOK = false
end

-- Off hand
local offItemLevel, offEquipLoc = 0
link = GetInventoryItemLink(unit, 17)
if link then
offItemLevel = GetDetailedItemLevelInfo(link)
_, _, _, _, _, _, _, _, offEquipLoc = GetItemInfo(link)
elseif GetInventoryItemTexture(unit, 17) then
isOK = false
end

if mainQuality == 6 or (not offEquipLoc and X2_INVTYPES[mainEquipLoc] and X2_EXCEPTIONS[mainItemClass] ~= mainItemSubClass and GetInspectSpecialization(unit) ~= 72) then
mainItemLevel = m_max(mainItemLevel, offItemLevel)
total = total + mainItemLevel * 2
else
total = total + mainItemLevel + offItemLevel
end

-- at the beginning of an arena match no info might be available,
-- so despite having equipped gear a person may appear naked
if total == 0 then
isOK = false
end

-- print("|cffffd200" .. UnitName(unit) .. "|r", "total:", total, "cur:", m_floor(total / 16), isOK and "|cff11ff11SUCCESS!|r" or "|cffff1111FAIL!|r")
return isOK and m_floor(total / 16)
end
function E:GetUnitAverageItemLevel(unit)
if UnitIsUnit(unit, "player") then
return m_floor(select(2, GetAverageItemLevel()))
else
return C_PaperDollInfo.GetInspectItemLevel(unit)
end
end

Expand Down
1 change: 1 addition & 0 deletions ls_UI/locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ L["ENABLE"] = _G.ENABLE
L["ENCHANTS"] = _G.AUCTION_CATEGORY_ITEM_ENHANCEMENT
L["ENERGY"] = _G.ENERGY
L["ENRAGE"] = _G.ENCOUNTER_JOURNAL_SECTION_FLAG11
L["EQUIPMENT"] = _G.BAG_FILTER_EQUIPMENT
L["ERROR_RED"] = E:WrapTextInColorCode(D.global.colors.red, _G.ERROR_CAPS)
L["FACTION"] = _G.FACTION
L["FACTION_ALLIANCE"] = _G.FACTION_ALLIANCE
Expand Down
Loading

0 comments on commit c0c42f5

Please sign in to comment.