diff --git a/.luacheckrc b/.luacheckrc index ad7f089e..cd432104 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -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", @@ -101,6 +104,7 @@ read_globals = { "ColorMixin", "CooldownFrame_Set", "CreateFrame", + "CreateVector2D", "DeadlyDebuffFrame", "DebuffFrame", "DeleteInboxItem", @@ -140,7 +144,6 @@ read_globals = { "GetCurrentBindingSet", "GetCursorPosition", "GetCVarBool", - "GetDetailedItemLevelInfo", "GetDifficultyInfo", "GetFlyoutInfo", "GetFrameHandleFrame", @@ -360,6 +363,7 @@ read_globals = { "UnitOnTaxi", "UnitPhaseReason", "UnitPlayerControlled", + "UnitPosition", "UnitPVPName", "UnitQuestTrivialLevelRange", "UnitRace", diff --git a/CHANGELOG.md b/CHANGELOG.md index 21f3c688..b3703cdc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/ls_UI/assets/border-thin.TGA b/ls_UI/assets/border-thin.TGA index a5205ac4..977ed596 100644 Binary files a/ls_UI/assets/border-thin.TGA and b/ls_UI/assets/border-thin.TGA differ diff --git a/ls_UI/assets/logo-128.TGA b/ls_UI/assets/logo-128.TGA new file mode 100644 index 00000000..30abe24f Binary files /dev/null and b/ls_UI/assets/logo-128.TGA differ diff --git a/ls_UI/assets/logo-64.TGA b/ls_UI/assets/logo-64.TGA new file mode 100644 index 00000000..2e747c03 Binary files /dev/null and b/ls_UI/assets/logo-64.TGA differ diff --git a/ls_UI/core/button.lua b/ls_UI/core/button.lua index 28dfabc4..cd1d4027 100644 --- a/ls_UI/core/button.lua +++ b/ls_UI/core/button.lua @@ -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 diff --git a/ls_UI/core/changelog.lua b/ls_UI/core/changelog.lua index 70aaa675..38f1843e 100644 --- a/ls_UI/core/changelog.lua +++ b/ls_UI/core/changelog.lua @@ -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. ]] diff --git a/ls_UI/core/defaults.lua b/ls_UI/core/defaults.lua index 49eec439..33368644 100644 --- a/ls_UI/core/defaults.lua +++ b/ls_UI/core/defaults.lua @@ -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) @@ -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 = { @@ -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, @@ -1948,6 +1954,7 @@ D.profile = { width = 32, height = 0, spacing = 4, + scale = 1, visibility = "[petbattle] hide; show", visible = true, x_growth = "RIGHT", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -2419,6 +2435,7 @@ D.profile = { width = 32, height = 0, spacing = 4, + scale = 1, visibility = "[petbattle] show; hide", visible = true, x_growth = "RIGHT", @@ -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, @@ -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, diff --git a/ls_UI/core/layout.lua b/ls_UI/core/layout.lua index 3b7503ba..c7507e1d 100644 --- a/ls_UI/core/layout.lua +++ b/ls_UI/core/layout.lua @@ -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() diff --git a/ls_UI/core/modernize.lua b/ls_UI/core/modernize.lua index 5f9b3bb7..c7065d17 100644 --- a/ls_UI/core/modernize.lua +++ b/ls_UI/core/modernize.lua @@ -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 diff --git a/ls_UI/core/mover.lua b/ls_UI/core/mover.lua index 7a2043f9..8dca9019 100644 --- a/ls_UI/core/mover.lua +++ b/ls_UI/core/mover.lua @@ -616,7 +616,6 @@ local function calculatePosition(self, xOffset, yOffset, forceUIParent) end end - return p, parent:GetName(), rP, x, y end @@ -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 @@ -656,7 +656,7 @@ 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 @@ -664,7 +664,7 @@ local function resetObjectPoint(self, _, _, _, _, _, shouldIgnore) -- 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 @@ -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() diff --git a/ls_UI/core/statusbar.lua b/ls_UI/core/statusbar.lua index 1b211111..7bfc50dc 100644 --- a/ls_UI/core/statusbar.lua +++ b/ls_UI/core/statusbar.lua @@ -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 @@ -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 diff --git a/ls_UI/core/utils.lua b/ls_UI/core/utils.lua index cdb21bb6..0a4927dc 100644 --- a/ls_UI/core/utils.lua +++ b/ls_UI/core/utils.lua @@ -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 diff --git a/ls_UI/locales/enUS.lua b/ls_UI/locales/enUS.lua index abc2dbbb..c2360f52 100644 --- a/ls_UI/locales/enUS.lua +++ b/ls_UI/locales/enUS.lua @@ -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 diff --git a/ls_UI/ls_UI.toc b/ls_UI/ls_UI.toc index ae51fa75..5f611bd2 100644 --- a/ls_UI/ls_UI.toc +++ b/ls_UI/ls_UI.toc @@ -1,8 +1,9 @@ ## Interface: 100100 ## Author: lightspark -## Version: 100100.02 +## Version: 100100.03 ## Title: LS: |cff1a9fc0UI|r ## Notes: Yet another UI, but this one is a bit special... +## IconTexture: Interface\AddOns\ls_UI\assets\logo-64 ## SavedVariables: LS_UI_GLOBAL_CONFIG, LS_UI_PRIVATE_CONFIG ## OptionalDeps: AdiButtonAuras, Masque, MaxDps, MinimapButtonFrame diff --git a/ls_UI/modules/bars/actionbars.lua b/ls_UI/modules/bars/actionbars.lua index 2878d568..a211f8c2 100644 --- a/ls_UI/modules/bars/actionbars.lua +++ b/ls_UI/modules/bars/actionbars.lua @@ -17,11 +17,12 @@ local isInit = false local CFG = { bar1 = { flyout_dir = "UP", - num = 12, + -- num = 12, per_row = 12, width = 32, height = 0, spacing = 4, + -- scale = 1, visibility = "[petbattle] hide; show", visible = true, x_growth = "RIGHT", @@ -120,6 +121,7 @@ function bar_proto:UpdateButtonConfig() unusable = {}, mana = {}, range = {}, + equipped = {}, }, desaturation = {}, hideElements = { @@ -197,10 +199,21 @@ function bar1_proto:UpdateConfig() self._config.rightclick_selfcast = C.db.profile.bars.rightclick_selfcast if MODULE:IsRestricted() then + if C.db.profile.bars.bar1.num < 6 then + C.db.profile.bars.bar1.num = 6 + end + self._config.grid = C.db.profile.bars.bar1.grid + self._config.num = C.db.profile.bars.bar1.num self._config.count = E:CopyTable(C.db.profile.bars.bar1.count, self._config.count) self._config.hotkey = E:CopyTable(C.db.profile.bars.bar1.hotkey, self._config.hotkey) self._config.macro = E:CopyTable(C.db.profile.bars.bar1.macro, self._config.macro) + + self:SetAttribute("maxbuttons", self._config.num) + MODULE:UpdateMainBarMaxButtons(self._config.num) + + self:SetAttribute("scale", C.db.profile.bars.bar1.scale) + MODULE:UpdateScale(C.db.profile.bars.bar1.scale) end end diff --git a/ls_UI/modules/bars/controller.lua b/ls_UI/modules/bars/controller.lua index 79e5b745..592a414e 100644 --- a/ls_UI/modules/bars/controller.lua +++ b/ls_UI/modules/bars/controller.lua @@ -9,6 +9,7 @@ local unpack = _G.unpack -- Mine local isInit = false +local isFinilized = false local barController local animController @@ -48,7 +49,7 @@ local WIDGETS = { self:Show() for i = 7, 12 do - if message == 6 then + if i > message then buttons[i]:SetAttribute("statehidden", true) buttons[i]:Hide() else @@ -67,7 +68,7 @@ local WIDGETS = { frame_level_offset = 3, point = {"BOTTOM", "LSActionBarControllerBottom", "BOTTOM", 0, 0}, on_play = function(frame, newstate) - frame:UpdateSize(newstate == 6 and 756 / 2 or 1188 / 2, 12) + frame:UpdateSize(756 / 2 + 36 * (newstate - 6), 12) end, }, } @@ -88,40 +89,6 @@ function MODULE:AddControlledWidget(slot, frame) end widget.frame = frame - - if not barController.isDriverRegistered and WIDGETS.ACTION_BAR.frame - and WIDGETS.PET_BATTLE_BAR.frame and WIDGETS.XP_BAR.frame then - - -- _"childupdate-numbuttons" is executed in barController's environment - for i = 1, 12 do - barController:SetFrameRef("button" .. i, _G["LSActionBar1Button" .. i]) - end - - barController:Execute([[ - top = self:GetFrameRef("top") - bottom = self:GetFrameRef("bottom") - buttons = table.new() - - for i = 1, 12 do - table.insert(buttons, self:GetFrameRef("button" .. i)) - end - ]]) - - barController:SetAttribute("_onstate-mode", [[ - if newstate ~= self:GetAttribute("numbuttons") then - self:SetAttribute("numbuttons", newstate) - self:ChildUpdate("numbuttons", newstate) - self:CallMethod("Update") - - top:SetWidth(newstate == 6 and 0.001 or 216) - bottom:SetWidth(newstate == 6 and 0.001 or 216) - end - ]]) - - RegisterStateDriver(barController, "mode", "[vehicleui][petbattle][overridebar][possessbar] 6; 12") - - barController.isDriverRegistered = true - end end end end @@ -143,6 +110,19 @@ function MODULE:SetupActionBarController() barController.Shuffle:Play() end + barController.UpdateSimple = function(_, newstate) + for _, widget in next, WIDGETS do + if widget.frame and widget.on_play then + widget.on_play(widget.frame, newstate) + end + end + + animController.Top:SetWidth(newstate == 6 and 0.001 or 36 * (newstate - 6)) + animController.Top.Mid:SetTexCoord(233 / 2048, (233 + 72 * (newstate - 6)) / 2048, 1 / 256, 91 / 256) + + animController.Bottom:SetWidth(newstate == 6 and 0.001 or 36 * (newstate - 6)) + animController.Bottom.Mid:SetTexCoord(569 / 2048, (569 + 72 * (newstate - 6)) / 2048, 92 / 256, 138 / 256) + end -- These frames are used as anchors/parents for secure/protected frames local top = CreateFrame("Frame", "$parentTop", barController, "SecureHandlerBaseTemplate") @@ -256,8 +236,11 @@ function MODULE:SetupActionBarController() end) C_Timer.After(0.4, function() - animController.Top:SetWidth(newstate == 6 and 0.001 or 216) - animController.Bottom:SetWidth(newstate == 6 and 0.001 or 216) + animController.Top:SetWidth(newstate == 6 and 0.001 or 36 * (newstate - 6)) + animController.Top.Mid:SetTexCoord(233 / 2048, (233 + 72 * (newstate - 6)) / 2048, 1 / 256, 91 / 256) + + animController.Bottom:SetWidth(newstate == 6 and 0.001 or 36 * (newstate - 6)) + animController.Bottom.Mid:SetTexCoord(569 / 2048, (569 + 72 * (newstate - 6)) / 2048, 92 / 256, 138 / 256) end) end) ag:SetScript("OnFinished", function() @@ -336,12 +319,46 @@ function MODULE:SetupActionBarController() anim:SetDuration(0.15) self:UpdateEndcaps() - self:UpdateScale() isInit = true end end +function MODULE:FinalizeActionBarController() + if isInit and not isFinilized then + -- "_childupdate-numbuttons" is executed in barController's environment + for i = 1, 12 do + barController:SetFrameRef("button" .. i, _G["LSActionBar1Button" .. i]) + end + + barController:Execute([[ + top = self:GetFrameRef("top") + bottom = self:GetFrameRef("bottom") + buttons = table.new() + + for i = 1, 12 do + table.insert(buttons, self:GetFrameRef("button" .. i)) + end + ]]) + + barController:SetAttribute("_onstate-mode", [[ + if newstate ~= self:GetAttribute("numbuttons") then + self:SetAttribute("numbuttons", newstate) + self:ChildUpdate("numbuttons", newstate) + self:CallMethod("Update") + + top:SetWidth(newstate == 6 and 0.001 or 36 * (newstate - 6)) + bottom:SetWidth(newstate == 6 and 0.001 or 36 * (newstate - 6)) + end + ]]) + + isFinilized = true + + self:UpdateMainBarMaxButtons(LSActionBar1:GetAttribute("maxbuttons")) + self:UpdateScale(LSActionBar1:GetAttribute("scale")) + end +end + function MODULE:UpdateEndcaps() local endcaps = C.db.profile.bars.endcaps if endcaps == "BOTH" then @@ -359,9 +376,26 @@ function MODULE:UpdateEndcaps() end end -function MODULE:UpdateScale() - local scale = C.db.profile.bars.scale +function MODULE:UpdateScale(scale) + if not isFinilized then return end + if not scale then return end barController:SetScale(scale) animController:SetScale(scale) end + +function MODULE:UpdateMainBarMaxButtons(num) + if not isFinilized then return end + if not num then return end + + barController:Execute(([[ + self:SetAttribute("numbuttons", %1$d) + self:ChildUpdate("numbuttons", %1$d) + self:CallMethod("UpdateSimple", %1$d) + + top:SetWidth(%1$d == 6 and 0.001 or 36 * (%1$d - 6)) + bottom:SetWidth(%1$d == 6 and 0.001 or 36 * (%1$d - 6)) + ]]):format(num)) + + RegisterStateDriver(barController, "mode", "[vehicleui][petbattle][overridebar][possessbar] 6; " .. num) +end diff --git a/ls_UI/modules/bars/core.lua b/ls_UI/modules/bars/core.lua index 41df1102..e6e9e887 100644 --- a/ls_UI/modules/bars/core.lua +++ b/ls_UI/modules/bars/core.lua @@ -239,6 +239,7 @@ function MODULE:Init() MODULE:CreateMicroMenu() MODULE:CreateBag() MODULE:CreateXPBar() + MODULE:FinalizeActionBarController() MODULE:CleanUp() MODULE:UpdateBlizzVehicle() diff --git a/ls_UI/modules/bars/extra.lua b/ls_UI/modules/bars/extra.lua index 674e27fa..ee40590f 100644 --- a/ls_UI/modules/bars/extra.lua +++ b/ls_UI/modules/bars/extra.lua @@ -55,6 +55,7 @@ function bar_proto:Update() local width, height = ExtraActionButton1:GetSize() self:SetSize((width > 0 and width or 52) + 4, (height > 0 and height or 52) + 4) + self:SetScale(self._config.scale) local mover = E.Movers:Get(self) if mover then diff --git a/ls_UI/modules/bars/petbar.lua b/ls_UI/modules/bars/petbar.lua index fc946a74..828cfc46 100644 --- a/ls_UI/modules/bars/petbar.lua +++ b/ls_UI/modules/bars/petbar.lua @@ -56,6 +56,7 @@ function bar_proto:UpdateButtonConfig() unusable = {}, mana = {}, range = {}, + equipped = {}, }, desaturation = {}, } diff --git a/ls_UI/modules/bars/xpbar.lua b/ls_UI/modules/bars/xpbar.lua index 0a99db50..2043f952 100644 --- a/ls_UI/modules/bars/xpbar.lua +++ b/ls_UI/modules/bars/xpbar.lua @@ -201,10 +201,10 @@ function bar_proto:UpdateSegments() self[1]:SetSize(unpack(LAYOUT[1][1].size)) self[1]:SetMinMaxValues(0, 1) self[1]:SetValue(1) + self[1]:Show() self[1]:UpdateText(1, 1) self[1]:SetStatusBarTexture(DEFAULT_TEXTURE) self[1].Texture:SetVertexColor(C.db.global.colors.class[E.PLAYER_CLASS]:GetRGB()) - self[1]:Show() end self._total = index diff --git a/ls_UI/modules/bars/zone.lua b/ls_UI/modules/bars/zone.lua index edeb4510..f19aad81 100644 --- a/ls_UI/modules/bars/zone.lua +++ b/ls_UI/modules/bars/zone.lua @@ -34,6 +34,7 @@ function bar_proto:Update() end self:SetSize(width + 4, height + 4) + self:SetScale(self._config.scale) local mover = E.Movers:Get(self) if mover then diff --git a/ls_UI/modules/blizzard/characterframe.lua b/ls_UI/modules/blizzard/characterframe.lua index 6d3c5faa..3084e81d 100644 --- a/ls_UI/modules/blizzard/characterframe.lua +++ b/ls_UI/modules/blizzard/characterframe.lua @@ -36,6 +36,7 @@ local EQUIP_SLOTS = { local ILVL_COLORS = {} local ILVL_STEP = 19 -- the ilvl step between content difficulties +local itemLoc = {} local avgItemLevel local function getItemLevelColor(itemLevel) @@ -48,7 +49,10 @@ end local function scanSlot(slotID) local link = GetInventoryItemLink("player", slotID) if link then - return true, GetDetailedItemLevelInfo(link), E:GetItemEnchantGemInfo(link) + -- C_Item.GetCurrentItemLevel is more accurate than GetDetailedItemLevelInfo + itemLoc.equipmentSlotIndex = slotID + + return true, C_Item.GetCurrentItemLevel(itemLoc), E:GetItemEnchantGemInfo(link) elseif GetInventoryItemTexture("player", slotID) then -- if there's no link, but there's a texture, it means that there's -- an item we have no info for diff --git a/ls_UI_Options/auras.lua b/ls_UI_Options/auras.lua index a07df1a7..10d0ed5b 100644 --- a/ls_UI_Options/auras.lua +++ b/ls_UI_Options/auras.lua @@ -128,7 +128,7 @@ local function getAuraOptions(order, name, filter) order = inc(1), type = "range", name = L["SPACING"], - min = 4, max = 24, step = 2, + min = 4, max = 24, step = 1, }, width = { order = inc(1), diff --git a/ls_UI_Options/auratracker.lua b/ls_UI_Options/auratracker.lua index 01d16a0d..552caf7c 100644 --- a/ls_UI_Options/auratracker.lua +++ b/ls_UI_Options/auratracker.lua @@ -170,7 +170,7 @@ function CONFIG:CreateAuraTrackerOptions(order) order = inc(1), type = "range", name = L["SPACING"], - min = 4, max = 24, step = 2, + min = 4, max = 24, step = 1, disabled = isModuleDisabled, }, width = { diff --git a/ls_UI_Options/bars/bar.lua b/ls_UI_Options/bars/bar.lua index a9e578f0..d716f738 100644 --- a/ls_UI_Options/bars/bar.lua +++ b/ls_UI_Options/bars/bar.lua @@ -109,6 +109,13 @@ function CONFIG:CreateBarOptions(order, barID, name) BARS:For(barID, "UpdateButtonConfig") end, }, + scale = { + order = inc(1), + type = "range", + name = L["SCALE"], + isPercent = true, + min = 1, max = 2, step = 0.01, bigStep = 0.05, + }, num = { order = inc(1), type = "range", @@ -125,7 +132,7 @@ function CONFIG:CreateBarOptions(order, barID, name) order = inc(1), type = "range", name = L["SPACING"], - min = 4, max = 24, step = 2, + min = 4, max = 24, step = 1, }, width = { order = inc(1), @@ -344,7 +351,9 @@ function CONFIG:CreateBarOptions(order, barID, name) if barID == "bar1" then temp.args.reset.disabled = isModuleDisabledOrRestricted temp.args.visible.disabled = isModuleDisabledOrRestricted - temp.args.num.disabled = isModuleDisabledOrRestricted + if BARS:IsRestricted() then + temp.args.num.min = 6 + end temp.args.per_row.disabled = isModuleDisabledOrRestricted temp.args.spacing.disabled = isModuleDisabledOrRestricted temp.args.width.disabled = isModuleDisabledOrRestricted diff --git a/ls_UI_Options/bars/core.lua b/ls_UI_Options/bars/core.lua index 8a078b55..f86daa74 100644 --- a/ls_UI_Options/bars/core.lua +++ b/ls_UI_Options/bars/core.lua @@ -166,23 +166,6 @@ function CONFIG:CreateActionBarsOptions(order) return not (BARS:IsInit() and BARS:IsRestricted()) end, }, - scale = { - order = inc(1), - type = "range", - name = L["SCALE"], - min = 1, max = 2, step = 0.01, bigStep = 0.1, - get = function() - return C.db.profile.bars.scale - end, - set = function(_, value) - C.db.profile.bars.scale = value - - BARS:UpdateScale() - end, - disabled = function() - return not (BARS:IsInit() and BARS:IsRestricted()) - end, - }, blizz_vehicle = { order = inc(1), type = "toggle", @@ -605,7 +588,7 @@ function CONFIG:CreateActionBarsOptions(order) order = inc(2), type = "range", name = L["WIDTH"], - min = 530, max = 1900, step = 2, + min = 256, max = 5120, step = 2, disabled = isXPBarDisabledOrRestricted, set = function(info, value) if C.db.profile.bars.xpbar[info[#info]] ~= value then diff --git a/ls_UI_Options/bars/extra.lua b/ls_UI_Options/bars/extra.lua index ac9a7f70..fc9f93e9 100644 --- a/ls_UI_Options/bars/extra.lua +++ b/ls_UI_Options/bars/extra.lua @@ -86,6 +86,13 @@ function CONFIG:CreateExtraBarOptions(order, barID, name) BARS:For(barID, "UpdateArtwork") end, }, + scale = { + order = inc(1), + type = "range", + name = L["SCALE"], + isPercent = true, + min = 0.5, max = 1.5, step = 0.01, bigStep = 0.05, + }, spacer_2 = { order = inc(1), type = "description", diff --git a/ls_UI_Options/general/colors.lua b/ls_UI_Options/general/colors.lua index b4e2b332..a5c73d4f 100644 --- a/ls_UI_Options/general/colors.lua +++ b/ls_UI_Options/general/colors.lua @@ -887,6 +887,11 @@ function CONFIG:GetColorsOptions(order) type = "color", name = L["OOR"], }, + equipped = { + order = inc(2), + type = "color", + name = L["EQUIPMENT"], + }, }, }, cooldown = { diff --git a/ls_UI_Options/ls_UI_Options.toc b/ls_UI_Options/ls_UI_Options.toc index 8ae7e204..6d0a6553 100644 --- a/ls_UI_Options/ls_UI_Options.toc +++ b/ls_UI_Options/ls_UI_Options.toc @@ -2,6 +2,7 @@ ## Author: lightspark ## Title: LS: |cff1a9fc0UI|r |cff888987OptionsUI|r ## Notes: Options for LS: |cff1a9fc0UI|r. +## IconTexture: Interface\AddOns\ls_UI\assets\logo-64 ## RequiredDeps: ls_UI ## LoadOnDemand: true